Re: Sv: A83: Re: Re:


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

Re: Sv: A83: Re: Re:




Oh please... That was pseudo code describing the ret instruction. Your code
might compile better, but ret doesn't trash hl, does it?

Linus

On 15-Sep-98, Thomas Turn Jensen wrote:

>Not that it's very important but couldn't you just have this instead of ret:

>lh hl,(sp)      ; not possible :(
>dec sp
>dec sp
>ld pc,hl        ; not possible

>Anyways, loading pc isn't possible according to the Tasm80.tab so this is
>quite meaningles.


>***
>Thomas Turn Jensen
>Icq uin => 8128636
>IRC, Undernet => Mukke
>***
>Får computeren dig til at sukke?
>Så kald da blot på Mukke
>***


>-----Oprindelig meddelelse-----
>Fra: Alan C Johnson <benjamin99@juno.com>
>Til: assembly-83@lists.ticalc.org <assembly-83@lists.ticalc.org>
>Dato: 13. september 1998 22:22
>Emne: Re: A83: Re: Re:


>>
>>The stack pointer points to the memory location in the RAM that is used
>>for the stack.  Now here's a little bit of useless info.  By the way,
>>does anyone know where thestack memory starts and ends
>>
>>Basically, if there was no push command, you would have to do this:
>>
>> inc sp ; 2 because the stack locations are 16-bits
>> inc sp
>> ld (sp),rr
>>
>>Pop would be:
>> ld rr,(sp)
>> dec sp
>> dec sp
>>
>>Call would be:
>> inc sp
>> inc sp
>> ld (sp),pc
>> jp xxxx ; jp actually being ld pc,xxxx
>>
>>Ret would basically be:
>> ld pc,(sp) ; which would actually be impossible, because it would jump
>>as soon as you
>> dec sp ; loaded the pc register, so it wouldn't post-decrement the
>>stack pointer
>> dec sp
>>
>>
>>>
>>>Would someone like to explain the stack pointer in more detail?  I 
>>>know
>>>*roughly* what it does...no, actually I don't :)...
>>>
>>>Later,
>>>
>>>James Matthews (matthews@tkb.att.ne.jp)
>>>
>>>ICQ: 7413754
>>>http://home.att.ne.jp/gold/tomcat21/index.html
>>>http://library.advanced.org/18242/
>>>
>>>----------
>>>> From: Scott Dial (Revenant) <homosapian@geocities.com>
>>>> To: assembly-83@lists.ticalc.org
>>>> Subject: A83: Re: 
>>>> Date: Sunday, September 13, 1998 9:28 AM
>>>> 
>>>> 
>>>> Exactly that...
>>>> 
>>>> sp is a z80 register for the position of stack pointer... so that he 
>>>can
>>>> return to that exact point later. spbak is defined at the bottom: 
>>>spbak
>>>> .dw $0000
>>>> 
>>>> Patrick W Bambrough wrote:
>>>> > 
>>>> > hey can anyone tell me what this means and if there is an 83
>>>equivelant??
>>>> > ld (spbak),sp
>>>> 
>>>> -- 
>>>> Scott Dial
>>>> revenant_1@hotmail.com
>>>> ICQ#3608935
>>>
>>
>>_____________________________________________________________________
>>You don't need to buy Internet access to use free Internet e-mail.
>>Get completely free e-mail from Juno at http://www.juno.com
>>Or call Juno at (800) 654-JUNO [654-5866]
>>




References: