Re: A86: link86.asm
[Prev][Next][Index][Thread]
Re: A86: link86.asm
I'm not sure I understand the first question, (nor could I answer it
anyway...) but I think your second question was why the POP HL
instructions are there? POP HL takes the top two bytes off the stack,
and loads them to HL. Since both occurences of this instruction are
right before RET instructions, I must assume that the stack was used in
a previous portion of code to store a value, and the POP HL is to remove
the value that was put onto the stack. If it didn't, the calc would
likely crash, because the RET instruction returns to the address stored
on top of the stack. It would interpret the value there as an address
and go there instead of to the place the routine was called from. The
POP HL is just 'cleaning up' so that the RET doesn't cause problems.
I think that was what you wanted to know; if not then I hope it was
useful anyway.
Cassady Roop
croop@oregontrail.net
Andrew T wrote:
>
> Ok there are three parts of these calls that i dont undestand
> On is after it has opend red or opend white it goes and waits for
> %00000011 wich is both active but i didn't see where made active thus
> wouldn't it just go forver? Second I don't understand both
>
> rbTest_ON:
> ld a,(_OP1)
> inc a
> ld (_OP1),a
> cp 255
> ret nz
> ;why is it poped?
> pop hl ;Back to the place you were before. Gotta love it!
> xor a
> ret
>
> sbSendTest_ON:
> ld a,%00111111
> out (1),a
> nop
> nop
> in a,(1)
> bit 6,a
> ret nz
> ;same thing why was it poped?
> pop hl
> ; pop hl ; instead of returning, jump to
> ; jp Quit ; some program exit code
> ret
>
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com
References: