I´m tried to open a file to write in it, but in every place that I look for, they say to me that I need enter with the off set value, like in the bellow example .
mov ax,3d02h
mov dx,offset cs:fname ; DX=*FileName
int 21h ; DOS/FileOpen
jc errorlbl ; Jump On Errors
mov word ptr [offset cs:fname],ax ; BX=Handle
mov bx,ax
mov ax,4200h
xor cx,cx ; Segment
mov dx,23ceh ; Offset
int 21h ; DOS/FileSeekSet
jc errorlbl ; Error !
mov ax,4000h
mov bx,word ptr [offset fname] ; BX=Handle
mov cx,6 ; Lenght
mov dx,offset patch ; Buffer
int 21h ; DOS/WriteFile
jc errorlbl
mov ax,3e00h
mov bx,word ptr [offset fname] ; BX=Handle
int 21h ; DOS/CloseFile
jc errorlbl
My answer is : How can i found the offset value of a specifie instruction ?
mov ax,3d02h
mov dx,offset cs:fname ; DX=*FileName
int 21h ; DOS/FileOpen
jc errorlbl ; Jump On Errors
mov word ptr [offset cs:fname],ax ; BX=Handle
mov bx,ax
mov ax,4200h
xor cx,cx ; Segment
mov dx,23ceh ; Offset
int 21h ; DOS/FileSeekSet
jc errorlbl ; Error !
mov ax,4000h
mov bx,word ptr [offset fname] ; BX=Handle
mov cx,6 ; Lenght
mov dx,offset patch ; Buffer
int 21h ; DOS/WriteFile
jc errorlbl
mov ax,3e00h
mov bx,word ptr [offset fname] ; BX=Handle
int 21h ; DOS/CloseFile
jc errorlbl
My answer is : How can i found the offset value of a specifie instruction ?