Advertisement
MichaelPetch

far ptr

Nov 7th, 2020 (edited)
692
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. bits 16
  2. org 0x7c00
  3.  
  4. ; You can do a indirect jump to a FAR PTR specified as a memory operand
  5. ; like this:
  6. jmp far [farptr]
  7.  
  8. ; or this (note pushing an immediate can only be done on 80186+)
  9. ; on an 8086 you can MOV a value to a register and then push the register
  10.  
  11. ; push 0x0000 ; Push a segment
  12. ; push 0x7ea5 ; Push an offset
  13. ; retf ; FAR Return
  14.  
  15. ; ... other code and data
  16.  
  17. farptr:
  18. dw 0x7ea5 ; FAR PTR offset
  19. dw 0x0000 ; FAR PTR segment
  20. ; or
  21. ; dd 0x00007ea5
  22.  
  23. times 510-($-$$) db 0x00
  24. dw 0xaa55
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement