A2osX/BIN/CSH.I.txt
2021-01-12 22:14:13 +01:00

207 lines
5.1 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.T.VOID .EQ 0
CSH.T.SCHAR .EQ 1
CSH.T.SINT .EQ 2
CSH.T.SLONG .EQ 3
CSH.T.FLOAT .EQ 4
CSH.T.UCHAR .EQ 5
CSH.T.UINT .EQ 6
CSH.T.ULONG .EQ 7
CSH.T.VARIADIC .EQ $FF
*--------------------------------------
CSH.Q.POINTER .EQ %01000000
CSH.Q.PPOINTER .EQ %10000000
CSH.Q.PPPOINTER .EQ %11000000
CSH.Q.PCONST .EQ %00100000
CSH.Q.CONST .EQ %00010000
CSH.Q.FUNC .EQ %00001000
*--------------------------------------
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"
CSH.MTYPES >PSTR "const" ALL
>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.FTYPES >PSTR "fastcall"
* .HS 00
*--------------------------------------
CSH.TYPESIZE .HS 0001020405010204
*--------------------------------------
CSH.FN
* float cos ( float x );
>PSTR "log"
.DA #CSH.T.FLOAT returned value
.DA #CSH.T.FLOAT
.DA #0
>PSTR "sqr"
.DA #CSH.T.FLOAT returned value
.DA #CSH.T.FLOAT
.DA #0
>PSTR "exp"
.DA #CSH.T.FLOAT returned value
.DA #CSH.T.FLOAT
.DA #0
>PSTR "cos"
.DA #CSH.T.FLOAT returned value
.DA #CSH.T.FLOAT
.DA #0
>PSTR "sin"
.DA #CSH.T.FLOAT returned value
.DA #CSH.T.FLOAT
.DA #0
>PSTR "tan"
.DA #CSH.T.FLOAT returned value
.DA #CSH.T.FLOAT
.DA #0
>PSTR "atan"
.DA #CSH.T.FLOAT returned value
.DA #CSH.T.FLOAT
.DA #0
* char getchar ( void );
>PSTR "getchar"
.DA #CSH.T.UCHAR returned value
.DA #0
* int puts ( const char * str );
>PSTR "puts"
.DA #CSH.T.SINT returned value
.DA #CSH.Q.CONST+CSH.Q.POINTER+CSH.T.UCHAR
.DA #0
* int execl(const char* cmdline, short int flags);
>PSTR "execl"
.DA #CSH.T.SINT returned value
.DA #CSH.Q.CONST+CSH.Q.POINTER+CSH.T.UCHAR
.DA #CSH.T.UCHAR
.DA #0
* int printf ( const char * format, ... );
>PSTR "printf"
.DA #CSH.T.SINT returned value
.DA #CSH.Q.CONST+CSH.Q.POINTER+CSH.T.UCHAR
.DA #CSH.T.VARIADIC
.DA #0
* int putenv(const char *string);
>PSTR "putenv"
.DA #CSH.T.SINT returned value
.DA #CSH.Q.CONST+CSH.Q.POINTER+CSH.T.UCHAR
.DA #0
* int setenv(const char *name, const char *value);
>PSTR "setenv"
.DA #CSH.T.SINT returned value
.DA #CSH.Q.CONST+CSH.Q.POINTER+CSH.T.UCHAR
.DA #CSH.Q.CONST+CSH.Q.POINTER+CSH.T.UCHAR
.DA #0
* char *getenv(const char *name, char *value);
>PSTR "getenv"
.DA #CSH.Q.POINTER+CSH.T.UCHAR
.DA #CSH.Q.CONST+CSH.Q.POINTER+CSH.T.UCHAR
.DA #CSH.Q.POINTER+CSH.T.UCHAR
.DA #0
* int unsetenv(const char *name);
>PSTR "unsetenv"
.DA #CSH.T.SINT returned value
.DA #CSH.Q.CONST+CSH.Q.POINTER+CSH.T.UCHAR
.DA #0
* void md5 (const char* str, char* digest);
>PSTR "md5"
.DA #CSH.T.VOID
.DA #CSH.Q.CONST+CSH.Q.POINTER+CSH.T.UCHAR
.DA #CSH.Q.POINTER+CSH.T.UCHAR
.DA #0
* void * malloc ( int size );
>PSTR "malloc"
.DA #CSH.Q.POINTER+CSH.T.VOID returned value
.DA #CSH.T.SINT
.DA #0
*--------------------------------------
.DA #0
*--------------------------------------
MAN
SAVE usr/src/bin/csh.i
LOAD usr/src/bin/csh.s
ASM