mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-22 16:31:07 +00:00
208 lines
3.7 KiB
Plaintext
208 lines
3.7 KiB
Plaintext
NEW
|
||
AUTO 3,1
|
||
.LIST OFF
|
||
*--------------------------------------
|
||
* Y,A = Type/Qual, X = 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 jmp (J.CSH.bBOPS,x)
|
||
|
||
.2 jmp (J.CSH.cBOPS,x)
|
||
|
||
.3 txa
|
||
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
|
||
*--------------------------------------
|
||
CSH.Exec jmp (J.CSH.EXEC,x)
|
||
**--------------------------------------
|
||
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 >PULLA
|
||
>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
|