Difference between revisions of "84PCE:Syscalls:0002E8"
From WikiTI
		
		
		
 (→Outputs)  | 
				|||
| Line 1: | Line 1: | ||
| − | [[Category:84PCE:Syscalls:By Name|  | + | [[Category:84PCE:Syscalls:By Name|EraseFlashSector]]  | 
| − | [[Category:84PCE:Syscalls:By Address|  | + | [[Category:84PCE:Syscalls:By Address|0002DC - EraseFlashSector]]  | 
== Synopsis ==  | == Synopsis ==  | ||
| − | '''Hypothesized Official Name:'''   | + | '''Hypothesized Official Name:''' EraseFlashSector  | 
| − | '''Syscall Address:'''   | + | '''Syscall Address:''' 0002DCh  | 
| − | + | Erases an entire sector (64kb) of flash memory. This basically resets the bytes in the sector back to the nominal value of FF.  | |
=== Inputs ===  | === Inputs ===  | ||
| − | A =   | + | A = Sector to clear  | 
| − | + | ||
| − | + | ||
=== Outputs ===  | === Outputs ===  | ||
| − | + | Sector erased  | |
=== 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>  | ||
Revision as of 22:49, 25 May 2016
Contents
Synopsis
Hypothesized Official Name: EraseFlashSector
Syscall Address: 0002DCh
Erases an entire sector (64kb) of flash memory. This basically resets the bytes in the sector back to the nominal value of FF.
Inputs
A = Sector to clear
Outputs
Sector erased
Destroys
- 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.
EraseFlashSector: ld bc,0000F8h push bc jp _EraseFlashSector