84PCE:Syscalls:0002E8: Difference between revisions

From WikiTI
Jump to navigationJump to search
No edit summary
No edit summary
Line 9: Line 9:


=== Inputs ===
=== Inputs ===
A = Sector to clear
* A = Sector to clear


=== Outputs ===
=== Outputs ===
Sector erased
* Sector erased


=== Destroys ===
=== Destroys ===

Revision as of 06:50, 26 May 2016

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