My goal is to create a high score table.
But when I run my progrem, it's always writting on what was written in the file before.
I tried to change the file handler value, but the result was that an error occured (ax= 06h).
Any idea of how I get it fixed?
(this is a code I got from my friend I took my functions from here. the same problem occurs here as well)
buff db 20 dup('a', 'A', 'b', 'B')
;;;;;;;;;; The file read.txt should be at …\tasm\bin
path db 'read.txt',0
inpdesc dw ? ;;; inpdesc=File Handler ( Pointer to the file )
sseg segment stack
dw 100h dup(?)
fwrite proc near
fopen proc near; al=1->write al=0->read dx=lpstr filename
;fclose (desc in stack)
fclose proc near
start: MOV AX,dseg
mov al,1 ;;;; open file to write
mov dx,offset path
mov inpdesc,ax ;;;; AX=File Poiner
mov dx,offset buff
mov cx, 20