[ASM] How to ld hl,sp?
Moderator: MaxCoderz Staff
[ASM] How to ld hl,sp?
I want to get the stack pointer. How do I do that? There's a ld sp,hl opcode according to WikiTi, but not the other way around...
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
Re: [ASM] How to ld hl,sp?
Timendus wrote:I want to get the stack pointer. How do I do that? There's a ld sp,hl opcode according to WikiTi, but not the other way around...
Code: Select all
ld hl, 0
add hl, sp
If you just want to store SP somewhere, there is also:
Code: Select all
ld (somewhere), sp
...muck with sp...
ld sp, (somewhere)
"I don't know why a refrigerator is now involved, but put that aside for now". - Jim e on unitedti.org
avatar courtesy of driesguldolf.
avatar courtesy of driesguldolf.
Really? Why aren't those opcodes in the WikiTi?
Thanks!
Edit: Never mind, really stupid question
Thanks!
Edit: Never mind, really stupid question
Q 16-bit register: bc, de, hl/ix/iy, sp
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
- benryves
- Maxcoderz Staff
- Posts: 3087
- Joined: Thu 16 Dec, 2004 10:06 pm
- Location: Croydon, England
- Contact:
There's always the Z80 User Manual if you want another reference.Timendus wrote:Really? Why aren't those opcodes in the WikiTi?
(Edit: Hm, didn't realise WikiTI had anything about the Z80 on it at all).
Last edited by benryves on Thu 06 Dec, 2007 11:23 am, edited 1 time in total.
I guess we should be grateful for that
Anyway, it's working. See mailinglist for details.
Anyway, it's working. See mailinglist for details.
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
I usually just Google for a random z80 opcode reference when I need one, but this time I happened to be on WikiTi...
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
And don't forget Thomas Scherrers Z80 support page. Tons of info there.
"I don't know why a refrigerator is now involved, but put that aside for now". - Jim e on unitedti.org
avatar courtesy of driesguldolf.
avatar courtesy of driesguldolf.
Why is it that this doc and asmguru both list the conditional JP instructions as taking 1 T-State when the jump is not taken?
My guess is that one of them left off the "0" and the other copied the mistake.
"I don't know why a refrigerator is now involved, but put that aside for now". - Jim e on unitedti.org
avatar courtesy of driesguldolf.
avatar courtesy of driesguldolf.
- tr1p1ea
- Maxcoderz Staff
- Posts: 4141
- Joined: Thu 16 Dec, 2004 10:06 pm
- Location: I cant seem to get out of this cryogenic chamber!
- Contact:
I have noticed a few mistakes, but i wouldnt say its a terrible reference. Certainly helped me out .
Another one i find handy is: http://www.geocities.com/SiliconValley/ ... 0_home.htm
Another one i find handy is: http://www.geocities.com/SiliconValley/ ... 0_home.htm
- calc84maniac
- Regular Member
- Posts: 112
- Joined: Wed 18 Oct, 2006 7:34 pm
- Location: The ex-planet Pluto
- Contact:
Heh, might as well post mine too. It's concise and to the point, holds most z80 command info you'll ever need (and more), and easily printable on one page.
calc84maniac's z80 reference
calc84maniac's z80 reference
~calc84maniac has spoken.
Projects:
F-Zero 83+
Project M (Super Mario for 83+)
Projects:
F-Zero 83+
Project M (Super Mario for 83+)