Difference between revisions of "83Plus:BCALLs:5017"

From WikiTI
Jump to: navigation, search
(Initial)
 
(Noted that the call works on RAM, too.)
Line 6: Line 6:
 
'''BCALL Address:''' 5017
 
'''BCALL Address:''' 5017
  
Copy data to RAM from Flash .
+
Copy data to RAM from Flash. If during copying HL is incremented to 8000h, it advances to the next page and resets HL to 4000h. This uses a RAM stub copied to 8100h.
 +
 
 +
However, if you pass an HL greater than or equal to 8000h, it just does LDIR. So be sure to check HL if you add an offset to address in flash. However, this routine is perfect for checking the header of an object without caring whether it's in RAM or flash. (Though it isn't very fast.)
 +
 
 +
This routine masks the page in A to a page number that is valid for the current model. For example, if you ask for data on page 7D, it will mask A to 3D on the TI-84+ and 1D on the TI-83+ (because asking for 7D on the TI-83+ would otherwise return RAM).
  
 
=== Inputs ===
 
=== Inputs ===
Line 18: Line 22:
 
* DE advanced by BC bytes
 
* DE advanced by BC bytes
 
* BC = 0
 
* BC = 0
 +
* Warning: A does ''not'' equal the page it finished copying from. (It equals the page in port 6 before.)
  
 
=== Destroys ===
 
=== Destroys ===
*Unkown (probably A)
+
* A
 
+
== Comments ==
+
 
+
This will wrap to the next page if need be.
+

Revision as of 15:24, 13 November 2012

This article is missing some information (namely Destroys). You can help WikiTI by filling in the missing information.


Synopsis

Official Name: FlashToRAM

BCALL Address: 5017

Copy data to RAM from Flash. If during copying HL is incremented to 8000h, it advances to the next page and resets HL to 4000h. This uses a RAM stub copied to 8100h.

However, if you pass an HL greater than or equal to 8000h, it just does LDIR. So be sure to check HL if you add an offset to address in flash. However, this routine is perfect for checking the header of an object without caring whether it's in RAM or flash. (Though it isn't very fast.)

This routine masks the page in A to a page number that is valid for the current model. For example, if you ask for data on page 7D, it will mask A to 3D on the TI-84+ and 1D on the TI-83+ (because asking for 7D on the TI-83+ would otherwise return RAM).

Inputs

  • A = page of Source
  • HL = source address
  • DE = destination address
  • BC = number of bytes to copy

Outputs

  • HL advanced by BC bytes
  • DE advanced by BC bytes
  • BC = 0
  • Warning: A does not equal the page it finished copying from. (It equals the page in port 6 before.)

Destroys

  • A