Difference between revisions of "84PCE:RAM:D01508"

From WikiTI
Jump to: navigation, search
(Undo revision 11185 by MateoConLechuga (talk))
 
Line 1: Line 1:
[[Category:84PCE:RAM:By Address|D0053F - tempSP]] [[Category:84PCE:RAM:By Name|tempSP]]
+
[[Category:84PCE:RAM:By Address|D01508 - lastEntryStkPtr]] [[Category:84PCE:RAM:By Name|lastEntryStkPtr]]
 
== Synopsis ==
 
== Synopsis ==
'''Unofficial Name:''' tempSP
+
'''Unofficial Name:''' lastEntryStkPtr
  
'''Memory Address:''' D0053Fh
+
'''Memory Address:''' D01508h
  
 
'''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:
+
This is a pointer to the next available byte in the user entry stack.
 
+
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
+

Latest revision as of 07:30, 26 May 2016

Synopsis

Unofficial Name: lastEntryStkPtr

Memory Address: D01508h

Length: 3 bytes

This is a pointer to the next available byte in the user entry stack.