mirror of
https://github.com/A2osX/A2osX.git
synced 2024-11-25 05:32:20 +00:00
855 lines
18 KiB
Plaintext
855 lines
18 KiB
Plaintext
NEW
|
||
AUTO 3,1
|
||
.LIST OFF
|
||
.OP 65C02
|
||
.OR $2000
|
||
.TF bin/csh
|
||
*--------------------------------------
|
||
.INB inc/macros.i
|
||
.INB inc/a2osx.i
|
||
.INB inc/mli.i
|
||
.INB inc/mli.e.i
|
||
*--------------------------------------
|
||
CSH.T.VOID .EQ 1
|
||
CSH.T.UCHAR .EQ 2
|
||
CSH.T.SCHAR .EQ 3
|
||
CSH.T.UINT .EQ 4
|
||
CSH.T.SINT .EQ 5
|
||
CSH.T.ULONG .EQ 6
|
||
CSH.T.SLONG .EQ 7
|
||
CSH.T.FLOAT .EQ 8
|
||
CSH.T.VARIADIC .EQ $FF
|
||
*--------------------------------------
|
||
CSH.Q.POINTER .EQ %01000000
|
||
CSH.Q.PPOINTER .EQ %10000000
|
||
CSH.Q.PPPOINTER .EQ %11000000
|
||
CSH.Q.CONST .EQ %00010000
|
||
CSH.Q.FUNC .EQ %00001000
|
||
*--------------------------------------
|
||
* Zero Page Segment, up to 32 bytes
|
||
*--------------------------------------
|
||
.DUMMY
|
||
.OR ZPBIN
|
||
ZS.START
|
||
ZPCSHCode .BS 2
|
||
ZPCSHConst .BS 2
|
||
ZPCSHData .BS 2
|
||
ZPCSHStack .BS 2
|
||
|
||
ZPCSHfDecl .BS 2
|
||
ZPInputBufPtr .BS 2
|
||
hDefine .BS 1
|
||
hInclude .BS 1
|
||
ZPVarID .BS 2
|
||
|
||
ZPVarDef .EQ *
|
||
ZPVarType .BS 1
|
||
ZPVarQual .BS 1
|
||
ZPVarSizeOf .BS 2
|
||
ZPVarDataPtr .BS 2
|
||
ZPVarDefPtr .BS 2
|
||
|
||
ArgIndex .BS 1
|
||
bFastCall .BS 1
|
||
ZPPtr1 .BS 2
|
||
ZPPtr2 .BS 2
|
||
ZPPtr3 .BS 2
|
||
|
||
ZS.END .ED
|
||
*--------------------------------------
|
||
* File Header (16 Bytes)
|
||
*--------------------------------------
|
||
CS.START cld
|
||
jmp (.1,x)
|
||
.DA #$61 6502,Level 1 (65c02)
|
||
.DA #1 BIN Layout Version 1
|
||
.DA #0 S.PS.F.EVENT
|
||
.DA #0
|
||
.DA CS.END-CS.START Code Size (without Constants)
|
||
.DA DS.END-DS.START Data SegmentSize
|
||
.DA #64 Stack Size
|
||
.DA #ZS.END-ZS.START Zero Page Size
|
||
.DA 0
|
||
*--------------------------------------
|
||
* Relocation Table
|
||
*--------------------------------------
|
||
.1 .DA CS.INIT
|
||
.DA CS.RUN
|
||
.DA CS.DOEVENT
|
||
.DA CS.QUIT
|
||
L.MSG.GREETINGS .DA MSG.GREETINGS
|
||
L.MSG.USAGE .DA MSG.USAGE
|
||
L.MSG.ECHOCRLF .DA MSG.ECHOCRLF
|
||
L.MSG.DEBUG .DA MSG.DEBUG
|
||
L.MSG.ERR .DA MSG.ERR
|
||
L.ENV.INCLUDE .DA ENV.INCLUDE
|
||
L.CSH.BOPS .DA CSH.BOPS
|
||
J.CSH.bBOPS .DA CSH.BOPS.bMUL
|
||
.DA CSH.BOPS.bDIV
|
||
.DA CSH.BOPS.bMOD
|
||
.DA CSH.BOPS.ADD
|
||
.DA CSH.BOPS.SUB
|
||
.DA CSH.BOPS.SHL
|
||
.DA CSH.BOPS.SHR
|
||
.DA CSH.BOPS.L
|
||
.DA CSH.BOPS.LE
|
||
.DA CSH.BOPS.G
|
||
.DA CSH.BOPS.GE
|
||
.DA CSH.BOPS.EQ
|
||
.DA CSH.BOPS.NE
|
||
.DA CSH.BOPS.AND
|
||
.DA CSH.BOPS.OR
|
||
.DA CSH.BOPS.EOR
|
||
.DA CSH.BOPS.LAND
|
||
.DA CSH.BOPS.LOR
|
||
J.CSH.cBOPS .DA CSH.BOPS.cMUL
|
||
.DA CSH.BOPS.cDIV
|
||
.DA CSH.BOPS.cMOD
|
||
.DA CSH.BOPS.ADD
|
||
.DA CSH.BOPS.SUB
|
||
.DA CSH.BOPS.SHL
|
||
.DA CSH.BOPS.SHR
|
||
.DA CSH.BOPS.L
|
||
.DA CSH.BOPS.LE
|
||
.DA CSH.BOPS.G
|
||
.DA CSH.BOPS.GE
|
||
.DA CSH.BOPS.EQ
|
||
.DA CSH.BOPS.NE
|
||
.DA CSH.BOPS.AND
|
||
.DA CSH.BOPS.OR
|
||
.DA CSH.BOPS.EOR
|
||
.DA CSH.BOPS.LAND
|
||
.DA CSH.BOPS.LOR
|
||
L.CSH.FN .DA CSH.FN
|
||
L.CSH.DIRS .DA CSH.DIRS
|
||
L.CSH.KW .DA CSH.KW
|
||
L.CSH.TMODS .DA CSH.TMODS
|
||
L.CSH.TMODS2 .DA CSH.TMODS2
|
||
L.CSH.TYPES .DA CSH.TYPES
|
||
L.CSH.FTYPES .DA CSH.FTYPES
|
||
J.CSH.DIRS .DA CSH.DIR.DEFINE
|
||
.DA CSH.DIR.INCLUDE
|
||
J.CSH.KW .DA CSH.IF
|
||
.DA CSH.WHILE
|
||
.DA CSH.ELSE
|
||
.DA CSH.DO
|
||
.DA CSH.FOR
|
||
.DA CSH.SWITCH
|
||
.DA CSH.CASE
|
||
.DA CSH.BREAK
|
||
.DA CSH.CONTINUE
|
||
.DA CSH.SIZEOF
|
||
*--------------------------------------
|
||
.DA CSH.TYPEDEF
|
||
.DA CSH.STRUCT
|
||
*--------------------------------------
|
||
J.CSH.TMODS .DA CSH.CONST
|
||
J.CSH.TMODS2 .DA CSH.SIGNED
|
||
.DA CSH.UNSIGNED
|
||
.DA CSH.SHORT
|
||
J.CSH.TYPES .DA CSH.VOID
|
||
.DA CSH.CHAR
|
||
.DA CSH.INT
|
||
.DA CSH.LONG
|
||
.DA CSH.FLOAT
|
||
J.CSH.UTYPES .DA CSH.UCHAR
|
||
.DA CSH.UINT
|
||
.DA CSH.ULONG
|
||
J.CSH.STYPES .DA CSH.SCHAR
|
||
.DA CSH.SINT
|
||
.DA CSH.SLONG
|
||
*--------------------------------------
|
||
J.CSH.KW.END .DA CSH.IF.END
|
||
.DA CSH.WHILE.END
|
||
*--------------------------------------
|
||
L.CSH.LIBC .DA CSH.LIBC
|
||
*--------------------------------------
|
||
J.CSH.EXEC .DA EXEC.pwr
|
||
.DA EXEC.log
|
||
.DA EXEC.sqr
|
||
.DA EXEC.exp
|
||
.DA EXEC.cos
|
||
.DA EXEC.sin
|
||
.DA EXEC.tan
|
||
.DA EXEC.atan
|
||
.DA EXEC.getchar
|
||
.DA EXEC.puts
|
||
.DA EXEC.execl
|
||
.DA EXEC.printf
|
||
.DA EXEC.putenv
|
||
.DA EXEC.setenv
|
||
.DA EXEC.getenv
|
||
.DA EXEC.unsetenv
|
||
.DA EXEC.MD5
|
||
.DA EXEC.malloc
|
||
.DA EXEC.fopen
|
||
.DA EXEC.fclose
|
||
.DA EXEC.fread
|
||
.DA EXEC.fwrite
|
||
.DA 0
|
||
*--------------------------------------
|
||
* Called once at process creation
|
||
* Put code for loading LIB here
|
||
*--------------------------------------
|
||
CS.INIT clc
|
||
CS.INIT.RTS rts
|
||
*--------------------------------------
|
||
* Called until exit with CS
|
||
* if RUN exits with CC, RN entered again
|
||
*--------------------------------------
|
||
CS.RUN >PUSHW L.MSG.GREETINGS
|
||
>PUSHW A2osX.KVER
|
||
>PUSHBI 2
|
||
>SYSCALL PrintF
|
||
bcs CS.INIT.RTS
|
||
|
||
jsr CS.RUN.ARGS
|
||
bcs CS.INIT.RTS
|
||
|
||
jsr CSH.Init
|
||
bcs CS.INIT.RTS
|
||
|
||
.1 >SLEEP
|
||
|
||
>LDA.G bDebug
|
||
bpl .2
|
||
|
||
jsr PrintDebugMsg
|
||
.2 >LDA.G bTrace
|
||
bpl .3
|
||
|
||
>LDYA ZPInputBufPtr
|
||
jsr PrintTraceMsg
|
||
|
||
.3 jsr CSH.Run
|
||
bcc .1
|
||
|
||
cmp #MLI.E.EOF
|
||
beq .8
|
||
|
||
pha
|
||
jsr PrintErrMsg
|
||
pla
|
||
sec
|
||
rts
|
||
|
||
.8 lda #0 Exit Code = Success
|
||
sec
|
||
rts
|
||
*--------------------------------------
|
||
CS.RUN.ARGS inc ArgIndex
|
||
|
||
lda ArgIndex
|
||
>SYSCALL ArgV
|
||
bcs .7
|
||
|
||
>STYA ZPPtr1
|
||
lda (ZPPtr1)
|
||
cmp #'-'
|
||
bne .4
|
||
|
||
ldy #1
|
||
lda (ZPPtr1),y
|
||
|
||
ldx #OptionVars-OptionList-1
|
||
|
||
.1 cmp OptionList,x
|
||
beq .2
|
||
|
||
dex
|
||
bpl .1
|
||
|
||
bra .90
|
||
|
||
.2 ldy OptionVars,x
|
||
lda #$ff
|
||
sta (pData),y
|
||
bra CS.RUN.ARGS
|
||
|
||
.4 >LDA.G hFileBuf
|
||
bne .90
|
||
|
||
>LDYA ZPPtr1
|
||
jsr CS.RUN.LoadFile
|
||
bcs .9
|
||
|
||
>STYA ZPInputBufPtr
|
||
|
||
txa
|
||
>STA.G hFileBuf
|
||
bra CS.RUN.ARGS
|
||
|
||
.7 >LDA.G hFileBuf
|
||
beq .90
|
||
|
||
clc
|
||
.9 rts
|
||
|
||
.90 >PUSHW L.MSG.USAGE
|
||
>PUSHBI 0
|
||
>SYSCALL PrintF
|
||
|
||
lda #E.SYN
|
||
sec QUIT Process
|
||
rts
|
||
*--------------------------------------
|
||
CS.RUN.LoadFile >SYSCALL LoadTxtFile
|
||
bcs .9
|
||
|
||
phx
|
||
txa
|
||
>SYSCALL GetMemPtr
|
||
plx
|
||
|
||
.9 rts
|
||
*--------------------------------------
|
||
CS.DOEVENT sec
|
||
rts
|
||
*--------------------------------------
|
||
CS.QUIT jsr CSH.Quit
|
||
clc
|
||
rts
|
||
*--------------------------------------
|
||
PrintErrMsg lda hDefine
|
||
beq .10
|
||
|
||
>LDYA.G CSH.SaveDefine
|
||
>STYA ZPInputBufPtr
|
||
|
||
.10 lda hInclude
|
||
beq .11
|
||
|
||
|
||
bra .12
|
||
|
||
.11 >LDA.G hFileBuf
|
||
|
||
.12 >SYSCALL GetMemPtr
|
||
>STYA ZPPtr1
|
||
|
||
stz ZPPtr2
|
||
stz ZPPtr2+1 Line counter
|
||
|
||
.1 inc ZPPtr2
|
||
bne .2
|
||
|
||
inc ZPPtr2+1
|
||
|
||
.2 >LDYA ZPPtr1
|
||
>STYA ZPPtr3 save line start
|
||
.20 lda (ZPPtr1)
|
||
beq .4 EoF
|
||
|
||
inc ZPPtr1
|
||
bne .3
|
||
|
||
inc ZPPtr1+1
|
||
.3 cmp #C.CR
|
||
bne .20 Scan until EoL
|
||
|
||
ldx ZPPtr1
|
||
cpx ZPInputBufPtr
|
||
lda ZPPtr1+1
|
||
sbc ZPInputBufPtr+1
|
||
bcc .1 not this line....
|
||
|
||
.4 >LDA.G bTrace
|
||
bmi .5
|
||
|
||
jsr PrintTraceMsg.3
|
||
|
||
.5 lda ZPPtr3
|
||
cmp ZPInputBufPtr
|
||
bne .6
|
||
|
||
lda ZPPtr3+1
|
||
cmp ZPInputBufPtr+1
|
||
beq .8
|
||
|
||
.6 ldy #S.PS.hStdErr
|
||
lda (pPS),y
|
||
>PUSHA
|
||
>PUSHBI '-'
|
||
>SYSCALL FPutC
|
||
inc ZPPtr3
|
||
bne .5
|
||
|
||
inc ZPPtr3+1
|
||
bra .5
|
||
|
||
.8 ldy #S.PS.hStdErr
|
||
lda (pPS),y
|
||
>PUSHA
|
||
>PUSHW L.MSG.ERR
|
||
>PUSHW ZPPtr2 Line counter
|
||
>PUSHBI 2
|
||
>SYSCALL FPrintF
|
||
|
||
rts
|
||
*--------------------------------------
|
||
PrintDebugMsg >LDYA pStack
|
||
>STYA ZPPtr2
|
||
>PUSHW L.MSG.DEBUG
|
||
|
||
>PUSHW ZPPtr2
|
||
|
||
>PUSHBI 2
|
||
>SYSCALL PrintF
|
||
>DEBUG
|
||
rts
|
||
*--------------------------------------
|
||
PrintTraceMsg >STYA ZPPtr3
|
||
|
||
PrintTraceMsg.3 ldy #S.PS.hStdErr
|
||
lda (pPS),y
|
||
>PUSHA
|
||
>PUSHBI '>'
|
||
>SYSCALL FPutC
|
||
|
||
ldy #$ff
|
||
|
||
.1 iny
|
||
lda (ZPPtr3),y
|
||
beq .8
|
||
|
||
cmp #C.CR
|
||
beq .8
|
||
|
||
phy
|
||
pha
|
||
ldy #S.PS.hStdErr
|
||
lda (pPS),y
|
||
>PUSHA
|
||
pla
|
||
>PUSHA
|
||
>SYSCALL FPutC
|
||
ply
|
||
bra .1
|
||
|
||
.8 ldy #S.PS.hStdErr
|
||
lda (pPS),y
|
||
>PUSHA
|
||
|
||
>PUSHW L.MSG.ECHOCRLF
|
||
>PUSHBI 0
|
||
>SYSCALL FPrintF
|
||
|
||
rts
|
||
*--------------------------------------
|
||
.INB usr/src/bin/csh.s.core
|
||
.INB usr/src/bin/csh.s.dir
|
||
.INB usr/src/bin/csh.s.kw
|
||
.INB usr/src/bin/csh.s.exp
|
||
.INB usr/src/bin/csh.s.exec
|
||
*--------------------------------------
|
||
CS.END
|
||
*--------------------------------------
|
||
* Initialized DATA
|
||
*--------------------------------------
|
||
MSG.GREETINGS .AZ "\r\nCSH-Shell %d.%d\r\n\r\n"
|
||
MSG.USAGE .AS "Usage : CSH <option> file\r\n"
|
||
.AS " -D : Debug Mode\r\n"
|
||
.AS " -T : Trace On"
|
||
MSG.ECHOCRLF .AZ "\r\n"
|
||
MSG.DEBUG .AZ "pStack=%H\r\n"
|
||
MSG.ERR .AZ "-^\r\nLine #%D:"
|
||
*--------------------------------------
|
||
ENV.INCLUDE .AZ "INCLUDE"
|
||
*--------------------------------------
|
||
OptionList .AS "DdTt"
|
||
OptionVars .DA #bDebug,#bDebug,#bTrace,#bTrace
|
||
*--------------------------------------
|
||
*--------------------------------------
|
||
CSH.OPChars .AS "!~+-*/%=&|^<>"
|
||
CSH.OPChars.Cnt .EQ *-CSH.OPChars
|
||
*--------------------------------------
|
||
* Pre Operators: + - ! ~ ++ --
|
||
*--------------------------------------
|
||
CSH.PREOPS >PSTR "+"
|
||
>PSTR "-"
|
||
>PSTR "!"
|
||
>PSTR "~"
|
||
*--------------------------------------
|
||
* Post Operators: ++ --
|
||
*--------------------------------------
|
||
CSH.POSTOPS >PSTR "++"
|
||
>PSTR "--"
|
||
.HS 00
|
||
*--------------------------------------
|
||
* Assignment Operators: = += -= *= /= %= <<= >>= &= ^= |=
|
||
*--------------------------------------
|
||
CSH.AOPS >PSTR "="
|
||
>PSTR "+="
|
||
>PSTR "-="
|
||
>PSTR "*="
|
||
>PSTR "/="
|
||
>PSTR "%="
|
||
>PSTR "<<="
|
||
>PSTR ">>="
|
||
>PSTR "&="
|
||
>PSTR "^="
|
||
>PSTR "!="
|
||
.HS 00
|
||
*-- Binary ---- H to L precedence -----
|
||
* Arithmetic Operators: * / %
|
||
* Arithmetic Operators: + -
|
||
* Shift Operators: << >>
|
||
* Relational Operators: < > >= < >= == !=
|
||
* Bitwise Operators: & | ^ ~
|
||
* Logical Operators: && ||
|
||
*--------------------------------------
|
||
CSH.BOPS >PSTR "*"
|
||
>PSTR "/"
|
||
>PSTR "%"
|
||
>PSTR "+"
|
||
>PSTR "-"
|
||
>PSTR "<<"
|
||
>PSTR ">>"
|
||
>PSTR "<"
|
||
>PSTR "<="
|
||
>PSTR ">"
|
||
>PSTR ">="
|
||
>PSTR "=="
|
||
>PSTR "!="
|
||
>PSTR "&"
|
||
>PSTR "|"
|
||
>PSTR "^"
|
||
>PSTR "&&"
|
||
>PSTR "||"
|
||
.HS 00
|
||
*--------------------------------------
|
||
* Reserved Directives:
|
||
*--------------------------------------
|
||
CSH.DIRS >PSTR "define"
|
||
>PSTR "include"
|
||
.HS 00
|
||
*--------------------------------------
|
||
* Reserved Keywords:
|
||
*--------------------------------------
|
||
CSH.KW >PSTR "if"
|
||
>PSTR "while"
|
||
>PSTR "else"
|
||
>PSTR "do"
|
||
>PSTR "for"
|
||
>PSTR "switch"
|
||
>PSTR "case"
|
||
>PSTR "break"
|
||
>PSTR "continue"
|
||
>PSTR "sizeof"
|
||
>PSTR "typedef"
|
||
>PSTR "struct"
|
||
.HS 00
|
||
*--------------------------------------
|
||
* Type Declaration
|
||
*--------------------------------------
|
||
CSH.TMODS >PSTR "const" ALL
|
||
CSH.TMODS2 >PSTR "signed" char,int,long
|
||
>PSTR "unsigned" char,int,long
|
||
>PSTR "short" int
|
||
CSH.TYPES >PSTR "void"
|
||
>PSTR "char"
|
||
>PSTR "int"
|
||
>PSTR "long"
|
||
>PSTR "float"
|
||
.HS 00
|
||
*--------------------------------------
|
||
CSH.Type2FPU .DA #FPU.wMUL,#FPU.iMUL,#FPU.uMUL,#FPU.lMUL,FPU.fMUL
|
||
*--------------------------------------
|
||
CSH.FTYPES >PSTR "fastcall"
|
||
* .HS 00
|
||
*--------------------------------------
|
||
CSH.TYPESIZE .HS 0001010202040405
|
||
*--------------------------------------
|
||
CSH.LIBC >PSTR "chtyp"
|
||
>PSTR "chmod"
|
||
>PSTR "fstat"
|
||
>PSTR "stat"
|
||
>PSTR "mkdir"
|
||
>PSTR "mknod"
|
||
>PSTR "mkfifo"
|
||
>PSTR "pipe"
|
||
>PSTR "opendir"
|
||
>PSTR "readdir"
|
||
>PSTR "closedir"
|
||
>PSTR "open"
|
||
>PSTR "close"
|
||
>PSTR "read"
|
||
>PSTR "write"
|
||
>PSTR "chown"
|
||
>PSTR "fputc"
|
||
>PSTR "putchar"
|
||
>PSTR "getc"
|
||
>PSTR "getchar"
|
||
>PSTR "fputs"
|
||
>PSTR "puts"
|
||
>PSTR "fgets"
|
||
>PSTR "ungetc"
|
||
>PSTR "fopen"
|
||
>PSTR "fclose"
|
||
>PSTR "fread"
|
||
>PSTR "fwrite"
|
||
>PSTR "fflush"
|
||
>PSTR "fseek"
|
||
>PSTR "ftell"
|
||
>PSTR "feof"
|
||
>PSTR "remove"
|
||
>PSTR "rename"
|
||
>PSTR "printf"
|
||
>PSTR "fprintf"
|
||
>PSTR "sprintf"
|
||
>PSTR "scanf"
|
||
>PSTR "fscanf"
|
||
>PSTR "sscanf"
|
||
>PSTR "$50"
|
||
>PSTR "$52"
|
||
>PSTR "$54"
|
||
>PSTR "$56"
|
||
>PSTR "$58"
|
||
>PSTR "$5A"
|
||
>PSTR "$5C"
|
||
>PSTR "setattr"
|
||
>PSTR "mount"
|
||
>PSTR "umount"
|
||
>PSTR "online"
|
||
>PSTR "getstkobj"
|
||
>PSTR "shift"
|
||
>PSTR "argv"
|
||
>PSTR "argvDup"
|
||
>PSTR "geterrmsg"
|
||
>PSTR "atof"
|
||
>PSTR "atoi"
|
||
>PSTR "atol"
|
||
>PSTR "strtof"
|
||
>PSTR "strtol"
|
||
>PSTR "strtoul"
|
||
>PSTR "realpath"
|
||
>PSTR "expand"
|
||
>PSTR "strlen"
|
||
>PSTR "strcpy"
|
||
>PSTR "strcat"
|
||
>PSTR "strdup"
|
||
>PSTR "strupr"
|
||
>PSTR "strlwr"
|
||
>PSTR "strcmp"
|
||
>PSTR "strcasecmp"
|
||
>PSTR "getdevbyname"
|
||
>PSTR "getdevstatus"
|
||
>PSTR "mkdev"
|
||
>PSTR "ioctl"
|
||
>PSTR "loadlib"
|
||
>PSTR "unloadlib"
|
||
>PSTR "loaddrv"
|
||
>PSTR "insdrv"
|
||
>PSTR "execl"
|
||
>PSTR "execv"
|
||
>PSTR "fork"
|
||
>PSTR "kill"
|
||
>PSTR "loadfile"
|
||
>PSTR "loadtxtfile"
|
||
>PSTR "filesearch"
|
||
>PSTR "getmemstat"
|
||
>PSTR "strvnew"
|
||
>PSTR "strvset"
|
||
>PSTR "strvget"
|
||
>PSTR "strvfree"
|
||
>PSTR "putenv"
|
||
>PSTR "setenv"
|
||
>PSTR "getenv"
|
||
>PSTR "unsetenv"
|
||
>PSTR "time"
|
||
>PSTR "strftime"
|
||
>PSTR "ctime2time"
|
||
>PSTR "md5"
|
||
>PSTR "md5init"
|
||
>PSTR "md5update"
|
||
>PSTR "md5finalize"
|
||
>PSTR "getpwuid"
|
||
>PSTR "getpwname"
|
||
>PSTR "putpw"
|
||
>PSTR "getgrpgid"
|
||
>PSTR "getgrpname"
|
||
>PSTR "putgr"
|
||
>PSTR "opensession"
|
||
>PSTR "closesession"
|
||
>PSTR "slistgetdata"
|
||
>PSTR "slistadddata"
|
||
>PSTR "slistsetdata"
|
||
>PSTR "slistgetbyid"
|
||
>PSTR "slistnewkey"
|
||
>PSTR "slistlookup"
|
||
>PSTR "slistfree"
|
||
>PSTR "slistnew"
|
||
>PSTR "malloc"
|
||
>PSTR "realloc"
|
||
>PSTR "getmemptr"
|
||
>PSTR "free"
|
||
>PSTR "newstkobj"
|
||
>PSTR "loadstkobj"
|
||
>PSTR "getstkobjptr"
|
||
>PSTR "freestkobj"
|
||
.HS 00
|
||
*--------------------------------------
|
||
CSH.FN
|
||
* float pwr (float x, float y);
|
||
>PSTR "pwr"
|
||
.DA #CSH.T.FLOAT,#0 returned value
|
||
.DA #CSH.T.FLOAT,#0
|
||
.DA #CSH.T.FLOAT,#0
|
||
.DA #0
|
||
* float cos (float x);
|
||
>PSTR "log"
|
||
.DA #CSH.T.FLOAT,#0 returned value
|
||
.DA #CSH.T.FLOAT,#0
|
||
.DA #0
|
||
>PSTR "sqr"
|
||
.DA #CSH.T.FLOAT,#0 returned value
|
||
.DA #CSH.T.FLOAT,#0
|
||
.DA #0
|
||
>PSTR "exp"
|
||
.DA #CSH.T.FLOAT,#0 returned value
|
||
.DA #CSH.T.FLOAT,#0
|
||
.DA #0
|
||
>PSTR "cos"
|
||
.DA #CSH.T.FLOAT,#0 returned value
|
||
.DA #CSH.T.FLOAT,#0
|
||
.DA #0
|
||
>PSTR "sin"
|
||
.DA #CSH.T.FLOAT,#0 returned value
|
||
.DA #CSH.T.FLOAT,#0
|
||
.DA #0
|
||
>PSTR "tan"
|
||
.DA #CSH.T.FLOAT,#0 returned value
|
||
.DA #CSH.T.FLOAT,#0
|
||
.DA #0
|
||
>PSTR "atan"
|
||
.DA #CSH.T.FLOAT,#0 returned value
|
||
.DA #CSH.T.FLOAT,#0
|
||
.DA #0
|
||
* char getchar ( void );
|
||
>PSTR "getchar"
|
||
.DA #CSH.T.UCHAR,#0 returned value
|
||
.DA #0
|
||
* int puts ( const char * str );
|
||
>PSTR "puts"
|
||
.DA #CSH.T.SINT,#0 returned value
|
||
.DA #CSH.T.UCHAR,#CSH.Q.CONST+CSH.Q.POINTER
|
||
.DA #0
|
||
* int execl(const char* cmdline, short int flags);
|
||
>PSTR "execl"
|
||
.DA #CSH.T.SINT,#0 returned value
|
||
.DA #CSH.T.UCHAR,#CSH.Q.CONST+CSH.Q.POINTER
|
||
.DA #CSH.T.UCHAR,#0
|
||
.DA #0
|
||
* int printf ( const char * format, ... );
|
||
>PSTR "printf"
|
||
.DA #CSH.T.SINT,#0 returned value
|
||
.DA #CSH.T.UCHAR,#CSH.Q.CONST+CSH.Q.POINTER
|
||
.DA #CSH.T.VARIADIC,#0
|
||
.DA #0
|
||
* int putenv(const char *string);
|
||
>PSTR "putenv"
|
||
.DA #CSH.T.SINT,#0 returned value
|
||
.DA #CSH.T.UCHAR,#CSH.Q.CONST+CSH.Q.POINTER
|
||
.DA #0
|
||
* int setenv(const char *name, const char *value);
|
||
>PSTR "setenv"
|
||
.DA #CSH.T.SINT,#0 returned value
|
||
.DA #CSH.T.UCHAR,#CSH.Q.CONST+CSH.Q.POINTER
|
||
.DA #CSH.T.UCHAR,#CSH.Q.CONST+CSH.Q.POINTER
|
||
.DA #0
|
||
* char *getenv(const char *name, char *value);
|
||
>PSTR "getenv"
|
||
.DA #CSH.T.UCHAR,#CSH.Q.POINTER
|
||
.DA #CSH.T.UCHAR,#CSH.Q.CONST+CSH.Q.POINTER
|
||
.DA #CSH.T.UCHAR,#CSH.Q.POINTER
|
||
.DA #0
|
||
* int unsetenv(const char *name);
|
||
>PSTR "unsetenv"
|
||
.DA #CSH.T.SINT,#0 returned value
|
||
.DA #CSH.T.UCHAR,#CSH.Q.CONST+CSH.Q.POINTER
|
||
.DA #0
|
||
* void md5 (const char* str, char* digest);
|
||
>PSTR "md5"
|
||
.DA #CSH.T.VOID,#0
|
||
.DA #CSH.T.UCHAR,#CSH.Q.CONST+CSH.Q.POINTER
|
||
.DA #CSH.T.UCHAR,#CSH.Q.POINTER
|
||
.DA #0
|
||
* void * malloc ( int size );
|
||
>PSTR "malloc"
|
||
.DA #CSH.T.VOID,#CSH.Q.POINTER returned value
|
||
.DA #CSH.T.SINT,#0
|
||
.DA #0
|
||
* short int fopen(const char*,short int,short int,int);
|
||
>PSTR "fopen"
|
||
.DA #CSH.T.SCHAR,#0
|
||
.DA #CSH.T.UCHAR,#CSH.Q.CONST+CSH.Q.POINTER
|
||
.DA #CSH.T.SCHAR,#0
|
||
.DA #CSH.T.SCHAR,#0
|
||
.DA #CSH.T.SINT,#0
|
||
.DA #0
|
||
* int fclose(short int);
|
||
>PSTR "fclose"
|
||
.DA #CSH.T.SINT,#0
|
||
.DA #CSH.T.SCHAR,#0
|
||
.DA #0
|
||
* int fread (short int,void*,int);
|
||
>PSTR "fread"
|
||
.DA #CSH.T.SINT,#0
|
||
.DA #CSH.T.SCHAR,#0
|
||
.DA #CSH.T.VOID,#CSH.Q.POINTER
|
||
.DA #CSH.T.SINT,#0
|
||
.DA #0
|
||
* int fwrite (short int,const void*,int);
|
||
>PSTR "fwrite"
|
||
.DA #CSH.T.SINT,#0
|
||
.DA #CSH.T.SCHAR,#0
|
||
.DA #CSH.T.VOID,#CSH.Q.CONST+CSH.Q.POINTER
|
||
.DA #CSH.T.SINT,#0
|
||
.DA #0
|
||
*--------------------------------------
|
||
.DA #0
|
||
*--------------------------------------
|
||
.DUMMY
|
||
.OR 0
|
||
DS.START
|
||
PathBuf .BS 65
|
||
|
||
hFileBuf .BS 1
|
||
|
||
CSH.BufPtrSave .BS 2
|
||
|
||
CSH.CmdSave .BS 1
|
||
CSH.LookupOpt .BS 1
|
||
|
||
CSH.hDefines .BS 1
|
||
CSH.hSymbols .BS 1
|
||
CSH.hTags .BS 1
|
||
|
||
CSH.hCode .BS 1
|
||
CSH.CodePtr .BS 2
|
||
|
||
CSH.hConst .BS 1
|
||
CSH.ConstPtr .BS 2
|
||
|
||
CSH.hData .BS 1
|
||
CSH.DataPtr .BS 2
|
||
|
||
CSH.hStack .BS 1
|
||
CSH.StackPtr .BS 1
|
||
|
||
CSH.hfDecl .BS 1
|
||
CSH.fDeclBuf .BS 2
|
||
|
||
CSH.SaveInclude .BS 2
|
||
CSH.SaveDefine .BS 2
|
||
|
||
CSH.VarDef .BS 8
|
||
|
||
bDebug .BS 1
|
||
bTrace .BS 1
|
||
DS.END .ED
|
||
*--------------------------------------
|
||
MAN
|
||
SAVE usr/src/bin/csh.s
|
||
ASM
|