I want to be able to call the function from c code like this:
Code: Select all
char a;
a = pullFromMemory(0xB000, 0x8000);
Code: Select all
.global _pullFromMemory
;char pullFromMemory (int segment, int address)
_pullFromMemory:
push bp
mov bp,sp
push ds
mov ax,[bp+4]
mov si,[bp+6]
mov ds,ax
mov cl,[si]
mov al,cl
mov al,#0 ;we only want Ah returned
pop ds
pop bp
ret
Im under the impression that the data in ah is the return value of the function... or am I mistaken?