-
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
-
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.