A2osX/BIN/CSH.S.EXEC.txt
2021-05-14 22:58:20 +02:00

206 lines
3.6 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
*--------------------------------------
* Y = Type, A = OP
*--------------------------------------
CSH.BOP.EXEC cpy #CSH.T.UINT
bcs .3
cpy #CSH.T.UCHAR
beq .1
cpy #CSH.T.SCHAR
beq .2
lda #E.TMISMATCH
sec
rts
.1 tax
jmp (J.CSH.bBOPS,x)
.2 tax
jmp (J.CSH.cBOPS,x)
.3 clc
adc CSH.Type2FPU-CSH.T.UINT,y
tax
jsr A2osX.FPUCALL
clc
rts
*--------------------------------------
CSH.BOPS.bMUL
CSH.BOPS.cMUL
clc
rts
*--------------------------------------
CSH.BOPS.bDIV
CSH.BOPS.cDIV
clc
rts
*--------------------------------------
CSH.BOPS.bMOD
CSH.BOPS.cMOD
clc
rts
*--------------------------------------
CSH.BOPS.ADD clc
>PULLA
adc (pStack)
sta (pStack)
clc
rts
*--------------------------------------
CSH.BOPS.SUB sec
ldy #1
lda (pStack),y
sbc (pStack)
sta (pStack),y
inc pStack
clc
rts
*--------------------------------------
CSH.BOPS.SHL 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.SHR lda (pStack)
tax
beq .8
ldy #1
lda (pStack),y
.1 lsr
dex
bne .1
sta (pStack),y
.8 inc pStack
clc
rts
*--------------------------------------
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.pwr >FPU PWR
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
*--------------------------------------
EXEC.fopen >SYSCALL FOpen
>PUSHYA
*--------------------------------------
EXEC.fclose >SYSCALL FClose
>PUSHYA
*--------------------------------------
EXEC.fread >SYSCALL FRead
>PUSHYA
*--------------------------------------
EXEC.fwrite >SYSCALL FWrite
>PUSHYA
*--------------------------------------
MAN
SAVE usr/src/bin/csh.s.exec
LOAD usr/src/bin/csh.s
ASM