AppleIIAsm-Collection/disks/disk3_arrays/T.ARRAYS.MAC.MIN
nathanriggs ad58479739 Disk 3: ARRAYS 0.3.0 updates
- major bugfixes, especially in 2D arrays
- separated each subroutine into own file
- reconfigured arrays to use 1-based indexing
- Arrays.demo uses macros now
- added overflow error handling to get and put routines
2019-01-20 19:14:17 -05:00

77 lines
1.6 KiB
Plaintext

DIM81 MAC
LDA #>]1 ; ARRAY ADDR
PHA
LDA #<]1
PHA
LDA ]2 ; ARRAY LENGTH
PHA
LDA ]3 ; ELEMENT LENGTH
PHA
LDA ]4
PHA ; FILL VAL
JSR ADIM81
<<<
GET81 MAC
LDA #>]1 ; ARRAY ADDR
PHA
LDA #<]1
PHA
LDA ]2 ; ELEM INDEX
PHA
JSR AGET81
<<<
PUT81 MAC
LDA #>]1
PHA ; SRC ADDR
LDA #<]1
PHA
LDA #>]2 ; DEST ARRAY
PHA
LDA #<]2
PHA
LDA ]3 ; DEST INDEX
PHA
JSR APUT81
<<<
DIM82 MAC
LDA #>]1 ; ARRAY ADDR
PHA
LDA #<]1
PHA
LDA ]2 ; X DIM
PHA
LDA ]3 ; Y DIM
PHA
LDA ]4 ; ELEMENT LENGTH
PHA
LDA ]5 ; FILL VAL
PHA
JSR ADIM82
<<<
GET82 MAC
LDA #>]1 ; ARRAY ADDR
PHA
LDA #<]1
PHA
LDA ]2 ; X INDEX
PHA
LDA ]3 ; Y INDEX
PHA
JSR AGET82
<<<
PUT82 MAC
LDA #>]1 ; SRC ADDR
PHA
LDA #<]1
PHA
LDA #>]2 ; ARRAY ADDR
PHA
LDA #<]2
PHA
LDA ]3 ; X INDEX
PHA
LDA ]4 ; Y INDEX
PHA
JSR APUT82
<<<