Difference between revisions of "84PCE:Ports:003A"

From WikiTI
Jump to: navigation, search
(Synopsis)
 
(2 intermediate revisions by 2 users not shown)
Line 5: Line 5:
 
'''Function:''' Stack Protector Ports
 
'''Function:''' Stack Protector Ports
  
This range of ports holds the location of the bottom of the stack. When the the default address D19881 is written to, a non-maskable interrupt is generated which resets the calculator, clearing all of RAM. This could potentially have uses such as a hardware breakpoint in z80 mode.
+
This range of ports holds the location of the bottom of the stack (LSB in 3A, MSB in 3C). When the byte at this address (the OS sets it to D19881 by default) is written to, the write affects memory and a non-maskable interrupt is generated (regardless of whether the code is privileged) which resets the calculator, clearing all of RAM. This could potentially have uses such as a hardware write breakpoint in z80 mode.
  
 
==Example==
 
==Example==

Latest revision as of 20:35, 26 August 2016

Synopsis

Port Number: 003A-003C

Function: Stack Protector Ports

This range of ports holds the location of the bottom of the stack (LSB in 3A, MSB in 3C). When the byte at this address (the OS sets it to D19881 by default) is written to, the write affects memory and a non-maskable interrupt is generated (regardless of whether the code is privileged) which resets the calculator, clearing all of RAM. This could potentially have uses such as a hardware write breakpoint in z80 mode.

Example

Since the stack protector is extremely simple, this equally simple program will cause a crash.

ld (0D19881h),a
ret