2020-01-25 18:56:36 +00:00
|
|
|
|
NEW
|
|
|
|
|
AUTO 3,1
|
|
|
|
|
.LIST OFF
|
|
|
|
|
*--------------------------------------
|
2021-05-30 20:34:03 +00:00
|
|
|
|
* Y,A = Type/Qual, X = OP
|
2020-01-26 19:36:49 +00:00
|
|
|
|
*--------------------------------------
|
2021-05-04 17:31:21 +00:00
|
|
|
|
CSH.BOP.EXEC cpy #CSH.T.UINT
|
2021-05-09 17:04:44 +00:00
|
|
|
|
bcs .3
|
2020-01-26 19:36:49 +00:00
|
|
|
|
|
2021-05-09 17:04:44 +00:00
|
|
|
|
cpy #CSH.T.UCHAR
|
|
|
|
|
beq .1
|
2021-05-04 17:31:21 +00:00
|
|
|
|
|
2021-05-09 17:04:44 +00:00
|
|
|
|
cpy #CSH.T.SCHAR
|
|
|
|
|
beq .2
|
|
|
|
|
|
|
|
|
|
lda #E.TMISMATCH
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
2021-05-30 20:34:03 +00:00
|
|
|
|
.1 jmp (J.CSH.bBOPS,x)
|
2021-05-09 17:04:44 +00:00
|
|
|
|
|
2021-05-30 20:34:03 +00:00
|
|
|
|
.2 jmp (J.CSH.cBOPS,x)
|
2021-05-09 17:04:44 +00:00
|
|
|
|
|
2021-05-30 20:34:03 +00:00
|
|
|
|
.3 txa
|
|
|
|
|
clc
|
2021-05-09 17:04:44 +00:00
|
|
|
|
adc CSH.Type2FPU-CSH.T.UINT,y
|
2021-05-04 17:31:21 +00:00
|
|
|
|
tax
|
|
|
|
|
jsr A2osX.FPUCALL
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2021-05-09 17:04:44 +00:00
|
|
|
|
CSH.BOPS.bMUL
|
|
|
|
|
CSH.BOPS.cMUL
|
|
|
|
|
clc
|
2021-05-04 17:31:21 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2021-05-09 17:04:44 +00:00
|
|
|
|
CSH.BOPS.bDIV
|
|
|
|
|
CSH.BOPS.cDIV
|
|
|
|
|
clc
|
2021-05-04 17:31:21 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2021-05-09 17:04:44 +00:00
|
|
|
|
CSH.BOPS.bMOD
|
|
|
|
|
CSH.BOPS.cMOD
|
|
|
|
|
clc
|
2021-05-04 17:31:21 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2021-05-09 17:04:44 +00:00
|
|
|
|
CSH.BOPS.ADD clc
|
2020-01-26 19:36:49 +00:00
|
|
|
|
>PULLA
|
|
|
|
|
adc (pStack)
|
|
|
|
|
sta (pStack)
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2021-05-09 17:04:44 +00:00
|
|
|
|
CSH.BOPS.SUB sec
|
2020-01-26 19:36:49 +00:00
|
|
|
|
ldy #1
|
|
|
|
|
lda (pStack),y
|
|
|
|
|
sbc (pStack)
|
|
|
|
|
sta (pStack),y
|
|
|
|
|
inc pStack
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2021-05-09 17:04:44 +00:00
|
|
|
|
CSH.BOPS.SHL lda (pStack)
|
2020-01-26 19:36:49 +00:00
|
|
|
|
tax
|
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
ldy #1
|
|
|
|
|
lda (pStack),y
|
|
|
|
|
|
|
|
|
|
.1 asl
|
|
|
|
|
dex
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
sta (pStack),y
|
|
|
|
|
|
|
|
|
|
.8 inc pStack
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2021-05-09 17:04:44 +00:00
|
|
|
|
CSH.BOPS.SHR lda (pStack)
|
|
|
|
|
tax
|
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
ldy #1
|
|
|
|
|
lda (pStack),y
|
2021-05-04 17:31:21 +00:00
|
|
|
|
|
2021-05-09 17:04:44 +00:00
|
|
|
|
.1 lsr
|
|
|
|
|
dex
|
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
sta (pStack),y
|
|
|
|
|
|
|
|
|
|
.8 inc pStack
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2020-01-26 19:36:49 +00:00
|
|
|
|
CSH.BOPS.L
|
|
|
|
|
CSH.BOPS.G
|
|
|
|
|
CSH.BOPS.LE
|
|
|
|
|
CSH.BOPS.GE
|
|
|
|
|
CSH.BOPS.EQ
|
|
|
|
|
CSH.BOPS.NE
|
2021-05-04 17:31:21 +00:00
|
|
|
|
|
2020-01-26 19:36:49 +00:00
|
|
|
|
CSH.BOPS.AND
|
|
|
|
|
CSH.BOPS.OR
|
|
|
|
|
CSH.BOPS.EOR
|
2021-05-04 17:31:21 +00:00
|
|
|
|
|
2020-01-26 19:36:49 +00:00
|
|
|
|
CSH.BOPS.LAND
|
|
|
|
|
CSH.BOPS.LOR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2021-05-30 20:34:03 +00:00
|
|
|
|
CSH.Exec jmp (J.CSH.EXEC,x)
|
|
|
|
|
**--------------------------------------
|
2021-05-14 20:58:20 +00:00
|
|
|
|
EXEC.pwr >FPU PWR
|
|
|
|
|
clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2020-01-25 18:56:36 +00:00
|
|
|
|
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
|
|
|
|
|
*--------------------------------------
|
2020-02-28 07:21:46 +00:00
|
|
|
|
EXEC.getchar >SYSCALL GetChar
|
2020-01-25 18:56:36 +00:00
|
|
|
|
>PUSHA
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
EXEC.puts >PULLYA
|
2020-02-28 07:21:46 +00:00
|
|
|
|
>SYSCALL PutS
|
2020-01-25 18:56:36 +00:00
|
|
|
|
>PUSHYA
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2021-05-09 17:04:44 +00:00
|
|
|
|
EXEC.printf >SYSCALL PrintF
|
2020-01-25 18:56:36 +00:00
|
|
|
|
>PUSHYA
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2020-02-28 07:21:46 +00:00
|
|
|
|
EXEC.execl >SYSCALL ExecL
|
2020-01-25 18:56:36 +00:00
|
|
|
|
>PUSHYA
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2020-02-28 07:21:46 +00:00
|
|
|
|
EXEC.putenv >SYSCALL PutEnv
|
2020-01-25 18:56:36 +00:00
|
|
|
|
>PUSHYA
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2020-02-28 07:21:46 +00:00
|
|
|
|
EXEC.setenv >SYSCALL SetEnv
|
2020-01-25 18:56:36 +00:00
|
|
|
|
>PUSHYA
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2020-02-28 07:21:46 +00:00
|
|
|
|
EXEC.getenv >SYSCALL GetEnv
|
2020-01-25 18:56:36 +00:00
|
|
|
|
>PUSHYA
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2020-02-28 07:21:46 +00:00
|
|
|
|
EXEC.unsetenv >SYSCALL UnsetEnv
|
2020-01-25 18:56:36 +00:00
|
|
|
|
>PUSHYA
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
EXEC.MD5 >SYSCALL MD5
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
EXEC.malloc >PULLYA
|
2020-02-28 07:21:46 +00:00
|
|
|
|
>SYSCALL GetMem
|
2020-01-25 18:56:36 +00:00
|
|
|
|
>PUSHYA
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2021-05-14 20:58:20 +00:00
|
|
|
|
EXEC.fopen >SYSCALL FOpen
|
|
|
|
|
>PUSHYA
|
|
|
|
|
*--------------------------------------
|
2021-05-30 20:34:03 +00:00
|
|
|
|
EXEC.fclose >PULLA
|
|
|
|
|
>SYSCALL FClose
|
2021-05-14 20:58:20 +00:00
|
|
|
|
>PUSHYA
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
EXEC.fread >SYSCALL FRead
|
|
|
|
|
>PUSHYA
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
EXEC.fwrite >SYSCALL FWrite
|
|
|
|
|
>PUSHYA
|
2021-05-09 17:04:44 +00:00
|
|
|
|
*--------------------------------------
|
2020-01-25 18:56:36 +00:00
|
|
|
|
MAN
|
2020-07-31 14:46:11 +00:00
|
|
|
|
SAVE usr/src/bin/csh.s.exec
|
|
|
|
|
LOAD usr/src/bin/csh.s
|
2020-01-25 18:56:36 +00:00
|
|
|
|
ASM
|