Difference between revisions of "83Plus:BCALLs:5017"
(Initial) |
(Added a gotcha) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
[[Category:83Plus:BCALLs:By_Name:Memory|FlashToRAM]] [[Category:83Plus:BCALLs:By_Name|FlashToRAM]] [[Category:83Plus:BCALLs:By_Address|5017 - FlashToRAM]] | [[Category:83Plus:BCALLs:By_Name:Memory|FlashToRAM]] [[Category:83Plus:BCALLs:By_Name|FlashToRAM]] [[Category:83Plus:BCALLs:By_Address|5017 - FlashToRAM]] | ||
− | |||
== Synopsis == | == Synopsis == | ||
'''Official Name:''' FlashToRAM | '''Official Name:''' FlashToRAM | ||
Line 6: | Line 5: | ||
'''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 21: | ||
* 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 === | ||
− | * | + | * A |
− | + | ||
− | + | ||
− | + | === Bugs === | |
+ | On the TI-84+ non-SE, this routine will not let you read from pages equal to or above 80h (it does AND 3Fh). |
Latest revision as of 13:23, 14 November 2012
Contents
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
Bugs
On the TI-84+ non-SE, this routine will not let you read from pages equal to or above 80h (it does AND 3Fh).