Difference between revisions of "83Plus:BCALLs:4F54"

From WikiTI
Jump to: navigation, search
 
(C is also destroyed; both A and C are destroyed to keep the same page in bank A)
Line 15: Line 15:
  
 
=== Destroys ===
 
=== Destroys ===
* A
+
* A, C
  
 
== Notes ==
 
== Notes ==
For whatever reason, this routine preserves HL, but not A.
+
Registers A and C are destroyed to restore the page located in [[83Plus:Ports:06|bank A]] after this call completes.
  
In theory, it works for any ROM or RAM page, but the OS uses it to quickly read a byte from Flash ROM.
+
In theory, it works for any ROM (other than 0) or RAM page, but the OS uses it to quickly read a byte from Flash ROM.
  
 
== Example ==
 
== Example ==

Revision as of 17:59, 19 December 2006

Synopsis

Unofficial Name: GetBytePaged

BCALL Address: 4F54

Gets a byte from a specific page and address.

Inputs

  • HL = offset into page where byte is located (4000h-7FFFh).
  • A = page where byte is located.

Outputs

  • B = byte.

Destroys

  • A, C

Notes

Registers A and C are destroyed to restore the page located in bank A after this call completes.

In theory, it works for any ROM (other than 0) or RAM page, but the OS uses it to quickly read a byte from Flash ROM.

Example

Get first byte of page 03h:

 ld a,03h
 ld hl,4000h
 B_CALL GetBytePaged
 ;B contains byte