A2osX/BIN/CC.S.CODE.txt

302 lines
5.4 KiB
Plaintext
Raw Normal View History

NEW
AUTO 3,1
.LIST OFF
*--------------------------------------
2022-01-30 21:47:08 +00:00
CODE.Debug ldx #PCC.DEBUG.L
ldy #0
2022-01-30 21:47:08 +00:00
.1 lda PCC.DEBUG,y
jsr CODE.EmitByte
iny
dex
bne .1
rts
*--------------------------------------
CODE.Enter ldx #PCC.ENTER.L
ldy #0
2022-01-30 21:47:08 +00:00
.1 lda PCC.ENTER,y
jsr CODE.EmitByte
iny
dex
bne .1
rts
*--------------------------------------
CODE.nAddLocal eor #$FF
inc
2022-01-30 21:47:08 +00:00
CODE.AddLocal pha
lda #$A9 LDA #imm
jsr CODE.EmitByte
pla
jsr CODE.EmitByte
ldx #PCC.ADDLOCAL.L
ldy #0
.1 lda PCC.ADDLOCAL,y
jsr CODE.EmitByte
iny
dex
bne .1
rts
*--------------------------------------
CODE.GetLocal lda #$A9 LDA #imm
jsr CODE.EmitByte
tya
eor #$FF
inc
jsr CODE.EmitByte
ldx #PCC.GETLOCAL.L
ldy #0
.1 lda PCC.GETLOCAL,y
jsr CODE.EmitByte
iny
dex
bne .1
rts
*--------------------------------------
CODE.SetRetValue
jsr CODE.LDXI
ldx #PCC.SETRETVALUE.L
ldy #0
.1 lda PCC.SETRETVALUE,y
jsr CODE.EmitByte
iny
dex
bne .1
rts
*--------------------------------------
CODE.Leave ldx #PCC.LEAVE.L
ldy #0
.1 lda PCC.LEAVE,y
jsr CODE.EmitByte
iny
dex
bne .1
rts
*--------------------------------------
CODE.PushXFromYA
ldx #PCC.PushXFromYA.L
ldy #0
.1 lda PCC.PushXFromYA,y
jsr CODE.EmitByte
iny
dex
bne .1
rts
*--------------------------------------
2022-01-30 21:47:08 +00:00
CODE.PopXToYA ldx #PCC.PopXToYA.L
ldy #0
2022-01-30 21:47:08 +00:00
.1 lda PCC.PopXToYA,y
jsr CODE.EmitByte
iny
dex
bne .1
rts
*--------------------------------------
2022-01-30 21:47:08 +00:00
CODE.SetXToYA ldx #PCC.SetXToYA.L
ldy #0
.1 lda PCC.SetXToYA,y
jsr CODE.EmitByte
iny
dex
bne .1
rts
*--------------------------------------
CODE.Deref ldx #PCC.Deref.L
ldy #0
.1 lda PCC.Deref,y
jsr CODE.EmitByte
iny
dex
bne .1
rts
*--------------------------------------
CODE.SETpBASEp1 ldx #PCC.SETpBASEp1.L
ldy #0
.1 lda PCC.SETpBASEp1,y
jsr CODE.EmitByte
iny
dex
bne .1
rts
*--------------------------------------
CODE.SETpBASEpA ldx #PCC.SETpBASEpA.L
ldy #0
.1 lda PCC.SETpBASEpA,y
jsr CODE.EmitByte
iny
dex
bne .1
rts
*--------------------------------------
CODE.PUSHpBASEp1
ldx #PCC.PUSHpBASEp1.L
ldy #0
.1 lda PCC.PUSHpBASEp1,y
jsr CODE.EmitByte
iny
dex
bne .1
rts
*--------------------------------------
CODE.PUSHpBASEpA
ldx #PCC.PUSHpBASEpA.L
ldy #0
.1 lda PCC.PUSHpBASEpA,y
jsr CODE.EmitByte
iny
dex
bne .1
rts
*--------------------------------------
CODE.PushFromPtr
pha
lda #$A0 LDY #imm
jsr CODE.EmitByte
pla
dec BPL loop
jsr CODE.EmitByte
ldx #PCC.PushFromPtr.L
ldy #0
.1 lda PCC.PushFromPtr,y
jsr CODE.EmitByte
iny
dex
bne .1
rts
*--------------------------------------
CODE.PUSHI pha
lda #$A9 LDA #imm
jsr CODE.EmitByte
pla
jsr CODE.EmitByte
bra CODE.PUSHA
*--------------------------------------
2022-01-30 21:47:08 +00:00
CODE.LDYAI pha
lda #$A0 LDY #imm
jsr CODE.EmitByte
tya
jsr CODE.EmitByte
lda #$A9 LDA #imm
jsr CODE.EmitByte
2022-01-30 21:47:08 +00:00
pla
2022-01-30 21:47:08 +00:00
jmp CODE.EmitByte
*--------------------------------------
CODE.LDXI lda #$A2 LDX #imm
jsr CODE.EmitByte
txa
jmp CODE.EmitByte
*--------------------------------------
CODE.LDAI pha
lda #$A9 LDA #imm
jsr CODE.EmitByte
pla
jmp CODE.EmitByte
*--------------------------------------
CODE.PUSHYA jsr CODE.PUSHA
lda #$AA TYA
jsr CODE.EmitByte
*--------------------------------------
CODE.PUSHA lda #$C6 DEC zp
jsr CODE.EmitByte
lda #pStack
jsr CODE.EmitByte
2022-01-30 21:47:08 +00:00
lda #$92 STA (zp)
jsr CODE.EmitByte
lda #pStack
jmp CODE.EmitByte
*--------------------------------------
CODE.PULLYA jsr CODE.PULLA
lda #$48 PHA
jsr CODE.EmitByte
jsr CODE.PULLA
lda #$7A PLY
bra CODE.EmitByte
*--------------------------------------
CODE.PULLA lda #$B2 LDA (zp)
jsr CODE.EmitByte
lda #pStack
jsr CODE.EmitByte
*--------------------------------------
CODE.INCPSTACK lda #$E6 INC zp
jsr CODE.EmitByte
lda #pStack
bra CODE.EmitByte
*--------------------------------------
2022-01-30 21:47:08 +00:00
CODE.TOABSYX jsr CODE.EmitByte A=opcode : JMP, JSR .....
txa
2022-01-30 21:47:08 +00:00
jsr CODE.EmitByte
tya
bra CODE.EmitByte
*--------------------------------------
CODE.FPUCALL lda #$A2 LDX #imm
jsr CODE.EmitByte
txa
jsr CODE.EmitByte
lda #$20 JSR
jsr CODE.EmitByte
lda #A2osX.FPUCALL
jsr CODE.EmitByte
lda /A2osX.FPUCALL
bra CODE.EmitByte
*--------------------------------------
CODE.SYSCALL lda #$A2 LDX #imm
jsr CODE.EmitByte
txa
jsr CODE.EmitByte
lda #$20 JSR
jsr CODE.EmitByte
lda #A2osX.SYSCALL
jsr CODE.EmitByte
lda /A2osX.SYSCALL
*--------------------------------------
CODE.EmitByte sta (ZPCCCode)
inc ZPCCCode
bne .8
inc ZPCCCode+1
.8 rts
*--------------------------------------
MAN
SAVE usr/src/bin/cc.s.code
LOAD usr/src/bin/cc.s
ASM