Difference between revisions of "83Plus:Ports:07"

From WikiTI
Jump to: navigation, search
m (Example: used the stack to store the old page)
m
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
[[Category:83Plus:Ports:By_Address|07 - Memory Page B]] [[Category:83Plus:Ports:By_Name|Memory Page B]]
 
== Synopsis ==
 
== Synopsis ==
 
'''Port Number:''' 07h
 
'''Port Number:''' 07h
Line 4: Line 5:
 
'''Function:''' Flash/RAM Memory Paging (Bank B)
 
'''Function:''' Flash/RAM Memory Paging (Bank B)
  
This port controls what page is swapped into Memory Bank B (see comments).
+
This port controls what page is swapped into Memory Bank B (see comments). On the TI-84+CSE, port [[83Plus:Ports:0F|0F]] also affects MemB.
 +
 
 +
See also [[83Plus:Memory Mapping|Memory Mapping]].
  
 
=== Read Values ===
 
=== Read Values ===
* The current port mapped to Memory Bank B (see comments).
+
* The current port mapped to Memory Bank B.
 
** 83+ Basic: If a RAM page is swapped in, the port reads the RAM page number with bit 6 set. If a ROM page is swapped in, the port reads the ROM page number with bit 6 reset.
 
** 83+ Basic: If a RAM page is swapped in, the port reads the RAM page number with bit 6 set. If a ROM page is swapped in, the port reads the ROM page number with bit 6 reset.
 
** 83+ Silver, any 84+: If a RAM page is swapped in, the port reads the RAM page number with bit 7 set. If a ROM page is swapped in, the port reads the ROM page number with bit 7 reset.
 
** 83+ Silver, any 84+: If a RAM page is swapped in, the port reads the RAM page number with bit 7 set. If a ROM page is swapped in, the port reads the ROM page number with bit 7 reset.
  
 
=== Write Values ===
 
=== Write Values ===
* The page number to swap into Memory Bank B (see comments).
+
* The page number to swap into Memory Bank B.
 
** 83+ Basic: If bit 6 is set, bit 0 will choose between the two RAM pages (40h or 41h). If bit 6 is 0, bits 0~4 select a page from ROM (00h through 1Fh).
 
** 83+ Basic: If bit 6 is set, bit 0 will choose between the two RAM pages (40h or 41h). If bit 6 is 0, bits 0~4 select a page from ROM (00h through 1Fh).
 
** 83+ SE, 84+ (any): If bit 7 is set, bits 0~2 will choose any of the 8 RAM pages (80h through 87h). If bit 7 is 0, bits 0~5 on the 84+ Basic, or bits 0~6 on either SE will select a page from ROM (00h through 3Fh or 7Fh).
 
** 83+ SE, 84+ (any): If bit 7 is set, bits 0~2 will choose any of the 8 RAM pages (80h through 87h). If bit 7 is 0, bits 0~5 on the 84+ Basic, or bits 0~6 on either SE will select a page from ROM (00h through 3Fh or 7Fh).
  
 
== Comments ==
 
== Comments ==
The behavior of this port changes in different memory map modes. See [[83Plus:Ports:04|Port 04h]] for details about memory map modes.
+
Under normal circumstanes this port controls the page mapped to 8000h.  The behavior of this port changes in different memory map modes. See [[83Plus:Ports:04|Port 04h]] for details about memory map modes.
  
Unless you're really clever, the calculator will crash if you return to TIOS with anything other than RAM Page 1 (41h on 83+ Basic, 81h on everything else) swapped in.
+
Unless you're really clever, the calculator will crash if you return to TIOS, call most system routines, or even allow an interrupt to occur with anything other than RAM Page 1 (41h on 83+ Basic, 81h on everything else) swapped in.
  
 
== Example ==
 
== Example ==
  <nowiki>push af
+
  <nowiki> di
in a,(7)
+
push af
push af
+
in a,(7)
ld a,1
+
push af
out (7),a
+
ld a,1
; do stuff that needs page 1 swapped in
+
out (7),a
pop af
+
; do stuff that needs page 1 swapped in
out (7),a
+
pop af
pop af</nowiki>
+
out (7),a
 +
pop af
 +
ei</nowiki>

Latest revision as of 21:31, 19 February 2013

Synopsis

Port Number: 07h

Function: Flash/RAM Memory Paging (Bank B)

This port controls what page is swapped into Memory Bank B (see comments). On the TI-84+CSE, port 0F also affects MemB.

See also Memory Mapping.

Read Values

  • The current port mapped to Memory Bank B.
    • 83+ Basic: If a RAM page is swapped in, the port reads the RAM page number with bit 6 set. If a ROM page is swapped in, the port reads the ROM page number with bit 6 reset.
    • 83+ Silver, any 84+: If a RAM page is swapped in, the port reads the RAM page number with bit 7 set. If a ROM page is swapped in, the port reads the ROM page number with bit 7 reset.

Write Values

  • The page number to swap into Memory Bank B.
    • 83+ Basic: If bit 6 is set, bit 0 will choose between the two RAM pages (40h or 41h). If bit 6 is 0, bits 0~4 select a page from ROM (00h through 1Fh).
    • 83+ SE, 84+ (any): If bit 7 is set, bits 0~2 will choose any of the 8 RAM pages (80h through 87h). If bit 7 is 0, bits 0~5 on the 84+ Basic, or bits 0~6 on either SE will select a page from ROM (00h through 3Fh or 7Fh).

Comments

Under normal circumstanes this port controls the page mapped to 8000h. The behavior of this port changes in different memory map modes. See Port 04h for details about memory map modes.

Unless you're really clever, the calculator will crash if you return to TIOS, call most system routines, or even allow an interrupt to occur with anything other than RAM Page 1 (41h on 83+ Basic, 81h on everything else) swapped in.

Example

 di
 push af
 in a,(7)
 push af
 ld a,1
 out (7),a
 ; do stuff that needs page 1 swapped in
 pop af
 out (7),a
 pop af
 ei