On Thu, 31 May 2018 14:15:19 -0500
John Gardner <[email protected]> wrote:

> Your code can figure out it's execution address  with something like:
> 
>          call      @Boo
> Boo   pop     B
>          pop     A
> 
> Boo's address is now in register pair A,B...
> 
Umm, on a point of order...
I see what you're saying there, and neat trick! But...

pop B pulls a 16bit value off the stack into BC
pop A is (probably) going to be a syntax error. It would be "pop psw"
in Intel or "pop AF" in Z80 and anyway not what you want.

This isn't a 6809, you can't pop into (A,B). :-(

So what you want to say is...
[boring 8080 code]
     call boo
boo  pop b ; BC = address of boo
[more code]

Code in Assembly, and grow strong
Willard
-- 
Willard Goosey  [email protected]
Socorro, New Mexico, USA
I search my heart and find Cimmeria, land of Darkness and the Night.
  -- R.E. Howard

Reply via email to