A2osX/BIN/CSH.S.EXEC.txt
2020-07-31 16:46:11 +02:00

281 lines
4.4 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

NEW
AUTO 3,1
.LIST OFF
*--------------------------------------
* A = Type, X = OP
*--------------------------------------
CSH.BOP.EXEC jmp (J.CSH.BOPS,x)
*--------------------------------------
CSH.BOPS.ADD asl
tax
jmp (J.CSH.BOPS.ADDt,x)
CSH.BOPS.ADDi8
CSH.BOPS.ADDu8 clc
>PULLA
adc (pStack)
sta (pStack)
clc
rts
CSH.BOPS.ADDi16
CSH.BOPS.ADDu16 clc
ldy #1
>PULLA
adc (pStack),y
sta (pStack),y
>PULLA
adc (pStack),y
sta (pStack),y
clc
rts
CSH.BOPS.ADDi32
CSH.BOPS.ADDu32 >FPU ADD32
clc
rts
CSH.BOPS.ADDf >FPU FADD
clc
rts
*--------------------------------------
CSH.BOPS.SUB asl
tax
jmp (J.CSH.BOPS.SUBt,x)
CSH.BOPS.SUBi8
CSH.BOPS.SUBu8 sec
ldy #1
lda (pStack),y
sbc (pStack)
sta (pStack),y
inc pStack
clc
rts
CSH.BOPS.SUBi16
CSH.BOPS.SUBu16 sec
ldy #2
lda (pStack),y
sbc (pStack)
sta (pStack),y
iny
lda (pStack),y
ldy #1
sbc (pStack),y
inc pStack
inc pStack
sta (pStack),y
clc
rts
CSH.BOPS.SUBi32
CSH.BOPS.SUBu32 >FPU SUB32
clc
rts
CSH.BOPS.SUBf >FPU FSUB
clc
rts
*--------------------------------------
CSH.BOPS.MUL cmp #CSH.T.FLOAT
beq .8
>FPU MUL32
clc
rts
.8 >FPU FMULT
clc
rts
*--------------------------------------
CSH.BOPS.DIV cmp #CSH.T.FLOAT
beq .8
clc
rts
.8 >FPU FDIV
clc
rts
*--------------------------------------
CSH.BOPS.MOD clc
rts
*--------------------------------------
CSH.BOPS.SHL asl
tax
jmp (J.CSH.BOPS.SHLt,x)
CSH.BOPS.SHL8 lda (pStack)
tax
beq .8
ldy #1
lda (pStack),y
.1 asl
dex
bne .1
sta (pStack),y
.8 inc pStack
clc
rts
CSH.BOPS.SHL16 lda (pStack)
tax
beq .8
ldy #2
lda (pStack),y
iny
.1 asl
pha
lda (pStack),y
rol
sta (pStack),y
pla
dex
bne .1
dey
sta (pStack),y
.8 inc pStack
inc pStack
clc
rts
CSH.BOPS.SHL32 lda (pStack)
tax
beq .8
ldy #4
lda (pStack),y
.1 asl
pha
ldy #5
lda (pStack),y
rol
sta (pStack),y
iny
lda (pStack),y
rol
sta (pStack),y
iny
lda (pStack),y
rol
sta (pStack),y
pla
dex
bne .1
ldy #4
sta (pStack),y
.8 inc pStack
inc pStack
inc pStack
inc pStack
clc
rts
*--------------------------------------
CSH.BOPS.SHR
CSH.BOPS.L
CSH.BOPS.G
CSH.BOPS.LE
CSH.BOPS.GE
CSH.BOPS.EQ
CSH.BOPS.NE
CSH.BOPS.AND
CSH.BOPS.OR
CSH.BOPS.EOR
CSH.BOPS.LAND
CSH.BOPS.LOR
clc
rts
*--------------------------------------
EXEC.log >FPU LOG
clc
rts
*--------------------------------------
EXEC.sqr >FPU SQR
clc
rts
*--------------------------------------
EXEC.exp >FPU EXP
clc
rts
*--------------------------------------
EXEC.cos >FPU COS
clc
rts
*--------------------------------------
EXEC.sin >FPU SIN
clc
rts
*--------------------------------------
EXEC.tan >FPU TAN
clc
rts
*--------------------------------------
EXEC.atan >FPU ATAN
clc
rts
*--------------------------------------
EXEC.getchar >SYSCALL GetChar
>PUSHA
rts
*--------------------------------------
EXEC.puts >PULLYA
>SYSCALL PutS
>PUSHYA
rts
*--------------------------------------
EXEC.printf >SYSCALL PrintF
>PUSHYA
rts
*--------------------------------------
EXEC.execl >SYSCALL ExecL
>PUSHYA
rts
*--------------------------------------
EXEC.putenv >SYSCALL PutEnv
>PUSHYA
rts
*--------------------------------------
EXEC.setenv >SYSCALL SetEnv
>PUSHYA
rts
*--------------------------------------
EXEC.getenv >SYSCALL GetEnv
>PUSHYA
rts
*--------------------------------------
EXEC.unsetenv >SYSCALL UnsetEnv
>PUSHYA
rts
*--------------------------------------
EXEC.MD5 >SYSCALL MD5
rts
*--------------------------------------
EXEC.malloc >PULLYA
>SYSCALL GetMem
>PUSHYA
rts
*--------------------------------------
MAN
SAVE usr/src/bin/csh.s.exec
LOAD usr/src/bin/csh.s
ASM