Difference between revisions of "84PCE:Syscalls:0002E8"

From WikiTI
Jump to: navigation, search
 
Line 1: Line 1:
[[Category:84PCE:Syscalls:By Name|EraseFlashSector]]
+
[[Category:84PCE:Syscalls:By Name|WriteFlashA]]
[[Category:84PCE:Syscalls:By Address|0002DC - EraseFlashSector]]
+
[[Category:84PCE:Syscalls:By Address|0002E8 - WriteFlashA]]
 
== Synopsis ==
 
== Synopsis ==
'''Hypothesized Official Name:''' EraseFlashSector
+
'''Hypothesized Official Name:''' WriteFlashA
  
'''Syscall Address:''' 0002DCh
+
'''Syscall Address:''' 0002E8h
  
Erases an entire sector (64kb) of flash memory. This basically resets the bytes in the sector back to the nominal value of FF.
+
Writes a byte in register A to flash (This is equivalent to an 'and' with the current byte in flash). Flash must be unlocked in order to use this routine, and locked sectors should not be written to.
  
 
=== Inputs ===
 
=== Inputs ===
* A = Sector to clear
+
A = Byte to write
 +
 
 +
DE = Address to write to
  
 
=== Outputs ===
 
=== Outputs ===
* Sector erased
+
Byte 'anded' with byte in flash stored
  
 
=== Destroys ===
 
=== Destroys ===
 
* All
 
* All
 
=== Notes ===
 
This routine actually checks the caller PC address to ensure it was called from a suitable location. A workaround is as follows using the fact that 0000F8 consists of a jump to a ret instruction.
 
 
<pre>EraseFlashSector:
 
ld bc,0000F8h
 
push bc
 
jp _EraseFlashSector</pre>
 

Latest revision as of 23:50, 25 May 2016

Synopsis

Hypothesized Official Name: WriteFlashA

Syscall Address: 0002E8h

Writes a byte in register A to flash (This is equivalent to an 'and' with the current byte in flash). Flash must be unlocked in order to use this routine, and locked sectors should not be written to.

Inputs

A = Byte to write

DE = Address to write to

Outputs

Byte 'anded' with byte in flash stored

Destroys

  • All