mirror of
https://github.com/A2osX/A2osX.git
synced 2025-02-21 06:29:08 +00:00
202 lines
3.3 KiB
Plaintext
202 lines
3.3 KiB
Plaintext
NEW
|
||
AUTO 3,1
|
||
.LIST OFF
|
||
*--------------------------------------
|
||
RT.NOT lda (pStack)
|
||
inc
|
||
ora (pStack)
|
||
beq .1
|
||
|
||
lda #1
|
||
|
||
.1 dec
|
||
sta (pStack)
|
||
>PUSHA
|
||
rts
|
||
*--------------------------------------
|
||
RT.StrSet >PUSHB hStrings
|
||
txa
|
||
>PUSHA
|
||
tya
|
||
>PUSHA
|
||
|
||
ldy #4
|
||
lda (pStack),y
|
||
>PUSHA
|
||
lda (pStack),y
|
||
>PUSHA
|
||
>SYSCALL StrVSet
|
||
inc pStack
|
||
inc pStack
|
||
rts
|
||
*--------------------------------------
|
||
RT.StrGet lda #0
|
||
sta (ZPStrBuf)
|
||
|
||
>PUSHB hStrings
|
||
txa
|
||
>PUSHA
|
||
tya
|
||
>PUSHA
|
||
>PUSHW ZPStrBuf
|
||
>SYSCALL StrVGet
|
||
>PUSHW ZPStrBuf
|
||
rts
|
||
*--------------------------------------
|
||
RT.StrOut ldy #S.PS.hStdOut
|
||
lda (pPS),y
|
||
>PUSHA
|
||
ldy #2
|
||
lda (pStack),y
|
||
>PUSHA
|
||
lda (pStack),y
|
||
>PUSHA
|
||
>SYSCALL fputs
|
||
inc pStack
|
||
inc pStack
|
||
rts
|
||
*--------------------------------------
|
||
RT.IntSet sty ZPADDR
|
||
stx ZPADDR+1
|
||
|
||
>PULLA
|
||
sta (ZPADDR)
|
||
>PULLA
|
||
ldy #1
|
||
sta (ZPADDR),y
|
||
rts
|
||
*--------------------------------------
|
||
RT.IntGet sty ZPADDR
|
||
stx ZPADDR+1
|
||
|
||
ldy #1
|
||
lda (ZPADDR),y
|
||
>PUSHA
|
||
lda (ZPADDR)
|
||
>PUSHA
|
||
rts
|
||
*--------------------------------------
|
||
RT.IntOut >PUSHW L.MSG.INT16
|
||
ldy #3
|
||
lda (pStack),y
|
||
>PUSHA
|
||
lda (pStack),y
|
||
>PUSHA
|
||
>PUSHBI 2
|
||
>SYSCALL PrintF
|
||
inc pStack
|
||
inc pStack
|
||
rts
|
||
*--------------------------------------
|
||
RT.DATEd ldx #0
|
||
bra RT.TIMEd.1
|
||
|
||
RT.TIMEd ldx #2
|
||
|
||
RT.TIMEd.1 >PUSHW ZPStrBuf
|
||
>PUSHW L.FMT.DATE,x
|
||
>PUSHEA.G TimeBuf
|
||
|
||
>PUSHEA.G TimeBuf
|
||
>SYSCALL Time
|
||
|
||
>SYSCALL StrFTime
|
||
>PUSHW ZPStrBuf
|
||
rts
|
||
*--------------------------------------
|
||
RT.GET >SYSCALL GetChar
|
||
sta (ZPStrBuf)
|
||
|
||
ldy #1
|
||
bra RT.INPUT.8
|
||
*--------------------------------------
|
||
RT.INPUT lda #0
|
||
sta (ZPStrBuf)
|
||
|
||
stz ZPPtr1
|
||
|
||
.1 >SYSCALL GetChar
|
||
bcs RT.INPUT.9
|
||
|
||
ldy ZPPtr1
|
||
|
||
cmp #C.SPACE
|
||
bcs .7
|
||
|
||
cmp #C.CR
|
||
beq RT.INPUT.8
|
||
|
||
cmp #C.BS
|
||
bne .1
|
||
|
||
cpy #0
|
||
beq .1
|
||
|
||
>SYSCALL PutChar
|
||
lda #C.SPACE
|
||
>SYSCALL PutChar
|
||
lda #C.BS
|
||
>SYSCALL PutChar
|
||
dec ZPPtr1
|
||
bra .1
|
||
|
||
.7 sta (ZPStrBuf),y
|
||
>SYSCALL PutChar
|
||
inc ZPPtr1
|
||
bne .1
|
||
|
||
RT.INPUT.8 lda #0
|
||
sta (ZPStrBuf),y
|
||
|
||
>PUSHW ZPStrBuf
|
||
clc
|
||
|
||
RT.INPUT.9 rts
|
||
*--------------------------------------
|
||
RT.LEFTd >PULLW ZPPtr2 cnt
|
||
lda (pStack)
|
||
sta ZPPtr1
|
||
ldy #1
|
||
lda (pStack),y
|
||
sta ZPPtr1+1
|
||
|
||
ldy #0
|
||
|
||
.1 lda (ZPPtr1),y
|
||
beq .8
|
||
|
||
iny
|
||
cpy ZPPtr2
|
||
bne .1
|
||
|
||
lda #0
|
||
sta (ZPPtr1),y
|
||
|
||
.8 rts
|
||
*--------------------------------------
|
||
RT.LEN >PULLYA str
|
||
>SYSCALL strlen
|
||
>PUSHYA
|
||
rts
|
||
*--------------------------------------
|
||
RT.STRd >PULLYA int
|
||
pha
|
||
>PUSHW ZPStrBuf
|
||
>PUSHW L.MSG.INT16
|
||
pla
|
||
>PUSHYA
|
||
>PUSHBI 2
|
||
>SYSCALL sprintf
|
||
>PUSHW ZPStrBuf
|
||
rts
|
||
*--------------------------------------
|
||
RT.VAL >PULLYA str
|
||
>SYSCALL atoi
|
||
>PUSHYA
|
||
rts
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE usr/src/bin/acos.s.rt
|
||
LOAD usr/src/bin/acos.s
|
||
ASM
|