A2osX/BIN/CSH.I.txt

113 lines
2.6 KiB
Plaintext
Raw Normal View History

2019-01-26 16:33:03 +00:00
NEW
PREFIX
AUTO 4,1
.LIST OFF
*--------------------------------------
CSH.OPChars .AS "!~+-*/%=&|^&<>"
2019-02-07 16:52:25 +00:00
CSH.OPChars.Cnt .EQ *-CSH.OPChars
2019-01-26 16:33:03 +00:00
*--------------------------------------
* 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
2019-02-13 16:20:44 +00:00
.DA #CSH.Q.CONST
2019-01-26 16:33:03 +00:00
.DA #CSH.T.CHAR
2019-02-13 16:20:44 +00:00
.DA #CSH.Q.POINTER
2019-01-26 16:33:03 +00:00
.DA #CSH.T.VARIADIC
.DA #0
2019-02-08 16:13:43 +00:00
* int puts ( const char * str );
2019-02-11 06:58:33 +00:00
>PSTR "puts"
2019-02-08 16:13:43 +00:00
.DA #CSH.T.INT returned value
2019-02-13 16:20:44 +00:00
.DA #CSH.Q.CONST
2019-02-08 16:13:43 +00:00
.DA #CSH.T.CHAR
2019-02-13 16:20:44 +00:00
.DA #CSH.Q.POINTER
2019-02-11 06:58:33 +00:00
.DA #0
2019-01-26 16:33:03 +00:00
* 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
SAVE USR/SRC/BIN/CSH.I
LOAD USR/SRC/BIN/CSH.S
ASM