1) How do you access a static variable inside a module with ASM
code?
2) How to reference a code address inside the module? For
instance, I need to get the code segment
ffset into DS
X.
I need to write a hook for Interrupt 15h, function 4Fh. I
already have the code working fine using Debug, so the machine
language part is not a problem. I just need to learn how to
incorporate my machine language into ASM statements in
PowerBASIC.
Question #1 is the most urgent. I see plenty of examples for
accessing parameters which are passed, but I don't see how to
access a static variable declared in the module.
Here is the approach I was planning for #2, it seems simple
enough, but please let me know if I'm going astray:
! push cs ; Paranoid transfer to make sure ds points to code
! pop ds
! lea dx,[code_addr]
.... more code in the middle
! code_addr:
! ; routine goes here
I've looked in the first few screens of this board and haven't
seen topics like this discussed, and I also have not seen any
documentation on the ASM statement beyond what is in the manual
(which I did read, I promise!)
Thanks for any help!
Allan
------------------
code?
2) How to reference a code address inside the module? For
instance, I need to get the code segment


I need to write a hook for Interrupt 15h, function 4Fh. I
already have the code working fine using Debug, so the machine
language part is not a problem. I just need to learn how to
incorporate my machine language into ASM statements in
PowerBASIC.
Question #1 is the most urgent. I see plenty of examples for
accessing parameters which are passed, but I don't see how to
access a static variable declared in the module.
Here is the approach I was planning for #2, it seems simple
enough, but please let me know if I'm going astray:
! push cs ; Paranoid transfer to make sure ds points to code
! pop ds
! lea dx,[code_addr]
.... more code in the middle
! code_addr:
! ; routine goes here
I've looked in the first few screens of this board and haven't
seen topics like this discussed, and I also have not seen any
documentation on the ASM statement beyond what is in the manual
(which I did read, I promise!)
Thanks for any help!
Allan
------------------
Comment