mirror of
https://github.com/nathanriggs/AppleIIAsm-Collection.git
synced 2024-11-28 03:52:10 +00:00
12a0b19398
- added some error control - added initial jump table - fixed a few minor bugs - separated common library into separate subroutine files
44 lines
1.2 KiB
Plaintext
44 lines
1.2 KiB
Plaintext
MEMFILL
|
|
PLA
|
|
STA RETADR
|
|
PLA
|
|
STA RETADR+1
|
|
PLA
|
|
STA :VALUE
|
|
PLA
|
|
STA :ARYSZ
|
|
PLA
|
|
STA :ARYSZ+1
|
|
PLA
|
|
STA ADDR1 ; ZERO PAGE POINTER
|
|
PLA ; DEFINED IN
|
|
STA ADDR1+1 ; DECS
|
|
LDA :VALUE ; GET VAL FOR FILL
|
|
LDX :ARYSZ+1 ; X=# OF PAGES TO DO
|
|
BEQ :PARTPG ; BRANCH IF HIGHBYTE OF SZ = 0
|
|
LDY #0
|
|
:FULLPG
|
|
STA (ADDR1),Y
|
|
INY ; INC TO NEXT BYTE
|
|
BNE :FULLPG ; BRANCH IF NOT DONE W/ PAGE
|
|
INC ADDR1+1 ; ADVANCE TO NEXT PAGE
|
|
DEX
|
|
BNE :FULLPG ; BRANCH IF NOT DONE W/ PAGES
|
|
:PARTPG
|
|
LDX :ARYSZ ;GET # OF BYTES IN FINAL PAGE
|
|
BEQ :EXIT ; BRANCH IF LOW BYTE = 0
|
|
LDY #0
|
|
:PARTLP
|
|
STA (ADDR1),Y ; STORE VAL
|
|
INY ; INCREMENT INDEX
|
|
DEX ; DECREMENT COUNTER
|
|
BNE :PARTLP ; BRANCH IF NOT DONE
|
|
:EXIT
|
|
LDA RETADR+1
|
|
PHA
|
|
LDA RETADR
|
|
PHA
|
|
RTS
|
|
:VALUE DS 1 ; FILL VALUE
|
|
:ARYSZ DS 2 ; ARRAY SIZE
|