Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Offset value

Status
Not open for further replies.

lcontador

Technical User
Joined
Jan 20, 2001
Messages
2
Location
BR
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 ?
 
IP-Instruction Pointer,you can have it from there.
I do not think that you need anything else but to mov 3d02 in ax and offset of the string variable(your file name) in cx;and that's it. Best Regards,

aphrodita@mail.krovatka.ru {uiuc rules}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top