2015-11-22 22:30:06 +00:00
|
|
|
|
PR#3
|
|
|
|
|
PREFIX /A2OSX.SRC
|
|
|
|
|
NEW
|
|
|
|
|
INC 1
|
|
|
|
|
AUTO 6
|
|
|
|
|
.LIST OFF
|
|
|
|
|
*--------------------------------------
|
2016-09-21 15:20:37 +00:00
|
|
|
|
K.DecOutA tay
|
2015-11-22 22:30:06 +00:00
|
|
|
|
lda #0
|
2016-09-21 15:20:37 +00:00
|
|
|
|
K.DecOutYA >STYA HEX
|
2015-11-22 22:30:06 +00:00
|
|
|
|
stz BCD
|
|
|
|
|
stz BCD+1
|
|
|
|
|
stz BCD+2
|
|
|
|
|
|
|
|
|
|
ldx #16 let's roll 16 bits
|
|
|
|
|
sed
|
|
|
|
|
.2 asl HEX
|
|
|
|
|
rol HEX+1
|
|
|
|
|
php cpy will disturb carry while BCD adc
|
|
|
|
|
ldy #0
|
|
|
|
|
.3 plp
|
|
|
|
|
lda BCD,y
|
|
|
|
|
adc BCD,y
|
|
|
|
|
sta BCD,y
|
|
|
|
|
php
|
|
|
|
|
iny
|
|
|
|
|
cpy #3 Last byte of BCDBUF?
|
|
|
|
|
bne .3
|
|
|
|
|
plp
|
|
|
|
|
dex
|
|
|
|
|
bne .2
|
|
|
|
|
|
|
|
|
|
cld
|
|
|
|
|
|
|
|
|
|
stz bL0Flag
|
|
|
|
|
ldx #2
|
|
|
|
|
|
|
|
|
|
.4 lda BCD,x
|
|
|
|
|
lsr
|
|
|
|
|
lsr
|
|
|
|
|
lsr
|
|
|
|
|
lsr
|
|
|
|
|
bne .5
|
|
|
|
|
bit bL0Flag
|
|
|
|
|
bpl .6
|
|
|
|
|
.5 sec
|
|
|
|
|
ror bL0Flag
|
|
|
|
|
ora #$30
|
2016-09-21 15:20:37 +00:00
|
|
|
|
jsr K.COutA
|
2015-11-22 22:30:06 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
.6 lda BCD,x
|
|
|
|
|
and #$0F
|
|
|
|
|
bne .7
|
|
|
|
|
bit bL0Flag
|
|
|
|
|
bpl .8
|
|
|
|
|
.7 sec
|
|
|
|
|
ror bL0Flag
|
|
|
|
|
ora #$30
|
2016-09-21 15:20:37 +00:00
|
|
|
|
jsr K.COutA
|
2015-11-22 22:30:06 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
|
|
|
|
|
.8 dex
|
|
|
|
|
bpl .4
|
|
|
|
|
|
|
|
|
|
bit bL0Flag
|
|
|
|
|
bmi .9
|
|
|
|
|
lda #$30
|
2016-09-21 15:20:37 +00:00
|
|
|
|
jsr K.COutA
|
2015-11-22 22:30:06 +00:00
|
|
|
|
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2016-09-21 15:20:37 +00:00
|
|
|
|
K.HexOutYA phy
|
|
|
|
|
jsr K.HexOutA
|
|
|
|
|
bcs K.COutA.RTS
|
2015-11-22 22:30:06 +00:00
|
|
|
|
pla
|
|
|
|
|
*--------------------------------------
|
2016-09-21 15:20:37 +00:00
|
|
|
|
K.HexOutA pha
|
2015-11-22 22:30:06 +00:00
|
|
|
|
lsr
|
|
|
|
|
lsr
|
|
|
|
|
lsr
|
|
|
|
|
lsr
|
|
|
|
|
ora #$30
|
|
|
|
|
cmp #$3A
|
|
|
|
|
bcc .1
|
|
|
|
|
adc #6
|
2016-09-21 15:20:37 +00:00
|
|
|
|
.1 jsr K.COutA
|
|
|
|
|
bcs K.COutA.RTS
|
2015-11-22 22:30:06 +00:00
|
|
|
|
pla
|
|
|
|
|
and #$0F
|
|
|
|
|
ora #$30
|
|
|
|
|
cmp #$3A
|
2016-09-21 15:20:37 +00:00
|
|
|
|
bcc K.COutA
|
2015-11-22 22:30:06 +00:00
|
|
|
|
adc #6
|
|
|
|
|
*--------------------------------------
|
2016-09-21 15:20:37 +00:00
|
|
|
|
K.COutA phx
|
2015-11-22 22:30:06 +00:00
|
|
|
|
phy
|
2015-12-10 18:53:30 +00:00
|
|
|
|
cmp #13
|
|
|
|
|
bne .1
|
2015-11-22 22:30:06 +00:00
|
|
|
|
ldx #DEVMGR.COUT
|
2015-12-10 18:53:30 +00:00
|
|
|
|
jsr pDevJmp
|
2015-12-10 20:15:55 +00:00
|
|
|
|
bcs .2
|
2015-12-10 18:53:30 +00:00
|
|
|
|
lda #10
|
|
|
|
|
.1 ldx #DEVMGR.COUT
|
2015-11-22 22:30:06 +00:00
|
|
|
|
jsr pDevJmp
|
2015-12-10 20:15:55 +00:00
|
|
|
|
.2 ply
|
2015-11-22 22:30:06 +00:00
|
|
|
|
plx
|
2016-09-21 15:20:37 +00:00
|
|
|
|
K.COutA.RTS rts
|
2015-11-22 22:30:06 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Mini printf for PSTR
|
|
|
|
|
* %d : byte
|
|
|
|
|
* %D : word
|
|
|
|
|
* %h : hex byte
|
|
|
|
|
* %H : hex word
|
2016-05-01 21:13:54 +00:00
|
|
|
|
* %s : hSTR
|
|
|
|
|
* %S : PSTR
|
2015-11-29 22:19:10 +00:00
|
|
|
|
* \e : ESC
|
2015-11-22 22:30:06 +00:00
|
|
|
|
* \n : CR
|
|
|
|
|
*--------------------------------------
|
2016-09-21 15:20:37 +00:00
|
|
|
|
K.PStrOutYA >STYA ZPQuickPtr1
|
2015-11-22 22:30:06 +00:00
|
|
|
|
|
|
|
|
|
ldy #0
|
|
|
|
|
|
2016-09-21 15:20:37 +00:00
|
|
|
|
.1 jsr K.PStrOut.Next
|
2015-11-29 22:19:10 +00:00
|
|
|
|
bne .12
|
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.12 cmp #'\'
|
2015-11-22 22:30:06 +00:00
|
|
|
|
bne .2
|
2016-09-21 15:20:37 +00:00
|
|
|
|
jsr K.PStrOut.Next
|
2015-11-22 22:30:06 +00:00
|
|
|
|
beq .8
|
|
|
|
|
|
2015-11-29 22:19:10 +00:00
|
|
|
|
cmp #'e'
|
|
|
|
|
bne .11
|
|
|
|
|
lda #27
|
|
|
|
|
bra .6
|
|
|
|
|
|
|
|
|
|
.11 cmp #'n'
|
2015-11-22 22:30:06 +00:00
|
|
|
|
bne .6
|
|
|
|
|
lda #13
|
|
|
|
|
bra .6
|
|
|
|
|
|
|
|
|
|
.2 cmp #'%'
|
|
|
|
|
bne .6
|
|
|
|
|
|
2016-09-21 15:20:37 +00:00
|
|
|
|
jsr K.PStrOut.Next
|
2015-11-22 22:30:06 +00:00
|
|
|
|
beq .8
|
|
|
|
|
cmp #'d'
|
|
|
|
|
bne .3
|
|
|
|
|
phy
|
|
|
|
|
>PULLA
|
2016-09-21 15:20:37 +00:00
|
|
|
|
jsr K.DecOutA
|
2015-11-22 22:30:06 +00:00
|
|
|
|
ply
|
2015-11-29 22:19:10 +00:00
|
|
|
|
bcc .1
|
2015-11-22 22:30:06 +00:00
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.3 cmp #'D'
|
|
|
|
|
bne .4
|
|
|
|
|
phy
|
|
|
|
|
>PULLYA
|
2016-09-21 15:20:37 +00:00
|
|
|
|
jsr K.DecOutYA
|
2015-11-22 22:30:06 +00:00
|
|
|
|
ply
|
2015-11-29 22:19:10 +00:00
|
|
|
|
bcc .1
|
2015-11-22 22:30:06 +00:00
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.4 cmp #'h'
|
|
|
|
|
bne .5
|
|
|
|
|
phy
|
|
|
|
|
>PULLA
|
2016-09-21 15:20:37 +00:00
|
|
|
|
jsr K.HexOutA
|
2015-11-22 22:30:06 +00:00
|
|
|
|
ply
|
2015-11-29 22:19:10 +00:00
|
|
|
|
bcc .1
|
2015-11-22 22:30:06 +00:00
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.5 cmp #'H'
|
|
|
|
|
bne .51
|
|
|
|
|
phy
|
|
|
|
|
>PULLYA
|
2016-09-21 15:20:37 +00:00
|
|
|
|
jsr K.HexOutYA
|
2015-11-22 22:30:06 +00:00
|
|
|
|
ply
|
2015-11-29 22:19:10 +00:00
|
|
|
|
bcc .1
|
2015-11-22 22:30:06 +00:00
|
|
|
|
rts
|
|
|
|
|
|
2015-11-29 22:19:10 +00:00
|
|
|
|
.51 cmp #'s'
|
|
|
|
|
bne .52
|
2016-09-21 15:20:37 +00:00
|
|
|
|
jsr K.PStrOutYAS1
|
2015-11-29 22:19:10 +00:00
|
|
|
|
bcc .1
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.52 cmp #'S'
|
|
|
|
|
bne .53
|
2016-09-21 15:20:37 +00:00
|
|
|
|
jsr K.PStrOutYAS2
|
2015-11-29 22:19:10 +00:00
|
|
|
|
bcc .10
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.53 tax
|
2015-11-22 22:30:06 +00:00
|
|
|
|
lda #'%'
|
2016-09-21 15:20:37 +00:00
|
|
|
|
jsr K.COutA
|
2015-11-22 22:30:06 +00:00
|
|
|
|
bcs .9
|
|
|
|
|
txa
|
|
|
|
|
|
2016-09-21 15:20:37 +00:00
|
|
|
|
.6 jsr K.COutA
|
2015-11-22 22:30:06 +00:00
|
|
|
|
bcs .9
|
2015-11-29 22:19:10 +00:00
|
|
|
|
.10 jmp .1
|
|
|
|
|
.9 rts
|
|
|
|
|
*--------------------------------------
|
2016-09-21 15:20:37 +00:00
|
|
|
|
K.PStrOut.Next tya
|
2015-11-29 22:19:10 +00:00
|
|
|
|
eor (ZPQuickPtr1)
|
|
|
|
|
beq .8
|
|
|
|
|
iny
|
|
|
|
|
lda (ZPQuickPtr1),y
|
|
|
|
|
.8 rts
|
|
|
|
|
*--------------------------------------
|
2016-09-21 15:20:37 +00:00
|
|
|
|
K.PStrOutYAS1 phy
|
2015-11-29 22:19:10 +00:00
|
|
|
|
>PULLA
|
2016-09-21 15:20:37 +00:00
|
|
|
|
jsr K.GetMemPtrA
|
|
|
|
|
bra K.PStrOutYAS
|
2015-11-22 22:30:06 +00:00
|
|
|
|
|
2016-09-21 15:20:37 +00:00
|
|
|
|
K.PStrOutYAS2 phy
|
2015-11-29 22:19:10 +00:00
|
|
|
|
>PULLYA
|
2016-09-21 15:20:37 +00:00
|
|
|
|
K.PStrOutYAS >STYA ZPQuickPtr2
|
2015-11-29 22:19:10 +00:00
|
|
|
|
|
2016-01-04 07:18:33 +00:00
|
|
|
|
clc
|
|
|
|
|
lda (ZPQuickPtr2)
|
|
|
|
|
tax
|
|
|
|
|
beq .9
|
|
|
|
|
|
|
|
|
|
ldy #1
|
|
|
|
|
.1 lda (ZPQuickPtr2),y
|
2016-09-21 15:20:37 +00:00
|
|
|
|
jsr K.COutA
|
2015-11-29 22:19:10 +00:00
|
|
|
|
bcs .9
|
2016-01-04 07:18:33 +00:00
|
|
|
|
iny
|
|
|
|
|
dex
|
2015-11-29 22:19:10 +00:00
|
|
|
|
bne .1
|
2016-01-04 07:18:33 +00:00
|
|
|
|
|
2015-11-29 22:19:10 +00:00
|
|
|
|
.9 ply
|
|
|
|
|
rts
|
2015-11-22 22:30:06 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
HEX .BS 2
|
|
|
|
|
BCD .BS 3
|
|
|
|
|
bL0Flag .BS 1
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
|
|
|
|
SAVE SYS/KERNEL.S.CIO
|
|
|
|
|
LOAD SYS/KERNEL.S
|
|
|
|
|
ASM
|