2018-08-08 15:13:37 +00:00
|
|
|
|
NEW
|
2018-11-17 17:17:13 +00:00
|
|
|
|
PREFIX
|
2018-08-08 15:13:37 +00:00
|
|
|
|
AUTO 4,1
|
2017-11-10 15:55:13 +00:00
|
|
|
|
.LIST OFF
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CSH.OPChars .AS "!~+-*/%=&|^&<>"
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Pre Operators: + - ! ~ ++ --
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CSH.PREOOPS >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 prececence -----
|
|
|
|
|
* 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 Keywords:
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CSH.KW >PSTR "if"
|
|
|
|
|
>PSTR "while"
|
|
|
|
|
>PSTR "else"
|
|
|
|
|
>PSTR "do"
|
|
|
|
|
>PSTR "for"
|
|
|
|
|
>PSTR "switch"
|
|
|
|
|
>PSTR "case"
|
|
|
|
|
>PSTR "break"
|
|
|
|
|
>PSTR "continue"
|
|
|
|
|
>PSTR "float"
|
|
|
|
|
>PSTR "signed" char,int,long
|
|
|
|
|
>PSTR "unsigned" char,int,long
|
|
|
|
|
CSH.STYPES >PSTR "char"
|
|
|
|
|
>PSTR "int"
|
|
|
|
|
>PSTR "long"
|
|
|
|
|
.HS 00
|
|
|
|
|
CSH.TSIZE .HS 0001020401020405 00,CHAR,INT,LONG,UCHAR,UINT,ULONG,FLOAT....
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* int printf ( const char * format, ... );
|
|
|
|
|
CSH.FN >PSTR "printf"
|
|
|
|
|
.DA #CSH.T.INT returned value
|
2017-11-14 16:57:34 +00:00
|
|
|
|
.DA #CSH.Q.CONST+CSH.Q.POINTER1
|
|
|
|
|
.DA #CSH.T.CHAR
|
2017-11-10 15:55:13 +00:00
|
|
|
|
.DA #CSH.T.VARIADIC
|
|
|
|
|
.DA #0
|
|
|
|
|
* float cos ( float x );
|
|
|
|
|
>PSTR "cos"
|
|
|
|
|
.DA #CSH.T.FLOAT returned value
|
|
|
|
|
.DA #CSH.T.FLOAT
|
|
|
|
|
.DA #0
|
|
|
|
|
* int getchar ( void );
|
|
|
|
|
>PSTR "getchar"
|
|
|
|
|
.DA #CSH.T.INT returned value
|
|
|
|
|
.DA #0
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
2018-11-22 16:39:41 +00:00
|
|
|
|
SAVE USR/SRC/BIN/SHELL.C.CSH
|
|
|
|
|
LOAD USR/SRC/BIN/SHELL.S
|
2017-11-10 15:55:13 +00:00
|
|
|
|
ASM
|