Re: A85: JUMP_() bytes


[Prev][Next][Index][Thread]

Re: A85: JUMP_() bytes




call is just a macro.  from the usgard.h file, it is:

#DEFINE CALL_(addr)             call $8C0F \ .dw addr

it is the same in the ZShell header file.  a call instruction takes 3
bytes, and the define word takes 2 bytes.  3+2=5 bytes.  each time you
put CALL_(Label), the following code is inserted in its place:

 ....			;code before macro
 call $8C0F		;a function inside of ZShell
 .dw Label		;16 bit addr from origin of program
 ....			;code after macro

Label:			;my subroutine
 ....

i've never written a shell, but i would assume the routine at address
$8C0F does the following: the shell takes the 16 bit offset address
(the address is found by using the address on top of the stack), adds
it to the program_addr to get the absolute address in RAM, increments
the address on top of the stack by 2 so the return will occur at the
line of code following ".dw Label" and jumps (jp) to the absolute
address.

-mike pearce

>
>Is it the same number of bytes for the Zshell JUMP_() command as in 
>others (I use TASM to assemble)?
>
>
>______________________________________________________
>Get Your Private, Free Email at http://www.hotmail.com
>


References: