A2osX/BIN/CSH.I.txt
2019-10-03 08:25:27 +02:00

123 lines
2.9 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

NEW
AUTO 3,1
.LIST OFF
*--------------------------------------
CSH.Q.CONST .EQ %10000000
CSH.Q.POINTER .EQ %00100000
CSH.Q.PPOINTER .EQ %01000000
CSH.Q.PPPOINTER .EQ %01100000
CSH.T.CHAR .EQ 1
CSH.T.INT .EQ 2
CSH.T.LONG .EQ 3
CSH.T.UCHAR .EQ 4
CSH.T.UINT .EQ 5
CSH.T.ULONG .EQ 6
CSH.T.FLOAT .EQ 7
CSH.T.VARIADIC .EQ $1F
*--------------------------------------
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 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.TYPESIZE .HS 0001020401020405 VOID,CHAR,INT,LONG,UCHAR,UINT,ULONG,FLOAT....
*--------------------------------------
* int printf ( const char * format, ... );
CSH.FN >PSTR "printf"
.DA #CSH.T.INT returned value
.DA #CSH.Q.CONST+CSH.Q.POINTER+CSH.T.CHAR
.DA #CSH.T.VARIADIC
.DA #0
* int puts ( const char * str );
>PSTR "puts"
.DA #CSH.T.INT returned value
.DA #CSH.Q.CONST+CSH.Q.POINTER+CSH.T.CHAR
.DA #0
* float cos ( float x );
>PSTR "cos"
.DA #CSH.T.FLOAT returned value
.DA #CSH.T.FLOAT
.DA #0
* char getchar ( void );
>PSTR "getchar"
.DA #CSH.T.CHAR returned value
.DA #0
.DA #0
*--------------------------------------
MAN
SAVE USR/SRC/BIN/CSH.I
LOAD USR/SRC/BIN/CSH.S
ASM