84PCE:RAM:D01508: Difference between revisions
From WikiTI
Jump to navigationJump to search
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
[[Category:84PCE:RAM:By Address| | [[Category:84PCE:RAM:By Address|D0053F - tempSP]] [[Category:84PCE:RAM:By Name|tempSP]] | ||
== Synopsis == | == Synopsis == | ||
'''Unofficial Name:''' | '''Unofficial Name:''' tempSP | ||
'''Memory Address:''' | '''Memory Address:''' D0053Fh | ||
'''Length:''' 3 bytes | '''Length:''' 3 bytes | ||
When the OS is checking the stack depth, it uses this region of memory to load hl with sp. For instance: | |||
ld (tempSP),sp | |||
ld hl,(tempSP) | |||
It can generally be used as a temporary data location, although it may be written to at some points. | |||
==Why this is silly== | |||
However, it is simply beyond me why they didn't simply do this, to save a ton of bytes and speed. | |||
or a,a | |||
sbc hl,hl | |||
add hl,sp | |||
Revision as of 15:28, 26 May 2016
Synopsis
Unofficial Name: tempSP
Memory Address: D0053Fh
Length: 3 bytes
When the OS is checking the stack depth, it uses this region of memory to load hl with sp. For instance:
ld (tempSP),sp ld hl,(tempSP)
It can generally be used as a temporary data location, although it may be written to at some points.
Why this is silly
However, it is simply beyond me why they didn't simply do this, to save a ton of bytes and speed.
or a,a sbc hl,hl add hl,sp