Absolute Addressing
z80
» Variables
We already went over previously how the TI86 switches in and out
ROM and RAM Pages so you can look back
at that if you want to refresh yourself real quick. Here is a chart that
tells the equivalents of the Absolute Address Pointer (ABS) to the RAM Page
with an 16 bit address (addressing using the register pairs: de
,
bc
, hl
, and ix
).
$0c000 to $0ffff
| 0
| $c000 to $ffff
|
$10000 to $13fff
| 1
| $8000 to $bfff
|
$14000 to $17fff
| 2
| $8000 to $bfff
|
$18000 to $1bfff
| 3
| $8000 to $bfff
|
$1c000 to $1ffff
| 4
| $8000 to $bfff
|
$20000 to $23fff
| 5
| $8000 to $bfff
|
$24000 to $27fff
| 6
| $8000 to $bfff
|
$28000 to $2bfff
| 7
| $8000 to $bfff
|
You don't really have to know this table. It really isn't helpful in a
program or anything. I just thought I'd copy it down for you. It's
basically just to illustrate how the TI86's system of 24 bit (ahl
or bde
, absolute pointers) can be converted to a 16 bit (hl
,
bc
, de
, or ix
, register pair pointers). The TI86's
own routines deal with this mainly. One call that converts ABS ahl
into a RAM Page and a 16 bit address is _Load_RAM_ahl.
_Load_RAM_ahl=$462f
Converts ABS pointer ahl into RAM page and hl as
pointer (loads RAM page)
|
ahl - ABS pointer (24 bit)
|
ahl
|
appropriate RAM page loaded
hl - address on that page according to ahl
|
_Conv_ahl=$4633
Converts ABS pointer ahl into RAM page and hl as
pointer (does not load RAM page)
|
ahl - ABS pointer (24 bit)
|
ahl
|
a - RAM page to load
hl - address on that page according to ahl
|
_Set_ABS_Src_Addr=$4647
Copies ahl into _Abs_Src_Addr for use with block copies
|
ahl is ABS pointer
|
none
|
ahl is stored in _Abs_Src_Addr for use with block
copies
|
_Set_ABS_Dest_Addr=$5285
Copies ahl into _Abs_Dest_Addr for use
with block copies
|
ahl is ABS pointer
|
none
|
ahl is stored in _Abs_Dest_Addr for use
with block copies
|
_Set_MM_Num_Bytes=$464f
Sets number of bytes to be copied in ABS block copies
|
ahl is ABS pointer
|
none
|
ahl is stored in _MM_Num_Bytes
for use with block copies
|
_MM_Ldir=$52ed
Performs ABS pointer block copy like ldir
|
ABS_Src_Addr - source to copy from
ABS_Dest_Addr - destination to copy to
MM_Num_Bytes - number of bytes to copy
Note: These are all setup using
_Set_ABS_Src_Addr,
_Set_ABS_Dest_Addr, and
_Set_MM_Num_Bytes.
|
none
|
Abs_Src_Addr , Abs_Dest_Addr ,
mm_num_bytes - modified just like
ldir does in 16 bit block copies
|
_ABS_Mov10toOP1_NoSet=$5239
Copy 10 bytes from ABS pointer in _ABS_Src_Addr
to OP1
|
Abs_Src_Addr - ABS pointer of where to copy from
|
a and hl
|
OP1 - a copy of the 10 bytes starting at
Abs_Src_Addr
|
_ABS_Mov10B=$5249
Move 10 bytes from ABS pointer in _Abs_Src_Addr
to ABS pointer in _Abs_Dest_Addr
|
Abs_Src_Addr - ABS pointer of where to copy from
|
a and hl
|
Abs_Dest_Addr - ABS pointer of where 10
bytes copied to
|
_ABS_MovFrOP1=$5245
Move 10 bytes from OP1 to the ABS pointer
in _Abs_Dest_Addr
|
ABS pointer in _Abs_Dest_Addr where to copy to
OP1 - 10 bytes to copy
|
a and hl
|
ABS pointer in _Abs_Dest_Addr where copied to
|
_DataSize=$477f
After performing _FindSym, use
it to find the variable's size.
|
The output of _FindSym
(like _Delvar=$475f).
|
a, bc, de , and hl
|
c - variable type
de - size of variable's data
carry cleared
|
_Inc_Ptr_ahl=$4637
Increase the ABS pointer ahl
|
ahl - the ABS pointer to increase
|
ahl (always l , sometimes h , rarely
a )
|
ahl = ahl + 1
|
_Inc_Ptr_ade=$45ef
Increase the ABS pointer ade
|
ade - the ABS pointer to increase
|
ade (always e , sometimes d , rarely
a )
|
ade code> = ade + 1
|
_Inc_Ptr_bde=$463F
Increase the ABS pointer bde
|
bde - the ABS pointer to increase
|
bde (always e , sometimes d , rarely
b )
|
bde = bde + 1
|
_Dec_Ptr_ahl=$463b
Decrease the ABS pointer ahl
|
ahl - the ABS pointer to decrease
|
ahl (always l , sometimes h , rarely
a )
|
ahl = ahl - 1
|
_Dec_Ptr_ade=$46bf
Decrease the ABS pointer ade
|
ade - the ABS pointer to decrease
|
ade (always e , sometimes d , rarely
a )
|
ade = ade - 1
|
_Dec_Ptr_bde=$4643
Decrease the ABS pointer ade
|
ade - the ABS pointer to decrease
|
ade (always e , sometimes d , rarely
a )
|
ade = ade - 1
|
_GetB_AHL=$46c3
Gets the byte at ABS ahl
|
ahl - where to get byte from
|
a and hl
|
a - byte at ABS ahl
hl - converted ahl to 16 bit address
hl and correct RAM
page swapped
|
_RAM_Page_1=$47e3
Loads RAM page 1 (Floating Point Stack)
|
none
|
none
|
RAM Page 1 swapped in
|
_RAM_Page_7=$47f3
Loads RAM page 7 (Variable Allocation Table)
|
none
|
none
|
RAM Page 7 swapped in
|
_WriteB_Inc_ahl=$5567
Store a byte at ABS ahl
|
c - the byte to store
ahl - the ABS pointer
to where to store to
|
ahl is incremented just like
_Inc_Ptr_ahl
|
c is stored at ahl
ahl = ahl + 1
|
_Cp_ahl_bde=$46c7
Compare the bytes at ahl and bde much
like cp .
|
ahl and bde are ABS pointers to the
byte being checked
|
none
|
Flags set accordingly
|
_Ex_ahl_bde=$45f3
Exchange the ABS pointers ahl and bde much
like ex de,hl
|
ahl and bde are the ABS addresses to be
swapped around.
|
ahl now is bde
bde is now ahl
|
ahl now is bde
bde is now ahl
|
_Get_Word_ahl=$521d
Get the word at ABS ahl
|
ahl - where to get the two bytes from
|
de and ahl
|
de = (ahl )
ahl = ahl + 2
|
_Set_Word_ahl=$5221
Load de into memory at ahl
|
ahl - where to set the two bytes
|
ahl
|
(ahl ) = de
ahl = ahl + 2
|
_ahl_Plus_2_Pg3=$4c3f
Increments ahl twice
|
ahl - address to increment
|
ahl is always two more
|
ahl = ahl + 2
|
More from
z80
» Variables
Absolute Addressing
//
Binary Coded Decimal
//
Creating Variables
//
External Levels
//
_FindSym
//
Messing with Variable Data
//
OP Math
//
TI-OS Variable Manipulation
//
Variable Name Format
//
VAT Searches