At C code part:
Code:
int fp;
int open_file(char* filename);
....
fp = open_file(filename);
Assembly part:
....
global open_file
open_file:
push bp
mov bp,sp
push bx
push dx
mov ah, 0x3d
mov al, 0x00 ; read-only
mov bx, [bp + 4] ; file_name segment in DS
mov ds, bx
mov dx, [bp + 6] ; file_name offset in DX
int 0x21 ; open file
jc open_error ; if carry is set file could not open
mov handler, ax
pop dx
pop bx
pop bp
ret 4
open_error:
mov ah,1
pop dx
pop bx
pop bp
ret 4
I would appreciate your help. Thanks a lot for your time


