|
-
Mar 21st, 2001, 12:12 PM
#1
Thread Starter
Hyperactive Member
Can someone please convert this to inline assembler or C code? It's needed quite urgently.
public _setbxdx
.MODEL SMALL ;whatever
.CODE
set_struc struc
dw ? ;old bp
dd ? ;return addr (always far call)
p_bx dw ? ;reg bx value
p_dx dw ? ;reg dx value
set_struc ends
_setbxdx proc far ; must be FAR
push bp
mov bp,sp
mov bx,[bp]+p_bx
mov dx,[bp]+p_dx
pop bp
ret
_setbxdx endp
END
Designer/Programmer of the Comtech Operating System(CTOS)
-
Jun 22nd, 2003, 11:12 PM
#2
Fanatic Member
Sorry it took so long...
This is a first draft, but if you want if revised to a cleaner solution, reply back.
Code:
// Beginning of program
struct set_struc
{
short int OldBP;
long int ReturnAddr;
// I do not recognize this syntax.
p_bx dw ? ;reg bx value
p_dx dw ? ;reg dx value
/////////////////////////////////////////
}
// In function
_asm
{
push bp
mov bp,sp
mov bx,[bp]+p_bx
mov dx,[bp]+p_dx
pop bp
}
I hope this helps.
"Can't" and "shouldn't" are two totally separate things.
All questions should be answered. All answers should be true. That is why I post.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|