views:

28

answers:

1
dseg segment
FileName db "hex.txt$"
dseg ends
cseg seg..
...
wrFile proc
 push ax bx cx dx
 mov ax,3D00h
 mov dx, offset fileName
 int 21h
 mov bx,ax
 mov cx,10*type scores
 mov dx,offset highscoresnum
 mov ah,40h
 int 21h
 mov dx,offset highscoresdate
 mov ah,40h
 int 21h
 mov ah,3eh
 int 21h
 pop dx cx bx ax
 ret
wrFile endp

at the first int 21h (ah=3dH) CF is not cleared and AX turns to 2h. in the net it's written that AX holds the error code, but i couldn't find it. what do i do wrong?

+2  A: 

I think you're getting a "file not found" error, because the INT 21h functions that use file or path names generally require them to be terminated with a zero byte, not a '$'.

Matthew Slattery
Correct. According to this: http://www.ctyme.com/intr/rb-2779.htm it's an ASCIZ string, so it's zero terminated.
Guffa