2015-03-14 21:48:35 +00:00
|
|
|
|
NEW
|
2019-07-07 20:48:57 +00:00
|
|
|
|
AUTO 3,1
|
|
|
|
|
.LIST OFF
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA DEBUG
|
2015-06-03 18:30:57 +00:00
|
|
|
|
:1 bit $C000
|
|
|
|
|
bpl :1
|
2015-03-14 21:48:35 +00:00
|
|
|
|
sta $C010
|
|
|
|
|
.EM
|
2015-11-22 22:30:06 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA DEBUGOA
|
|
|
|
|
bit $C061
|
|
|
|
|
bpl :1
|
2017-09-26 06:27:34 +00:00
|
|
|
|
>DEBUG
|
|
|
|
|
:1 .EQ *
|
2015-12-10 18:53:30 +00:00
|
|
|
|
.EM
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* SYSCALLs Macros
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA SYSCALL
|
2016-10-24 15:54:43 +00:00
|
|
|
|
ldx #SYS.]1
|
2017-11-05 21:23:21 +00:00
|
|
|
|
jsr A2osX.SYSCALL
|
2015-03-14 21:48:35 +00:00
|
|
|
|
.EM
|
2017-08-31 15:35:15 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA LIBCALL
|
|
|
|
|
ldy ]1
|
|
|
|
|
ldx #]2
|
|
|
|
|
jsr A2osX.LIBCALL
|
|
|
|
|
.EM
|
2019-05-05 17:15:37 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA SLEEP
|
|
|
|
|
jsr A2osX.SLEEP
|
|
|
|
|
.EM
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA SYSCALL2
|
|
|
|
|
ldx #SYS.]1
|
|
|
|
|
jsr A2osX.SYSCALL2
|
|
|
|
|
.EM
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA MLICALL
|
|
|
|
|
ldx #]1
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.DO ]1=MLIALLOCIRQ
|
2015-03-14 21:48:35 +00:00
|
|
|
|
lda #2
|
|
|
|
|
.FIN
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.DO ]1=MLIDEALLOCIRQ
|
2015-03-14 21:48:35 +00:00
|
|
|
|
lda #1
|
|
|
|
|
.FIN
|
2017-04-28 15:04:16 +00:00
|
|
|
|
.DO ]1=MLIATALK
|
|
|
|
|
lda #1
|
|
|
|
|
.FIN
|
2015-03-14 21:48:35 +00:00
|
|
|
|
.DO ]1=MLIREADBLOCK
|
|
|
|
|
lda #3
|
|
|
|
|
.FIN
|
|
|
|
|
.DO ]1=MLIWRITEBLOCK
|
|
|
|
|
lda #3
|
|
|
|
|
.FIN
|
|
|
|
|
.DO ]1=MLICREATE
|
|
|
|
|
lda #7
|
|
|
|
|
.FIN
|
|
|
|
|
.DO ]1=MLIDESTROY
|
|
|
|
|
lda #1
|
|
|
|
|
.FIN
|
2017-08-24 06:47:31 +00:00
|
|
|
|
.DO ]1=MLIRENAME
|
2015-03-14 21:48:35 +00:00
|
|
|
|
lda #2
|
|
|
|
|
.FIN
|
|
|
|
|
.DO ]1=MLISETFILEINFO
|
|
|
|
|
lda #7
|
|
|
|
|
.FIN
|
|
|
|
|
.DO ]1=MLIGETFILEINFO
|
|
|
|
|
lda #10
|
|
|
|
|
.FIN
|
|
|
|
|
.DO ]1=MLIONLINE
|
|
|
|
|
lda #2
|
|
|
|
|
.FIN
|
|
|
|
|
.DO ]1=MLISETPREFIX
|
|
|
|
|
lda #1
|
|
|
|
|
.FIN
|
|
|
|
|
.DO ]1=MLIGETPREFIX
|
|
|
|
|
lda #1
|
|
|
|
|
.FIN
|
|
|
|
|
.DO ]1=MLIOPEN
|
|
|
|
|
lda #3
|
|
|
|
|
.FIN
|
|
|
|
|
.DO ]1=MLINEWLINE
|
|
|
|
|
lda #3
|
|
|
|
|
.FIN
|
|
|
|
|
.DO ]1=MLIREAD
|
|
|
|
|
lda #4
|
|
|
|
|
.FIN
|
|
|
|
|
.DO ]1=MLIWRITE
|
|
|
|
|
lda #4
|
|
|
|
|
.FIN
|
|
|
|
|
.DO ]1=MLICLOSE
|
|
|
|
|
lda #1
|
|
|
|
|
.FIN
|
|
|
|
|
.DO ]1=MLIFLUSH
|
|
|
|
|
lda #1
|
|
|
|
|
.FIN
|
|
|
|
|
.DO ]1=MLISETMARK
|
|
|
|
|
lda #2
|
|
|
|
|
.FIN
|
|
|
|
|
.DO ]1=MLIGETMARK
|
|
|
|
|
lda #2
|
|
|
|
|
.FIN
|
|
|
|
|
.DO ]1=MLISETEOF
|
|
|
|
|
lda #2
|
|
|
|
|
.FIN
|
|
|
|
|
.DO ]1=MLIGETEOF
|
|
|
|
|
lda #2
|
|
|
|
|
.FIN
|
|
|
|
|
.DO ]1=MLISETBUF
|
|
|
|
|
lda #2
|
|
|
|
|
.FIN
|
|
|
|
|
.DO ]1=MLIGETBUF
|
|
|
|
|
lda #2
|
2017-08-31 15:35:15 +00:00
|
|
|
|
.FIN
|
2017-11-05 21:23:21 +00:00
|
|
|
|
jsr GP.MLICall
|
2015-03-14 21:48:35 +00:00
|
|
|
|
.EM
|
|
|
|
|
*--------------------------------------
|
2019-07-10 15:39:02 +00:00
|
|
|
|
* FPU Entry Point
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
FPU.ADD32 .EQ 0
|
|
|
|
|
FPU.SUB32 .EQ 2
|
|
|
|
|
FPU.MUL32 .EQ 4
|
|
|
|
|
FPU.IMUL32 .EQ 6
|
|
|
|
|
FPU.DIV32 .EQ 8
|
|
|
|
|
FPU.IDIV32 .EQ 10
|
|
|
|
|
FPU.MOD32 .EQ 12
|
|
|
|
|
FPU.IMOD32 .EQ 14
|
2019-08-01 14:59:15 +00:00
|
|
|
|
FPU.CMP32 .EQ 16
|
|
|
|
|
FPU.ICMP32 .EQ 18
|
2019-07-10 15:39:02 +00:00
|
|
|
|
|
2019-08-01 14:59:15 +00:00
|
|
|
|
FPU.FADD .EQ 20
|
|
|
|
|
FPU.FSUB .EQ 22
|
|
|
|
|
FPU.FMULT .EQ 24
|
|
|
|
|
FPU.FDIV .EQ 26
|
|
|
|
|
FPU.PWR .EQ 28
|
2019-07-10 15:39:02 +00:00
|
|
|
|
|
2019-08-01 14:59:15 +00:00
|
|
|
|
FPU.LOG .EQ 30
|
|
|
|
|
FPU.SQR .EQ 32
|
|
|
|
|
FPU.EXP .EQ 34
|
|
|
|
|
FPU.COS .EQ 36
|
|
|
|
|
FPU.SIN .EQ 38
|
|
|
|
|
FPU.TAN .EQ 40
|
|
|
|
|
FPU.ATAN .EQ 42
|
2019-07-10 15:39:02 +00:00
|
|
|
|
|
2019-08-01 14:59:15 +00:00
|
|
|
|
FPU.SETARG .EQ 44 fadd.....
|
|
|
|
|
FPU.SETFAC .EQ 46 log...., PrintF
|
2019-07-10 15:39:02 +00:00
|
|
|
|
|
2019-08-01 14:59:15 +00:00
|
|
|
|
FPU.GETFAC .EQ 48 Copy FAC to (FORPNT)
|
|
|
|
|
FPU.FCOMP .EQ 50
|
2019-07-10 15:39:02 +00:00
|
|
|
|
|
2019-07-28 20:39:30 +00:00
|
|
|
|
FPU.LTOF .EQ 48 Float
|
|
|
|
|
FPU.QINT .EQ 50 lrintf
|
2019-07-10 15:39:02 +00:00
|
|
|
|
|
2019-08-01 14:59:15 +00:00
|
|
|
|
FPU.FIN .EQ 56 sscanf
|
|
|
|
|
FPU.FOUT .EQ 58 PrintF
|
2019-07-10 15:39:02 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA FPU
|
|
|
|
|
ldx #FPU.]1
|
2019-07-07 20:48:57 +00:00
|
|
|
|
jsr A2osX.FpuCall
|
|
|
|
|
.EM
|
|
|
|
|
*--------------------------------------
|
2017-09-05 15:17:10 +00:00
|
|
|
|
* Global DATA Segment Access
|
2017-09-15 15:16:04 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA LEA.G
|
|
|
|
|
clc
|
2017-09-25 15:50:33 +00:00
|
|
|
|
lda pData
|
|
|
|
|
adc #]1
|
2017-09-15 15:16:04 +00:00
|
|
|
|
tay
|
|
|
|
|
lda pData+1
|
|
|
|
|
adc /]1
|
|
|
|
|
.EM
|
2017-09-25 15:50:33 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA PUSHEA.G
|
2017-09-26 06:27:34 +00:00
|
|
|
|
>LEA.G ]1
|
|
|
|
|
>PUSHYA
|
2017-09-25 15:50:33 +00:00
|
|
|
|
.EM
|
2018-01-15 06:50:44 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA PUSHB.G
|
|
|
|
|
ldy #]1
|
|
|
|
|
lda (pData),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
.EM
|
2017-10-04 06:16:39 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA PUSHW.G
|
2017-10-06 15:25:14 +00:00
|
|
|
|
ldy #]1+1
|
|
|
|
|
lda (pData),y
|
2017-10-04 06:16:39 +00:00
|
|
|
|
>PUSHA
|
2017-10-06 15:25:14 +00:00
|
|
|
|
dey
|
2017-10-19 15:27:38 +00:00
|
|
|
|
lda (pData),y
|
2017-10-04 06:16:39 +00:00
|
|
|
|
>PUSHA
|
|
|
|
|
.EM
|
2018-06-14 15:31:36 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA PUSHL.G
|
|
|
|
|
ldy #]1+4
|
|
|
|
|
:1 dey
|
|
|
|
|
lda (pData),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
cpy #]1
|
|
|
|
|
bne :1
|
|
|
|
|
.EM
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA PULLL.G
|
|
|
|
|
ldy #]1
|
|
|
|
|
:1 >PULLA
|
|
|
|
|
sta (pData),y
|
|
|
|
|
iny
|
|
|
|
|
cpy #]1+4
|
|
|
|
|
bne :1
|
|
|
|
|
.EM
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA PUSHF.G
|
2018-08-23 15:16:20 +00:00
|
|
|
|
ldy #]1+5
|
2018-06-14 15:31:36 +00:00
|
|
|
|
:1 dey
|
|
|
|
|
lda (pData),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
cpy #]1
|
|
|
|
|
bne :1
|
|
|
|
|
.EM
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA PULLF.G
|
|
|
|
|
ldy #]1
|
|
|
|
|
:1 >PULLA
|
|
|
|
|
sta (pData),y
|
|
|
|
|
iny
|
|
|
|
|
cpy #]1+5
|
|
|
|
|
bne :1
|
|
|
|
|
.EM
|
2017-09-05 15:17:10 +00:00
|
|
|
|
*--------------------------------------
|
2017-09-08 14:49:23 +00:00
|
|
|
|
.MA LDA.G
|
2017-09-05 15:17:10 +00:00
|
|
|
|
ldy #]1
|
|
|
|
|
lda (pData),y
|
|
|
|
|
.EM
|
2017-11-05 21:23:21 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA STZ.G
|
|
|
|
|
ldy #]1
|
|
|
|
|
lda #0
|
|
|
|
|
sta (pData),y
|
|
|
|
|
.EM
|
2017-09-05 15:17:10 +00:00
|
|
|
|
*--------------------------------------
|
2017-09-08 14:49:23 +00:00
|
|
|
|
.MA STA.G
|
2017-09-05 15:17:10 +00:00
|
|
|
|
ldy #]1
|
|
|
|
|
sta (pData),y
|
|
|
|
|
.EM
|
2019-04-08 15:39:38 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA AND.G
|
|
|
|
|
ldy #]1
|
|
|
|
|
and (pData),y
|
|
|
|
|
.EM
|
2017-10-04 15:12:03 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA ORA.G
|
|
|
|
|
ldy #]1
|
|
|
|
|
ora (pData),y
|
|
|
|
|
.EM
|
2018-11-13 15:54:10 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA EOR.G
|
|
|
|
|
ldy #]1
|
|
|
|
|
eor (pData),y
|
|
|
|
|
.EM
|
2017-09-05 15:17:10 +00:00
|
|
|
|
*--------------------------------------
|
2017-09-08 14:49:23 +00:00
|
|
|
|
.MA CMP.G
|
|
|
|
|
ldy #]1
|
|
|
|
|
cmp (pData),y
|
|
|
|
|
.EM
|
2017-09-26 06:27:34 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA ADC.G
|
|
|
|
|
ldy #]1
|
|
|
|
|
adc (pData),y
|
|
|
|
|
.EM
|
2017-09-25 15:50:33 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA SBC.G
|
|
|
|
|
ldy #]1
|
|
|
|
|
sbc (pData),y
|
|
|
|
|
.EM
|
|
|
|
|
*--------------------------------------
|
2019-05-27 15:37:31 +00:00
|
|
|
|
.MA STZW.G
|
|
|
|
|
>STZ.G ]1
|
|
|
|
|
iny
|
2017-09-25 15:50:33 +00:00
|
|
|
|
sta (pData),y
|
|
|
|
|
.EM
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA INC.G
|
2017-09-26 06:27:34 +00:00
|
|
|
|
>LDA.G ]1
|
2017-09-25 15:50:33 +00:00
|
|
|
|
inc
|
|
|
|
|
sta (pData),y
|
|
|
|
|
.EM
|
2017-09-08 14:49:23 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA INCW.G
|
2017-09-26 06:27:34 +00:00
|
|
|
|
>INC.G ]1
|
2017-09-08 14:49:23 +00:00
|
|
|
|
bne :1
|
|
|
|
|
iny
|
|
|
|
|
lda (pData),y
|
|
|
|
|
inc
|
|
|
|
|
sta (pData),y
|
2017-09-15 15:16:04 +00:00
|
|
|
|
|
2017-09-08 14:49:23 +00:00
|
|
|
|
:1 .EQ *
|
|
|
|
|
.EM
|
2019-05-27 15:37:31 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA DEC.G
|
|
|
|
|
>LDA.G ]1
|
|
|
|
|
dec
|
|
|
|
|
sta (pData),y
|
|
|
|
|
.EM
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA DECW.G
|
|
|
|
|
>LDA.G ]1
|
|
|
|
|
bne :1
|
|
|
|
|
dec
|
|
|
|
|
sta (pData),y
|
|
|
|
|
iny
|
|
|
|
|
lda (pData),y
|
|
|
|
|
:1 dec
|
|
|
|
|
sta (pData),y
|
|
|
|
|
.EM
|
2017-09-08 14:49:23 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA LDYA.G
|
2017-09-26 06:27:34 +00:00
|
|
|
|
>LDA.G ]1
|
2017-09-05 15:17:10 +00:00
|
|
|
|
pha
|
|
|
|
|
iny
|
|
|
|
|
lda (pData),y
|
|
|
|
|
ply
|
|
|
|
|
.EM
|
|
|
|
|
*--------------------------------------
|
2017-09-08 14:49:23 +00:00
|
|
|
|
.MA STYA.G
|
2017-09-05 15:17:10 +00:00
|
|
|
|
phy
|
|
|
|
|
ldy #]1+1
|
|
|
|
|
sta (pData),y
|
|
|
|
|
dey
|
|
|
|
|
pla
|
|
|
|
|
sta (pData),y
|
|
|
|
|
.EM
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* STACK PUSH/PULL
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.MA PUSHA
|
2017-09-12 15:24:36 +00:00
|
|
|
|
dec pStack
|
2015-06-03 18:30:57 +00:00
|
|
|
|
sta (pStack)
|
2015-03-14 21:48:35 +00:00
|
|
|
|
.EM
|
|
|
|
|
*--------------------------------------
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.MA PULLA
|
|
|
|
|
lda (pStack)
|
2017-09-12 15:24:36 +00:00
|
|
|
|
inc pStack
|
2015-03-14 21:48:35 +00:00
|
|
|
|
.EM
|
|
|
|
|
*--------------------------------------
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.MA PUSHYA
|
2017-10-12 15:28:59 +00:00
|
|
|
|
>PUSHA
|
2015-06-03 18:30:57 +00:00
|
|
|
|
tya
|
2017-10-12 15:28:59 +00:00
|
|
|
|
>PUSHA
|
2015-03-14 21:48:35 +00:00
|
|
|
|
.EM
|
|
|
|
|
*--------------------------------------
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.MA PULLYA
|
2017-10-12 15:28:59 +00:00
|
|
|
|
>PULLA
|
2015-06-03 18:30:57 +00:00
|
|
|
|
tay
|
2017-10-12 15:28:59 +00:00
|
|
|
|
>PULLA
|
2015-03-14 21:48:35 +00:00
|
|
|
|
.EM
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA PUSHBI
|
|
|
|
|
lda #]1
|
2017-10-12 15:28:59 +00:00
|
|
|
|
>PUSHA
|
2015-03-14 21:48:35 +00:00
|
|
|
|
.EM
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA PUSHB
|
|
|
|
|
.DO ]#=2
|
|
|
|
|
lda ]1,]2
|
2017-10-12 15:28:59 +00:00
|
|
|
|
>PUSHA
|
2015-03-14 21:48:35 +00:00
|
|
|
|
.ELSE
|
|
|
|
|
lda ]1
|
2017-10-12 15:28:59 +00:00
|
|
|
|
>PUSHA
|
2015-03-14 21:48:35 +00:00
|
|
|
|
.FIN
|
|
|
|
|
.EM
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA PULLB
|
|
|
|
|
.DO ]#=2
|
2017-10-12 15:28:59 +00:00
|
|
|
|
>PULLA
|
2015-03-14 21:48:35 +00:00
|
|
|
|
sta ]1,]2
|
|
|
|
|
.ELSE
|
2017-10-12 15:28:59 +00:00
|
|
|
|
>PULLA
|
2015-03-14 21:48:35 +00:00
|
|
|
|
sta ]1
|
|
|
|
|
.FIN
|
|
|
|
|
.EM
|
2019-06-07 15:02:51 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA PUSHWZ
|
|
|
|
|
lda #0
|
|
|
|
|
>PUSHA
|
|
|
|
|
>PUSHA
|
|
|
|
|
.EM
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA PUSHWI
|
|
|
|
|
lda /]1
|
2017-10-12 15:28:59 +00:00
|
|
|
|
>PUSHA
|
2015-03-14 21:48:35 +00:00
|
|
|
|
lda #]1
|
2017-10-12 15:28:59 +00:00
|
|
|
|
>PUSHA
|
2015-03-14 21:48:35 +00:00
|
|
|
|
.EM
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA PUSHW
|
2018-10-05 14:58:38 +00:00
|
|
|
|
.DO ]#=2
|
|
|
|
|
lda ]1+1,]2
|
|
|
|
|
>PUSHA
|
|
|
|
|
lda ]1,]2
|
|
|
|
|
>PUSHA
|
|
|
|
|
.ELSE
|
2015-03-14 21:48:35 +00:00
|
|
|
|
lda ]1+1
|
2017-10-12 15:28:59 +00:00
|
|
|
|
>PUSHA
|
2015-03-14 21:48:35 +00:00
|
|
|
|
lda ]1
|
2017-10-12 15:28:59 +00:00
|
|
|
|
>PUSHA
|
2018-10-05 14:58:38 +00:00
|
|
|
|
.FIN
|
2015-03-14 21:48:35 +00:00
|
|
|
|
.EM
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA PULLW
|
2017-10-12 15:28:59 +00:00
|
|
|
|
>PULLA
|
2015-03-14 21:48:35 +00:00
|
|
|
|
sta ]1
|
2017-10-12 15:28:59 +00:00
|
|
|
|
>PULLA
|
2015-03-14 21:48:35 +00:00
|
|
|
|
sta ]1+1
|
2016-10-21 15:03:41 +00:00
|
|
|
|
.EM
|
2018-08-23 15:16:20 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA PUSHL
|
|
|
|
|
ldy #3
|
2018-08-24 10:20:23 +00:00
|
|
|
|
:1 lda ]1,y
|
2018-08-23 15:16:20 +00:00
|
|
|
|
>PUSHA
|
|
|
|
|
dey
|
|
|
|
|
bpl :1
|
|
|
|
|
.EM
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA PULLL
|
|
|
|
|
ldy #0
|
|
|
|
|
:1 >PULLA
|
2018-08-24 10:20:23 +00:00
|
|
|
|
sta ]1,y
|
2018-08-23 15:16:20 +00:00
|
|
|
|
iny
|
|
|
|
|
cpy #4
|
|
|
|
|
bne :1
|
|
|
|
|
.EM
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA PUSHF
|
|
|
|
|
ldy #4
|
2018-08-24 10:20:23 +00:00
|
|
|
|
:1 lda ]1,y
|
2018-08-23 15:16:20 +00:00
|
|
|
|
>PUSHA
|
|
|
|
|
dey
|
|
|
|
|
bpl :1
|
|
|
|
|
.EM
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA PULLF
|
|
|
|
|
ldy #0
|
|
|
|
|
:1 >PULLA
|
2018-08-24 10:20:23 +00:00
|
|
|
|
sta ]1,y
|
2018-08-23 15:16:20 +00:00
|
|
|
|
iny
|
|
|
|
|
cpy #5
|
|
|
|
|
bne :1
|
|
|
|
|
.EM
|
2018-07-11 15:13:29 +00:00
|
|
|
|
*--------------------------------------
|
2019-07-25 06:13:56 +00:00
|
|
|
|
.MA POP
|
2018-07-11 15:13:29 +00:00
|
|
|
|
.DO ]1=1
|
|
|
|
|
inc pStack
|
|
|
|
|
.FIN
|
|
|
|
|
.DO ]1=2
|
|
|
|
|
inc pStack
|
|
|
|
|
inc pStack
|
|
|
|
|
.FIN
|
|
|
|
|
.DO ]1=3
|
|
|
|
|
inc pStack
|
|
|
|
|
inc pStack
|
|
|
|
|
inc pStack
|
|
|
|
|
.FIN
|
|
|
|
|
.DO ]1>3
|
|
|
|
|
pha
|
|
|
|
|
lda #]1
|
|
|
|
|
:1 inc pStack
|
|
|
|
|
dec
|
|
|
|
|
bne :1
|
|
|
|
|
pla
|
|
|
|
|
.FIN
|
2019-07-25 06:13:56 +00:00
|
|
|
|
.EM
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA RET
|
|
|
|
|
>POP ]1
|
2018-08-08 15:13:37 +00:00
|
|
|
|
rts
|
2018-07-11 15:13:29 +00:00
|
|
|
|
.EM
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* General WORD Manipulation Macros
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA LDYAI
|
|
|
|
|
ldy #]1
|
|
|
|
|
lda /]1
|
|
|
|
|
.EM
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA LDYA
|
|
|
|
|
.DO ]#=2
|
|
|
|
|
ldy ]1,]2
|
2017-12-07 16:33:39 +00:00
|
|
|
|
lda ]1+1,]2
|
2015-03-14 21:48:35 +00:00
|
|
|
|
.ELSE
|
|
|
|
|
ldy ]1
|
2017-12-07 16:33:39 +00:00
|
|
|
|
lda ]1+1
|
2015-03-14 21:48:35 +00:00
|
|
|
|
.FIN
|
|
|
|
|
.EM
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.MA STYA
|
|
|
|
|
.DO ]#=2
|
|
|
|
|
sta ]1+1,]2
|
|
|
|
|
tya
|
|
|
|
|
sta ]1,]2
|
|
|
|
|
.ELSE
|
|
|
|
|
sty ]1
|
2018-08-08 15:13:37 +00:00
|
|
|
|
sta ]1+1
|
2015-03-14 21:48:35 +00:00
|
|
|
|
.FIN
|
|
|
|
|
.EM
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* General Strings Macros
|
|
|
|
|
*--------------------------------------
|
2016-10-24 15:54:43 +00:00
|
|
|
|
.MA PSTR
|
2015-11-22 22:30:06 +00:00
|
|
|
|
.DA #:1-*-1
|
|
|
|
|
.AS "]1"
|
|
|
|
|
:1 .EQ *
|
2015-03-14 21:48:35 +00:00
|
|
|
|
.EM
|
2019-07-07 20:48:57 +00:00
|
|
|
|
*--------------------------------------
|
2015-03-14 21:48:35 +00:00
|
|
|
|
MAN
|
2019-07-07 20:48:57 +00:00
|
|
|
|
SAVE INC/MACROS.I
|