×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Offset value

Offset value

Offset value

(OP)
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 ?

RE: Offset value


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}
http://www.hellforge.org

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close