2021-12-02 21:28:26 +00:00
|
|
|
|
NEW
|
|
|
|
|
AUTO 3,1
|
|
|
|
|
.LIST OFF
|
|
|
|
|
.OP 65C02
|
|
|
|
|
.OR $2000
|
|
|
|
|
.TF bin/cc
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.INB inc/macros.i
|
|
|
|
|
.INB inc/a2osx.i
|
|
|
|
|
.INB inc/mli.i
|
|
|
|
|
.INB inc/mli.e.i
|
|
|
|
|
*--------------------------------------
|
2022-12-13 06:55:13 +00:00
|
|
|
|
_DBG_SYM .EQ 0
|
2023-01-11 18:34:34 +00:00
|
|
|
|
_DBG_SCOPE .EQ 0
|
2022-12-13 06:55:13 +00:00
|
|
|
|
_DBG_OUT .EQ 0
|
2022-12-07 07:02:29 +00:00
|
|
|
|
*--------------------------------------
|
2021-12-02 21:28:26 +00:00
|
|
|
|
FILES.MAX .EQ 4
|
2022-09-04 20:12:49 +00:00
|
|
|
|
LIBS.MAX .EQ 4
|
2022-01-30 21:47:08 +00:00
|
|
|
|
SCOPE.MAX .EQ 16
|
2022-06-22 06:26:44 +00:00
|
|
|
|
LOOKUP.MAX .EQ 16
|
2022-01-30 21:47:08 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
SYM.T .EQ 0
|
|
|
|
|
SYM.T.VOID .EQ 1
|
|
|
|
|
SYM.T.UCHAR .EQ 2
|
|
|
|
|
SYM.T.SCHAR .EQ 3
|
|
|
|
|
SYM.T.UINT .EQ 4
|
|
|
|
|
SYM.T.SINT .EQ 5
|
|
|
|
|
SYM.T.ULONG .EQ 6
|
|
|
|
|
SYM.T.SLONG .EQ 7
|
|
|
|
|
SYM.T.FLOAT .EQ 8
|
2022-09-17 11:35:52 +00:00
|
|
|
|
SYM.T.SU .EQ 9
|
|
|
|
|
SYM.T.ENUM .EQ 10
|
2022-01-30 21:47:08 +00:00
|
|
|
|
SYM.T.VARIADIC .EQ $FF
|
|
|
|
|
SYM.Q .EQ 1
|
|
|
|
|
SYM.Q.POINTER .EQ %01000000
|
|
|
|
|
SYM.Q.PPOINTER .EQ %10000000
|
|
|
|
|
SYM.Q.PPPOINTER .EQ %11000000
|
|
|
|
|
SYM.Q.ARRAY .EQ %00010000
|
|
|
|
|
SYM.Q.AARRAY .EQ %00100000
|
|
|
|
|
SYM.Q.AAARRAY .EQ %00110000
|
|
|
|
|
SYM.Q.CONST .EQ %00001000
|
|
|
|
|
SYM.Q.VOLATILE .EQ %00000100
|
|
|
|
|
SYM.Q.FUNC .EQ %00000010
|
|
|
|
|
SYM.Q.FASTCALL .EQ %00000001
|
|
|
|
|
SYM.SC .EQ 2
|
|
|
|
|
SYM.SC.STATIC .EQ 0
|
|
|
|
|
SYM.SC.AUTO .EQ 2
|
|
|
|
|
SYM.SC.REGISTER .EQ 4
|
|
|
|
|
SYM.SC.EXTERN .EQ 6
|
|
|
|
|
SYM.SC.TYPEDEF .EQ 8
|
2022-06-12 20:42:22 +00:00
|
|
|
|
SYM.SC.DEFINE .EQ 10
|
|
|
|
|
SYM.SC.TAG .EQ 12
|
2022-12-13 06:55:13 +00:00
|
|
|
|
SYM.DefSize .EQ 3
|
2022-01-30 21:47:08 +00:00
|
|
|
|
SYM.SizeOf .EQ 4
|
|
|
|
|
SYM.Addr .EQ 6
|
2022-10-07 19:21:37 +00:00
|
|
|
|
SYM.BitO .EQ 8
|
|
|
|
|
SYM.BitW .EQ 9
|
2022-12-30 16:29:57 +00:00
|
|
|
|
SYM.ScopeID .EQ 10
|
2021-12-02 21:28:26 +00:00
|
|
|
|
*
|
2022-12-13 06:55:13 +00:00
|
|
|
|
*
|
|
|
|
|
SYM.Def .EQ 14 Funtions : fTQ,a1TQ,a2TQ....
|
|
|
|
|
*
|
|
|
|
|
SYM .EQ 16
|
2022-12-07 07:02:29 +00:00
|
|
|
|
SYM.F.MAX .EQ 64
|
2022-06-12 20:42:22 +00:00
|
|
|
|
*--------------------------------------
|
2022-09-17 11:35:52 +00:00
|
|
|
|
SU.F.T .EQ 0
|
|
|
|
|
SU.F.Q .EQ 1
|
|
|
|
|
SU.F.O .EQ 2
|
|
|
|
|
SU.F.BitO .EQ 4
|
|
|
|
|
SU.F.BitW .EQ 5
|
|
|
|
|
SU.F.Name .EQ 6
|
2022-09-04 20:12:49 +00:00
|
|
|
|
*--------------------------------------
|
2023-01-06 22:07:00 +00:00
|
|
|
|
SCOPE.ID .EQ 0
|
|
|
|
|
SCOPE.LocalPtr .EQ 2
|
|
|
|
|
SCOPE.FrameSize .EQ 3
|
|
|
|
|
*
|
|
|
|
|
SCOPE .EQ 4
|
|
|
|
|
*--------------------------------------
|
2023-01-06 14:02:35 +00:00
|
|
|
|
STMT.hMEM .EQ 3 switch/case
|
|
|
|
|
STMT.MemPtr .EQ 2
|
|
|
|
|
STMT.TERM .EQ 1
|
|
|
|
|
STMT.KW .EQ 0
|
2022-10-18 05:56:59 +00:00
|
|
|
|
*
|
2023-01-06 14:02:35 +00:00
|
|
|
|
STMT .EQ 4
|
2022-12-07 07:02:29 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
|
2022-10-18 05:56:59 +00:00
|
|
|
|
*--------------------------------------
|
2021-12-02 21:28:26 +00:00
|
|
|
|
* Zero Page Segment, up to 32 bytes
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
.DUMMY
|
|
|
|
|
.OR ZPBIN
|
|
|
|
|
ZS.START
|
2022-06-12 20:42:22 +00:00
|
|
|
|
ZPPtr1 .BS 2
|
|
|
|
|
ZPPtr2 .BS 2
|
|
|
|
|
ZPPtr3 .BS 2
|
|
|
|
|
ArgIndex .BS 1
|
|
|
|
|
bPass2 .BS 1
|
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
ZPCCCode .BS 2
|
|
|
|
|
ZPCCConst .BS 2
|
|
|
|
|
ZPCCData .BS 2
|
2023-01-06 14:02:35 +00:00
|
|
|
|
|
2023-01-06 22:07:00 +00:00
|
|
|
|
ScopePtr .BS 1
|
|
|
|
|
StmtPtr .BS 1
|
|
|
|
|
ScopeStk .BS 2
|
2023-01-06 14:02:35 +00:00
|
|
|
|
StmtStk .BS 2
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
|
|
|
|
ZPLineBufPtr .BS 2
|
2022-01-30 21:47:08 +00:00
|
|
|
|
ZPLookupPtr .BS 2
|
2022-06-22 06:26:44 +00:00
|
|
|
|
ZPSymBufPtr .BS 2
|
2022-06-12 20:42:22 +00:00
|
|
|
|
ZPLookupSymPtr .BS 2
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2022-12-23 16:50:50 +00:00
|
|
|
|
bLocalScope .BS 1
|
2022-08-20 14:37:37 +00:00
|
|
|
|
StmtPreOp .BS 1
|
|
|
|
|
ExpState .BS 1
|
|
|
|
|
*ExpState.VinYA .EQ $10
|
|
|
|
|
ExpState.AonStack .EQ $20
|
|
|
|
|
ExpState.AinPTR .EQ $40
|
|
|
|
|
ExpState.VonStack .EQ $80
|
2023-01-26 16:38:20 +00:00
|
|
|
|
* .BS 1
|
2021-12-02 21:28:26 +00:00
|
|
|
|
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)
|
2022-01-30 21:47:08 +00:00
|
|
|
|
.DA DS.END-DS.START Data Size
|
2021-12-02 21:28:26 +00:00
|
|
|
|
.DA #256 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
|
2022-06-22 06:26:44 +00:00
|
|
|
|
L.MSG.READING .DA MSG.READING
|
2022-06-12 20:42:22 +00:00
|
|
|
|
L.MSG.LINKING .DA MSG.LINKING
|
|
|
|
|
L.MSG.LINKING2 .DA MSG.LINKING2
|
|
|
|
|
L.MSG.GENERATING .DA MSG.GENERATING
|
2022-12-13 06:55:13 +00:00
|
|
|
|
.DO _DBG_SYM=1
|
2022-12-23 16:50:50 +00:00
|
|
|
|
L.MSG.DEBUG.SYMN .DA MSG.DEBUG.SYMN
|
|
|
|
|
L.MSG.DEBUG.SYMU .DA MSG.DEBUG.SYMU
|
|
|
|
|
L.MSG.DEBUG.SYMS .DA MSG.DEBUG.SYMS
|
2022-12-30 16:29:57 +00:00
|
|
|
|
L.MSG.DEBUG.SYMG .DA MSG.DEBUG.SYMG
|
2023-01-06 14:02:35 +00:00
|
|
|
|
L.MSG.DEBUG.SYMNL .DA MSG.DEBUG.SYMNL
|
|
|
|
|
L.MSG.DEBUG.SYMSL .DA MSG.DEBUG.SYMSL
|
2022-12-07 07:02:29 +00:00
|
|
|
|
.FIN
|
2022-12-13 06:55:13 +00:00
|
|
|
|
.DO _DBG_SCOPE=1
|
|
|
|
|
L.MSG.DEBUG.SCIN .DA MSG.DEBUG.SCIN
|
|
|
|
|
L.MSG.DEBUG.SC .DA MSG.DEBUG.SC
|
|
|
|
|
L.MSG.DEBUG.SCOUT .DA MSG.DEBUG.SCOUT
|
|
|
|
|
.FIN
|
|
|
|
|
.DO _DBG_OUT=1
|
|
|
|
|
L.MSG.DEBUG.CSOUT .DA MSG.DEBUG.CSOUT
|
|
|
|
|
L.MSG.DEBUG.OUT .DA MSG.DEBUG.OUT
|
|
|
|
|
.FIN
|
2022-12-23 16:50:50 +00:00
|
|
|
|
L.MSG.VERBOSE .DA MSG.VERBOSE
|
2022-01-30 21:47:08 +00:00
|
|
|
|
L.MSG.RTSTK .DA MSG.RTSTK
|
2021-12-02 21:28:26 +00:00
|
|
|
|
L.MSG.ERROR .DA MSG.ERROR
|
2022-06-12 20:42:22 +00:00
|
|
|
|
L.MSG.SUMMARY .DA MSG.SUMMARY
|
2022-01-30 21:47:08 +00:00
|
|
|
|
L.MSG.NOMAIN .DA MSG.NOMAIN
|
2022-10-08 12:37:10 +00:00
|
|
|
|
L.MSG.ALLDONE .DA MSG.ALLDONE
|
2021-12-02 21:28:26 +00:00
|
|
|
|
L.ENV.INCLUDE .DA ENV.INCLUDE
|
2022-09-04 20:12:49 +00:00
|
|
|
|
L.ENV.LIB .DA ENV.LIB
|
|
|
|
|
L.LIB.O .DA LIB.O
|
2021-12-02 21:28:26 +00:00
|
|
|
|
*--------------------------------------
|
2022-08-20 14:37:37 +00:00
|
|
|
|
L.CC.AOPS .DA CC.AOPS
|
2021-12-02 21:28:26 +00:00
|
|
|
|
L.CC.PREOPS .DA CC.PREOPS
|
|
|
|
|
L.CC.POSTOPS .DA CC.POSTOPS
|
|
|
|
|
L.CC.BOPS .DA CC.BOPS
|
|
|
|
|
L.CC.DIRS .DA CC.DIRS
|
|
|
|
|
L.CC.KW .DA CC.KW
|
2022-08-20 14:37:37 +00:00
|
|
|
|
L.CC.KW2.IF .DA CC.KW2.IF
|
|
|
|
|
L.CC.KW2.DO .DA CC.KW2.DO
|
2022-02-04 14:57:17 +00:00
|
|
|
|
L.CC.SCSPEC .DA CC.SCSPEC
|
2022-01-30 21:47:08 +00:00
|
|
|
|
L.CC.TYPEQUAL .DA CC.TYPEQUAL
|
|
|
|
|
L.CC.TYPESPEC .DA CC.TYPESPEC
|
2021-12-02 21:28:26 +00:00
|
|
|
|
L.CC.TYPES .DA CC.TYPES
|
|
|
|
|
L.CC.FTYPES .DA CC.FTYPES
|
2022-10-07 19:21:37 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
J.CC.DIRS .DA DIR.DEFINE
|
|
|
|
|
.DA DIR.INCLUDE
|
|
|
|
|
.DA DIR.IFDEF
|
|
|
|
|
.DA DIR.IFNDEF
|
2023-01-23 18:33:37 +00:00
|
|
|
|
.DA DIR.ELSE
|
|
|
|
|
.DA DIR.ENDIF
|
2022-10-07 19:21:37 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
J.CC.PREOPS .DA EXP.Ref
|
|
|
|
|
.DA EXP.Deref
|
|
|
|
|
.DA EXP.Abs
|
|
|
|
|
.DA EXP.negate
|
|
|
|
|
.DA EXP.lnot
|
|
|
|
|
.DA EXP.bnot
|
|
|
|
|
.DA EXP.preinc
|
|
|
|
|
.DA EXP.predec
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
J.CC.POSTOPS .DA EXP.postinc
|
|
|
|
|
.DA EXP.postdec
|
|
|
|
|
.DA EXP.idx
|
|
|
|
|
.DA EXP.SU
|
|
|
|
|
.DA EXP.pSU
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
J.CC.KW .DA KW.IF
|
|
|
|
|
.DA KW.WHILE
|
2022-10-18 05:56:59 +00:00
|
|
|
|
KW.ELSE.ID .EQ *-J.CC.KW
|
2022-10-07 19:21:37 +00:00
|
|
|
|
.DA KW.ELSE
|
|
|
|
|
.DA KW.DO
|
|
|
|
|
.DA KW.FOR
|
2022-10-18 05:56:59 +00:00
|
|
|
|
KW.SWITCH.ID .EQ *-J.CC.KW
|
2022-10-07 19:21:37 +00:00
|
|
|
|
.DA KW.SWITCH
|
|
|
|
|
.DA KW.CASE
|
|
|
|
|
.DA KW.DEFAULT
|
|
|
|
|
.DA KW.BREAK
|
|
|
|
|
.DA KW.CONTINUE
|
|
|
|
|
.DA KW.RETURN
|
|
|
|
|
.DA KW.SIZEOF
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
J.CC.KW.END .DA KW.IF.END
|
|
|
|
|
.DA KW.WHILE.END
|
|
|
|
|
.DA KW.ELSE.END
|
|
|
|
|
.DA KW.DO.END
|
|
|
|
|
.DA KW.FOR.END
|
|
|
|
|
.DA KW.SWITCH.END
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
J.CC.SCSPEC .DA DECL.AUTO
|
|
|
|
|
.DA DECL.REGISTER
|
|
|
|
|
.DA DECL.STATIC
|
|
|
|
|
.DA DECL.EXTERN
|
|
|
|
|
.DA DECL.TYPEDEF
|
|
|
|
|
J.CC.TYPEQUAL .DA TYPE.CONST
|
|
|
|
|
.DA TYPE.VOLATILE
|
|
|
|
|
J.CC.TYPESPEC .DA TYPE.STRUCT
|
|
|
|
|
.DA TYPE.UNION
|
|
|
|
|
.DA TYPE.ENUM
|
|
|
|
|
.DA TYPE.SIGNED
|
|
|
|
|
.DA TYPE.UNSIGNED
|
|
|
|
|
.DA TYPE.SHORT
|
|
|
|
|
J.CC.TYPES .DA TYPE.VOID
|
|
|
|
|
.DA TYPE.CHAR
|
|
|
|
|
.DA TYPE.INT
|
|
|
|
|
.DA TYPE.LONG
|
|
|
|
|
.DA TYPE.FLOAT
|
|
|
|
|
J.CC.UTYPES .DA TYPE.UCHAR
|
|
|
|
|
.DA TYPE.UINT
|
|
|
|
|
.DA TYPE.ULONG
|
|
|
|
|
J.CC.STYPES .DA TYPE.SCHAR
|
|
|
|
|
.DA TYPE.SINT
|
|
|
|
|
.DA TYPE.SLONG
|
2022-01-30 21:47:08 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
L.CC.MAIN .DA CC.MAIN
|
2022-09-04 20:12:49 +00:00
|
|
|
|
L.CC.SYSCALL .DA CC.SYSCALL
|
|
|
|
|
L.CC.FPUCALL .DA CC.FPUCALL
|
2022-08-20 14:37:37 +00:00
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
L.PCC.FH .DA PCC.FH
|
2022-08-20 14:37:37 +00:00
|
|
|
|
L.PCC.DEBUG .DA PCC.DEBUG
|
|
|
|
|
L.PCC.SLEEP .DA PCC.SLEEP
|
|
|
|
|
L.PCC.ENTER .DA PCC.ENTER
|
|
|
|
|
L.PCC.LEAVE .DA PCC.LEAVE
|
|
|
|
|
L.PCC.ADDLOCAL .DA PCC.ADDLOCAL
|
|
|
|
|
L.PCC.SetRetValue .DA PCC.SetRetValue
|
2022-10-18 05:56:59 +00:00
|
|
|
|
L.PCC.8to16 .DA PCC.8to16
|
|
|
|
|
L.PCC.JmpOnYA .DA PCC.JmpOnYA
|
|
|
|
|
L.PCC.Pop16 .DA PCC.Pop16
|
2022-08-20 14:37:37 +00:00
|
|
|
|
L.PCC.TestZero1 .DA PCC.TestZero1
|
|
|
|
|
L.PCC.TestZero2 .DA PCC.TestZero2
|
|
|
|
|
L.PCC.TestZeroX .DA PCC.TestZeroX
|
|
|
|
|
L.PCC.TestnZero1 .DA PCC.TestnZero1
|
|
|
|
|
L.PCC.TestnZero2 .DA PCC.TestnZero2
|
|
|
|
|
L.PCC.TestnZeroX .DA PCC.TestnZeroX
|
|
|
|
|
L.PCC.PushLAddrH .DA PCC.PushLAddrH
|
|
|
|
|
L.PCC.PushLAddrL .DA PCC.PushLAddrL
|
|
|
|
|
L.PCC.PushIAddr .DA PCC.PushIAddr
|
|
|
|
|
L.PCC.PushUAddr .DA PCC.PushUAddr
|
|
|
|
|
L.PCC.GetLAddr1 .DA PCC.GetLAddr1
|
|
|
|
|
L.PCC.GetIAddr1 .DA PCC.GetIAddr1
|
|
|
|
|
L.PCC.GetUAddr1 .DA PCC.GetUAddr1
|
|
|
|
|
L.PCC.PopAddr1 .DA PCC.PopAddr1
|
2022-09-04 20:12:49 +00:00
|
|
|
|
L.PCC.PopValue1 .DA PCC.PopValue1
|
|
|
|
|
L.PCC.PopValue2 .DA PCC.PopValue2
|
|
|
|
|
L.PCC.PopValueX .DA PCC.PopValueX
|
2022-08-20 14:37:37 +00:00
|
|
|
|
L.PCC.GetLAddr2 .DA PCC.GetLAddr2
|
|
|
|
|
L.PCC.GetIAddr2 .DA PCC.GetIAddr2
|
|
|
|
|
L.PCC.GetUAddr2 .DA PCC.GetUAddr2
|
|
|
|
|
L.PCC.PopAddr2 .DA PCC.PopAddr2
|
|
|
|
|
L.PCC.Deref2 .DA PCC.Deref2
|
|
|
|
|
L.PCC.PushDeref2 .DA PCC.PushDeref2
|
2022-09-04 20:12:49 +00:00
|
|
|
|
L.PCC.PushValue1 .DA PCC.PushValue1
|
|
|
|
|
L.PCC.PushValue2 .DA PCC.PushValue2
|
|
|
|
|
L.PCC.PushValueY .DA PCC.PushValueY
|
2022-08-20 14:37:37 +00:00
|
|
|
|
L.PCC.Inc1 .DA PCC.Inc1
|
|
|
|
|
L.PCC.Inc2 .DA PCC.Inc2
|
|
|
|
|
L.PCC.Inc4 .DA PCC.Inc4
|
|
|
|
|
L.PCC.Dec1 .DA PCC.Dec1
|
|
|
|
|
L.PCC.Dec2 .DA PCC.Dec2
|
|
|
|
|
L.PCC.Dec4 .DA PCC.Dec4
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
L.PCC.bBOPS .DA PCC.BOPS.bMUL
|
|
|
|
|
.DA PCC.BOPS.bDIV
|
|
|
|
|
.DA PCC.BOPS.bMOD
|
|
|
|
|
.DA PCC.BOPS.ADD
|
|
|
|
|
.DA PCC.BOPS.SUB
|
|
|
|
|
.DA PCC.BOPS.SHL
|
|
|
|
|
.DA PCC.BOPS.SHR
|
|
|
|
|
.DA PCC.BOPS.L
|
|
|
|
|
.DA PCC.BOPS.G
|
|
|
|
|
.DA PCC.BOPS.LE
|
|
|
|
|
.DA PCC.BOPS.GE
|
|
|
|
|
.DA PCC.BOPS.EQ
|
|
|
|
|
.DA PCC.BOPS.NE
|
|
|
|
|
.DA PCC.BOPS.LAND
|
|
|
|
|
.DA PCC.BOPS.AND
|
|
|
|
|
.DA PCC.BOPS.LOR
|
|
|
|
|
.DA PCC.BOPS.OR
|
|
|
|
|
.DA PCC.BOPS.EOR
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
L.PCC.cBOPS .DA PCC.BOPS.cMUL
|
|
|
|
|
.DA PCC.BOPS.cDIV
|
|
|
|
|
.DA PCC.BOPS.cMOD
|
|
|
|
|
.DA PCC.BOPS.ADD
|
|
|
|
|
.DA PCC.BOPS.SUB
|
|
|
|
|
.DA PCC.BOPS.SHL
|
|
|
|
|
.DA PCC.BOPS.SHR
|
|
|
|
|
.DA PCC.BOPS.L
|
|
|
|
|
.DA PCC.BOPS.G
|
|
|
|
|
.DA PCC.BOPS.LE
|
|
|
|
|
.DA PCC.BOPS.GE
|
|
|
|
|
.DA PCC.BOPS.EQ
|
|
|
|
|
.DA PCC.BOPS.NE
|
|
|
|
|
.DA PCC.BOPS.LAND
|
|
|
|
|
.DA PCC.BOPS.AND
|
|
|
|
|
.DA PCC.BOPS.LOR
|
|
|
|
|
.DA PCC.BOPS.OR
|
|
|
|
|
.DA PCC.BOPS.EOR
|
|
|
|
|
*--------------------------------------
|
2021-12-02 21:28:26 +00:00
|
|
|
|
.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
|
|
|
|
|
|
|
|
|
|
lda #hFilePtr
|
|
|
|
|
>STA.G hFilePtr
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
lda #LineCntPtr
|
|
|
|
|
>STA.G LineCntPtr
|
|
|
|
|
|
|
|
|
|
>LDYAI 256
|
|
|
|
|
>SYSCALL GetMem
|
|
|
|
|
bcs CS.INIT.RTS
|
|
|
|
|
|
|
|
|
|
>STYA.G LineBufPtr
|
|
|
|
|
txa
|
|
|
|
|
>STA.G hLineBuf
|
|
|
|
|
|
|
|
|
|
jsr CS.RUN.ARGS
|
|
|
|
|
bcs CS.INIT.RTS
|
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
jsr CORE.Init
|
2021-12-02 21:28:26 +00:00
|
|
|
|
bcs CS.INIT.RTS
|
2022-06-12 20:42:22 +00:00
|
|
|
|
|
|
|
|
|
jsr CODE.Init
|
2022-09-04 20:12:49 +00:00
|
|
|
|
bcs CS.INIT.RTS
|
2022-06-12 20:42:22 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr FIO.FOpen1st
|
2022-06-12 20:42:22 +00:00
|
|
|
|
bcs CS.INIT.RTS
|
2021-12-02 21:28:26 +00:00
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
CS.RUN.CLOOP jsr CORE.CompileFile
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2022-01-30 21:47:08 +00:00
|
|
|
|
cmp #MLI.E.EOF
|
2021-12-02 21:28:26 +00:00
|
|
|
|
bne .9
|
2022-12-07 07:02:29 +00:00
|
|
|
|
* bne .1
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr FIO.FClose
|
2022-06-12 20:42:22 +00:00
|
|
|
|
bne CS.RUN.CLOOP
|
2022-01-30 21:47:08 +00:00
|
|
|
|
*--------------------------------------
|
2022-12-07 07:02:29 +00:00
|
|
|
|
.1 jsr PrintSummary
|
2022-06-12 20:42:22 +00:00
|
|
|
|
bcs .99
|
2023-01-06 14:02:35 +00:00
|
|
|
|
* >DEBUG
|
2022-06-12 20:42:22 +00:00
|
|
|
|
jsr CC.Link
|
|
|
|
|
bcs .99
|
2023-01-06 14:02:35 +00:00
|
|
|
|
* >DEBUG
|
2022-08-20 14:37:37 +00:00
|
|
|
|
jsr CC.Link.CheckMain
|
2022-06-12 20:42:22 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
dec bPass2
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr FIO.FCreate
|
2022-06-12 20:42:22 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
|
|
|
|
|
jsr CODE.Init
|
|
|
|
|
bcs .99
|
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr FIO.FOpen1st
|
2022-06-12 20:42:22 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
.2 jsr CORE.CompileFile
|
2022-06-12 20:42:22 +00:00
|
|
|
|
|
|
|
|
|
cmp #MLI.E.EOF
|
|
|
|
|
bne .9
|
2022-10-18 05:56:59 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr FIO.FClose
|
2022-06-12 20:42:22 +00:00
|
|
|
|
bne .2
|
|
|
|
|
*--------------------------------------
|
2022-10-08 12:37:10 +00:00
|
|
|
|
>LDYA L.MSG.ALLDONE
|
|
|
|
|
>SYSCALL PutS
|
|
|
|
|
|
|
|
|
|
lda #0 Exit Code = Success
|
2021-12-02 21:28:26 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.9 pha
|
|
|
|
|
jsr PrintErrorMsg
|
|
|
|
|
pla
|
|
|
|
|
sec
|
2022-06-12 20:42:22 +00:00
|
|
|
|
.99 rts
|
2021-12-02 21:28:26 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.RUN.ARGS inc ArgIndex
|
|
|
|
|
|
|
|
|
|
lda ArgIndex
|
|
|
|
|
>SYSCALL ArgV
|
2022-06-12 20:42:22 +00:00
|
|
|
|
bcs .8
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
|
|
|
|
>STYA ZPPtr1
|
|
|
|
|
lda (ZPPtr1)
|
|
|
|
|
cmp #'-'
|
|
|
|
|
bne .4
|
|
|
|
|
|
|
|
|
|
ldy #1
|
|
|
|
|
lda (ZPPtr1),y
|
2022-09-04 20:12:49 +00:00
|
|
|
|
beq .90
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
|
|
|
|
ldx #OptionVars-OptionList-1
|
|
|
|
|
|
|
|
|
|
.1 cmp OptionList,x
|
|
|
|
|
beq .2
|
|
|
|
|
|
|
|
|
|
dex
|
|
|
|
|
bpl .1
|
|
|
|
|
|
|
|
|
|
bra .90
|
|
|
|
|
|
2022-12-30 16:29:57 +00:00
|
|
|
|
.2 cpx #2 LIB
|
2022-09-04 20:12:49 +00:00
|
|
|
|
bcc .3
|
2022-10-18 05:56:59 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
inc ArgIndex
|
|
|
|
|
|
|
|
|
|
lda ArgIndex
|
|
|
|
|
>SYSCALL ArgV
|
|
|
|
|
bcs .90
|
2022-10-18 05:56:59 +00:00
|
|
|
|
|
2022-10-07 19:21:37 +00:00
|
|
|
|
jsr FIO.LoadLIB.o
|
2022-09-04 20:12:49 +00:00
|
|
|
|
bcc CS.RUN.ARGS
|
|
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
.3 ldy OptionVars,x
|
2021-12-02 21:28:26 +00:00
|
|
|
|
lda #$ff
|
|
|
|
|
sta (pData),y
|
|
|
|
|
bra CS.RUN.ARGS
|
|
|
|
|
|
2022-06-12 20:42:22 +00:00
|
|
|
|
.4 >LDA.G CC.InFileArg
|
|
|
|
|
bne .5
|
|
|
|
|
|
|
|
|
|
lda ArgIndex
|
|
|
|
|
>STA.G CC.InFileArg
|
|
|
|
|
bra CS.RUN.ARGS
|
|
|
|
|
|
|
|
|
|
.5 >LDA.G CC.OutFileArg
|
2021-12-02 21:28:26 +00:00
|
|
|
|
bne .90
|
|
|
|
|
|
2022-06-12 20:42:22 +00:00
|
|
|
|
lda ArgIndex
|
|
|
|
|
>STA.G CC.OutFileArg
|
|
|
|
|
bra CS.RUN.ARGS
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-06-12 20:42:22 +00:00
|
|
|
|
.8 >LDA.G CC.InFileArg
|
|
|
|
|
beq .90
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2022-06-12 20:42:22 +00:00
|
|
|
|
>LDA.G CC.OutFileArg
|
2021-12-02 21:28:26 +00:00
|
|
|
|
beq .90
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
.9 rts
|
|
|
|
|
|
|
|
|
|
.90 >PUSHW L.MSG.USAGE
|
|
|
|
|
>PUSHBI 0
|
|
|
|
|
>SYSCALL PrintF
|
|
|
|
|
|
|
|
|
|
lda #E.SYN
|
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.DOEVENT sec
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2022-06-12 20:42:22 +00:00
|
|
|
|
CS.QUIT jsr CODE.Quit
|
2022-09-04 20:12:49 +00:00
|
|
|
|
jsr CORE.Quit
|
2022-10-18 05:56:59 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.1 >LDA.G LibCount
|
|
|
|
|
beq .6
|
2022-10-18 05:56:59 +00:00
|
|
|
|
|
|
|
|
|
dec
|
2022-09-04 20:12:49 +00:00
|
|
|
|
sta (pData),y
|
|
|
|
|
|
|
|
|
|
clc
|
|
|
|
|
adc #hLibOs
|
|
|
|
|
tay
|
|
|
|
|
lda (pData),y
|
|
|
|
|
>SYSCALL FreeMem
|
|
|
|
|
bra .1
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.6 >LDA.G hLineBuf
|
2022-01-30 21:47:08 +00:00
|
|
|
|
beq .8
|
|
|
|
|
|
|
|
|
|
>SYSCALL FreeMem
|
|
|
|
|
|
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2022-12-23 16:50:50 +00:00
|
|
|
|
PrintVerboseMsg
|
2022-12-13 06:55:13 +00:00
|
|
|
|
.DO _DBG_SCOPE=1
|
2023-01-11 18:34:34 +00:00
|
|
|
|
>PUSHW L.MSG.DEBUG.SC
|
|
|
|
|
jsr SCOPE.Push
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
lda ScopePtr
|
|
|
|
|
>PUSHA
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
tay
|
|
|
|
|
iny
|
|
|
|
|
iny
|
|
|
|
|
>PUSHB (ScopeStk),y
|
|
|
|
|
iny
|
|
|
|
|
>PUSHB (ScopeStk),y
|
2023-01-21 21:53:55 +00:00
|
|
|
|
|
2023-01-11 18:34:34 +00:00
|
|
|
|
>PUSHBI 5
|
|
|
|
|
>SYSCALL PrintF
|
|
|
|
|
* >DEBUG
|
2022-12-13 06:55:13 +00:00
|
|
|
|
.FIN
|
|
|
|
|
|
2022-08-20 14:37:37 +00:00
|
|
|
|
ldy #S.PS.hStdOut
|
|
|
|
|
* ldy #S.PS.hStdErr
|
2022-01-30 21:47:08 +00:00
|
|
|
|
lda (pPS),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
|
2022-12-23 16:50:50 +00:00
|
|
|
|
>PUSHW L.MSG.VERBOSE
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
|
|
|
|
>LDA.G LineCntPtr
|
|
|
|
|
inc
|
|
|
|
|
tay
|
|
|
|
|
lda (pData),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
dey
|
|
|
|
|
lda (pData),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
>PUSHW.G LineBufPtr
|
|
|
|
|
>PUSHBI 4
|
|
|
|
|
>SYSCALL FPrintF
|
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2022-06-12 20:42:22 +00:00
|
|
|
|
PrintErrorMsg >LDA.G CC.hDefineBuf
|
2021-12-02 21:28:26 +00:00
|
|
|
|
beq .10
|
|
|
|
|
|
|
|
|
|
>LDYA.G CC.SaveDefine
|
|
|
|
|
>STYA ZPLineBufPtr
|
|
|
|
|
|
2022-12-23 16:50:50 +00:00
|
|
|
|
.10 >LDA.G bVerbose
|
2021-12-02 21:28:26 +00:00
|
|
|
|
bmi .1
|
|
|
|
|
|
2022-12-23 16:50:50 +00:00
|
|
|
|
jsr PrintVerboseMsg
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
|
|
|
|
.1 lda ZPLineBufPtr
|
|
|
|
|
|
|
|
|
|
sec
|
|
|
|
|
>SBC.G LineBufPtr
|
|
|
|
|
tax
|
|
|
|
|
|
|
|
|
|
>LDYA.G LineBufPtr
|
|
|
|
|
>STYA ZPLineBufPtr
|
|
|
|
|
|
|
|
|
|
txa
|
|
|
|
|
beq .3
|
|
|
|
|
|
|
|
|
|
ldy #0
|
|
|
|
|
lda #'-'
|
|
|
|
|
|
|
|
|
|
.2 sta (ZPLineBufPtr),y
|
|
|
|
|
iny
|
|
|
|
|
dex
|
|
|
|
|
bne .2
|
|
|
|
|
|
|
|
|
|
txa
|
|
|
|
|
|
|
|
|
|
.3 sta (ZPLineBufPtr),y
|
|
|
|
|
|
|
|
|
|
.8 ldy #S.PS.hStdErr
|
|
|
|
|
lda (pPS),y
|
|
|
|
|
>PUSHA
|
|
|
|
|
>PUSHW L.MSG.ERROR
|
|
|
|
|
>PUSHW ZPLineBufPtr
|
|
|
|
|
>PUSHBI 2
|
|
|
|
|
>SYSCALL FPrintF
|
|
|
|
|
rts
|
2022-06-12 20:42:22 +00:00
|
|
|
|
*--------------------------------------
|
2022-09-04 20:12:49 +00:00
|
|
|
|
PrintSummary >PUSHW L.MSG.SUMMARY
|
|
|
|
|
lda ZPCCCode+1
|
2022-06-12 20:42:22 +00:00
|
|
|
|
sec
|
|
|
|
|
sbc #$20
|
|
|
|
|
>PUSHA
|
2022-09-04 20:12:49 +00:00
|
|
|
|
>PUSHB ZPCCCode
|
|
|
|
|
>PUSHW ZPCCConst
|
|
|
|
|
>PUSHW ZPCCData
|
2022-06-12 20:42:22 +00:00
|
|
|
|
>PUSHBI 6
|
|
|
|
|
>SYSCALL PrintF
|
2022-10-18 05:56:59 +00:00
|
|
|
|
|
2022-06-12 20:42:22 +00:00
|
|
|
|
rts
|
2021-12-02 21:28:26 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.INB usr/src/bin/cc.s.code
|
|
|
|
|
.INB usr/src/bin/cc.s.core
|
2022-01-30 21:47:08 +00:00
|
|
|
|
.INB usr/src/bin/cc.s.decl
|
2022-12-07 07:02:29 +00:00
|
|
|
|
.INB usr/src/bin/cc.s.dir
|
2021-12-02 21:28:26 +00:00
|
|
|
|
.INB usr/src/bin/cc.s.exp
|
2022-12-07 07:02:29 +00:00
|
|
|
|
.INB usr/src/bin/cc.s.f
|
2022-08-20 14:37:37 +00:00
|
|
|
|
.INB usr/src/bin/cc.s.fio
|
2022-12-07 07:02:29 +00:00
|
|
|
|
.INB usr/src/bin/cc.s.kw
|
|
|
|
|
.INB usr/src/bin/cc.s.link
|
|
|
|
|
.INB usr/src/bin/cc.s.scope
|
|
|
|
|
.INB usr/src/bin/cc.s.stmt
|
|
|
|
|
.INB usr/src/bin/cc.s.sym
|
|
|
|
|
.INB usr/src/bin/cc.s.type
|
2021-12-02 21:28:26 +00:00
|
|
|
|
*--------------------------------------
|
2022-06-12 20:42:22 +00:00
|
|
|
|
CS.END
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Initialized DATA
|
|
|
|
|
*--------------------------------------
|
2022-09-11 19:11:32 +00:00
|
|
|
|
MSG.GREETINGS .CZ "\r\nA2osX C Compiler %d.%d\r\n\r\n"
|
|
|
|
|
MSG.USAGE .CS "Usage : CC <option> srcfile.c dstfile\r\n"
|
2022-12-23 16:50:50 +00:00
|
|
|
|
.CS " -V : Verbose output\r\n"
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.CZ " -L Libname1 -L Libname2 ...\r\n"
|
|
|
|
|
MSG.READING .CZ "*** Reading file: %s\r\n"
|
|
|
|
|
MSG.LINKING .CZ "*** Linking..."
|
2022-11-02 06:54:30 +00:00
|
|
|
|
MSG.LINKING2 .CZ "*** %H:%H:%18s T/Q=%h/%h, SC=%h, Def=%h, SizeOf=%H, @=%H\r\n"
|
2022-09-11 19:11:32 +00:00
|
|
|
|
MSG.GENERATING .CZ "*** Generating: %s\r\n"
|
2022-12-13 06:55:13 +00:00
|
|
|
|
.DO _DBG_SYM=1
|
2022-12-30 16:29:57 +00:00
|
|
|
|
MSG.DEBUG.SYMN .CZ "New SymID=%H[%H],T=%h,Q=%h,SC=%h "
|
2023-01-11 18:34:34 +00:00
|
|
|
|
MSG.DEBUG.SYMU .CZ "Upd SymID=%H,T=%h,Q=%h,SC=%h,@=%H\r\n"
|
|
|
|
|
MSG.DEBUG.SYMS .CZ "Sto SymID=%H,T=%h,Q=%h,SC=%h,@=%H\r\n"
|
2022-12-30 16:29:57 +00:00
|
|
|
|
MSG.DEBUG.SYMG .CZ "Get SymID=%H,T=%h,Q=%h,SC=%h\r\n"
|
2023-01-06 14:02:35 +00:00
|
|
|
|
MSG.DEBUG.SYMNL .CZ "New (%s) ID=%H[%H],T=%h,Q=%h,SC=%h "
|
|
|
|
|
MSG.DEBUG.SYMSL .CZ "Sto ID=%H,T=%h,Q=%h,SC=%h\r\n"
|
2022-12-07 07:02:29 +00:00
|
|
|
|
.FIN
|
2022-12-13 06:55:13 +00:00
|
|
|
|
.DO _DBG_SCOPE=1
|
2023-01-21 21:53:55 +00:00
|
|
|
|
MSG.DEBUG.SCIN .CZ "Scope { %H (%h:%h:%h)\r\n"
|
|
|
|
|
MSG.DEBUG.SC .CZ "Scope = %H (%h:%h:%h)\r\n"
|
|
|
|
|
MSG.DEBUG.SCOUT .CZ "Scope } %H (%h:%h:%h) -> "
|
2022-12-13 06:55:13 +00:00
|
|
|
|
.FIN
|
|
|
|
|
.DO _DBG_OUT=1
|
2023-01-21 21:53:55 +00:00
|
|
|
|
MSG.DEBUG.CSOUT .CZ "\r\n%H-"
|
2022-12-13 06:55:13 +00:00
|
|
|
|
MSG.DEBUG.OUT .CZ "%h"
|
|
|
|
|
.FIN
|
2022-12-23 16:50:50 +00:00
|
|
|
|
MSG.VERBOSE .CZ "%5D> %s\r\n"
|
2022-09-11 19:11:32 +00:00
|
|
|
|
MSG.RTSTK .CZ "<pBase=%H, pVar=%H, (pVar)=%H, pStack=%H>\r\n"
|
|
|
|
|
MSG.ERROR .CZ " %s^\r\n"
|
2022-10-08 12:37:10 +00:00
|
|
|
|
MSG.SUMMARY .CZ "*** Compilation OK : Code size=%5D, Const size=%5D, Data size=%5D\r\n"
|
2022-09-11 19:11:32 +00:00
|
|
|
|
MSG.NOMAIN .CZ "*** No 'main()' function defined."
|
2022-10-08 12:37:10 +00:00
|
|
|
|
MSG.ALLDONE .CZ "*** All Done."
|
2022-06-12 20:42:22 +00:00
|
|
|
|
*--------------------------------------
|
2022-12-30 16:29:57 +00:00
|
|
|
|
OptionList .AS "VvLl"
|
|
|
|
|
OptionVars .DA #bVerbose,#bVerbose
|
2022-06-12 20:42:22 +00:00
|
|
|
|
*--------------------------------------
|
2022-08-20 14:37:37 +00:00
|
|
|
|
ENV.INCLUDE .AZ "INCLUDE"
|
|
|
|
|
ENV.LIB .AZ "LIB"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
LIB.O .AZ ".o"
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CC.EscChars .AS "abefnrtv"
|
2023-04-22 18:58:37 +00:00
|
|
|
|
.HS 5C27223F \'"?
|
2022-09-04 20:12:49 +00:00
|
|
|
|
CC.EscChars.Cnt .EQ *-CC.EscChars
|
|
|
|
|
CC.EscCodes .HS 07081B0C0A0D090B
|
|
|
|
|
.HS 5C27223F
|
2022-06-12 20:42:22 +00:00
|
|
|
|
*--------------------------------------
|
2022-01-30 21:47:08 +00:00
|
|
|
|
CC.OPChars .AS "!~+-*/%=&|^<>["
|
2021-12-02 21:28:26 +00:00
|
|
|
|
CC.OPChars.Cnt .EQ *-CC.OPChars
|
|
|
|
|
*--------------------------------------
|
2022-08-20 14:37:37 +00:00
|
|
|
|
* Assignment Operators: = += -= *= /= %= <<= >>= &= ^= |=
|
|
|
|
|
*--------------------------------------
|
2022-09-11 19:11:32 +00:00
|
|
|
|
CC.AOPS .PS "="
|
|
|
|
|
.PS "+="
|
|
|
|
|
.PS "-="
|
|
|
|
|
.PS "*="
|
|
|
|
|
.PS "/="
|
|
|
|
|
.PS "%="
|
|
|
|
|
.PS "<<="
|
|
|
|
|
.PS ">>="
|
|
|
|
|
.PS "&="
|
|
|
|
|
.PS "^="
|
|
|
|
|
.PS "!="
|
2022-08-20 14:37:37 +00:00
|
|
|
|
.HS 00
|
|
|
|
|
*--------------------------------------
|
2021-12-02 21:28:26 +00:00
|
|
|
|
* Pre Operators: & * + - ! ~ ++ --
|
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
CC.PREOPS .PS "&" ref
|
|
|
|
|
.PS "*" deref
|
|
|
|
|
.PS "+" abs
|
|
|
|
|
.PS "-" negate
|
|
|
|
|
.PS "!" logical not
|
|
|
|
|
.PS "~" bitwise not
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "++" pre increase
|
|
|
|
|
.PS "--" pre decrease
|
2021-12-02 21:28:26 +00:00
|
|
|
|
.HS 00
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Post Operators: ++ --
|
|
|
|
|
*--------------------------------------
|
2022-09-11 19:11:32 +00:00
|
|
|
|
CC.POSTOPS .PS "++"
|
|
|
|
|
.PS "--"
|
|
|
|
|
.PS "["
|
|
|
|
|
.PS "."
|
|
|
|
|
.PS "->"
|
2021-12-02 21:28:26 +00:00
|
|
|
|
.HS 00
|
|
|
|
|
*-- Binary ---- H to L precedence -----
|
|
|
|
|
* Arithmetic Operators: * / %
|
|
|
|
|
* Arithmetic Operators: + -
|
|
|
|
|
* Shift Operators: << >>
|
|
|
|
|
* Relational Operators: < > >= < >= == !=
|
|
|
|
|
* Bitwise Operators: & | ^ ~
|
|
|
|
|
* Logical Operators: && ||
|
|
|
|
|
*--------------------------------------
|
2022-09-11 19:11:32 +00:00
|
|
|
|
CC.BOPS .PS "*"
|
|
|
|
|
.PS "/"
|
|
|
|
|
.PS "%"
|
|
|
|
|
.PS "+"
|
|
|
|
|
.PS "-"
|
|
|
|
|
.PS "<<"
|
|
|
|
|
.PS ">>"
|
|
|
|
|
.PS "<"
|
|
|
|
|
.PS "<="
|
|
|
|
|
.PS ">"
|
|
|
|
|
.PS ">="
|
|
|
|
|
.PS "=="
|
|
|
|
|
.PS "!="
|
|
|
|
|
.PS "&"
|
|
|
|
|
.PS "|"
|
|
|
|
|
.PS "^"
|
|
|
|
|
.PS "&&"
|
|
|
|
|
.PS "||"
|
2021-12-02 21:28:26 +00:00
|
|
|
|
.HS 00
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Reserved Directives:
|
|
|
|
|
*--------------------------------------
|
2022-09-11 19:11:32 +00:00
|
|
|
|
CC.DIRS .PS "define"
|
|
|
|
|
.PS "include"
|
2023-01-23 18:33:37 +00:00
|
|
|
|
.PS "ifdef"
|
|
|
|
|
.PS "ifndef"
|
|
|
|
|
.PS "else"
|
|
|
|
|
.PS "endif"
|
2021-12-02 21:28:26 +00:00
|
|
|
|
.HS 00
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Reserved Keywords:
|
|
|
|
|
*--------------------------------------
|
2022-09-11 19:11:32 +00:00
|
|
|
|
CC.KW .PS "if"
|
|
|
|
|
.PS "while"
|
|
|
|
|
.PS "else"
|
|
|
|
|
.PS "do"
|
|
|
|
|
.PS "for"
|
|
|
|
|
.PS "switch"
|
|
|
|
|
.PS "case"
|
|
|
|
|
.PS "default"
|
|
|
|
|
.PS "break"
|
|
|
|
|
.PS "continue"
|
|
|
|
|
.PS "return"
|
|
|
|
|
.PS "sizeof"
|
2021-12-02 21:28:26 +00:00
|
|
|
|
.HS 00
|
2022-09-11 19:11:32 +00:00
|
|
|
|
CC.KW2.IF .PS "else"
|
2022-08-20 14:37:37 +00:00
|
|
|
|
.HS 00
|
2022-09-11 19:11:32 +00:00
|
|
|
|
CC.KW2.DO .PS "while"
|
2022-08-20 14:37:37 +00:00
|
|
|
|
.HS 00
|
2021-12-02 21:28:26 +00:00
|
|
|
|
*--------------------------------------
|
2022-09-11 19:11:32 +00:00
|
|
|
|
CC.SCSPEC .PS "auto"
|
|
|
|
|
.PS "register"
|
|
|
|
|
.PS "static"
|
|
|
|
|
.PS "extern"
|
|
|
|
|
.PS "typedef"
|
2022-02-04 14:57:17 +00:00
|
|
|
|
.HS 00
|
2021-12-02 21:28:26 +00:00
|
|
|
|
*--------------------------------------
|
2022-10-07 19:21:37 +00:00
|
|
|
|
CC.TYPEQUAL .PS "const" ALL
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "volatile"
|
2022-10-07 19:21:37 +00:00
|
|
|
|
CC.TYPESPEC .PS "struct"
|
|
|
|
|
.PS "union"
|
|
|
|
|
.PS "enum"
|
|
|
|
|
.PS "signed" char,int,long
|
|
|
|
|
.PS "unsigned" char,int,long
|
|
|
|
|
.PS "short" int
|
2022-09-11 19:11:32 +00:00
|
|
|
|
CC.TYPES .PS "void"
|
|
|
|
|
.PS "char"
|
|
|
|
|
.PS "int"
|
|
|
|
|
.PS "long"
|
|
|
|
|
.PS "float"
|
2021-12-02 21:28:26 +00:00
|
|
|
|
.HS 00
|
|
|
|
|
*--------------------------------------
|
2022-12-13 06:55:13 +00:00
|
|
|
|
CC.Type2FPU .DA #FPU.wMUL,#FPU.iMUL,#FPU.uMUL,#FPU.lMUL,#FPU.fMUL
|
2021-12-02 21:28:26 +00:00
|
|
|
|
*--------------------------------------
|
2022-09-11 19:11:32 +00:00
|
|
|
|
CC.FTYPES .PS "fastcall"
|
2021-12-02 21:28:26 +00:00
|
|
|
|
* .HS 00
|
|
|
|
|
*--------------------------------------
|
2022-12-13 06:55:13 +00:00
|
|
|
|
CC.TYPESIZE .HS 0001010202040405
|
|
|
|
|
CC.TYPESIGN .HS 0000FF00FF00FFFF
|
2021-12-02 21:28:26 +00:00
|
|
|
|
*--------------------------------------
|
2022-01-30 21:47:08 +00:00
|
|
|
|
CC.MAIN .AZ "main"
|
|
|
|
|
CC.MAIN.DEF .DA #SYM.T.SINT,#0,#SYM.T.SINT,#0,#SYM.T.UCHAR,#SYM.Q.PPOINTER,0
|
|
|
|
|
CC.MAIN.DEF.LEN .EQ *-CC.MAIN.DEF
|
|
|
|
|
*--------------------------------------
|
2022-09-11 19:11:32 +00:00
|
|
|
|
CC.SYSCALL .PS "chtyp"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.ChTyp
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "chmod"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.ChMod
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "fstat"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.FStat
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "stat"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.Stat
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "mkdir"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.MKDir
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "mknod"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.MKNod
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "mkfifo"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.MKFIFO
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "pipe"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.Pipe
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "opendir"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.OpenDir
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "readdir"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.ReadDir
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "closedir"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.CloseDir
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "open"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.Open
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "close"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.Close
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "read"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.Read
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "write"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.Write
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "chown"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.ChOwn
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "fputc"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.FPutC
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "putchar"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.PutChar
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "getc"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.GetC
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "getchar"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.GetChar
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "fputs"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.FPutS
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "puts"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.PutS
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "fgets"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.FGetS
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "ungetc"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.UngetC
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "fopen"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.FOpen
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "fclose"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.FClose
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "fread"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.FRead
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "fwrite"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.FWrite
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "fflush"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.FFlush
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "fseek"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.FSeek
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "ftell"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.FTell
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "feof"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.FEOF
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "remove"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.Remove
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "rename"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.Rename
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "printf"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.PrintF
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "fprintf"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.FPrintF
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "sprintf"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.SPrintF
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "scanf"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.ScanF
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "fscanf"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.FScanF
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "sscanf"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.SScanF
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "$50"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "$52"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "$54"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "$56"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "$58"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "$5A"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "$5C"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "setattr"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.SetAttr
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "mount"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "umount"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-10-07 19:21:37 +00:00
|
|
|
|
* .PS "loadstkobj"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "getstkobj"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "shift"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "argv"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "argvDup"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "geterrmsg"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "atof"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.AToF
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "atoi"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.AToI
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "atol"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.AToL
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "strtof"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.StrToF
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "strtol"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.StrToL
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "strtoul"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.StrToUL
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "realpath"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.RealPath
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "expand"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.Expand
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "strlen"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.StrLen
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "strcpy"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.StrCpy
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "strcat"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.StrCat
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "strdup"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.StrDup
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "strupr"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.StrUpr
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "strlwr"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.StrLwr
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "strcmp"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.StrCmp
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "strcasecmp"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.StrCaseCmp
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "getdevbyname"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "getdevstatus"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "mkdev"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "ioctl"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "loadlib"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "unloadlib"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "loaddrv"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "insdrv"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "execl"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.ExecL
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "execv"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "fork"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.Fork
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "kill"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.Kill
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "loadfile"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "loadtxtfile"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "filesearch"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "getmemstat"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "strvnew"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "strvset"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "strvget"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "strvfree"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "putenv"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.PutEnv
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "setenv"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.SetEnv
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "getenv"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.GetEnv
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "unsetenv"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.UnsetEnv
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "time"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.Time
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "strftime"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.StrFTime
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "ptime2time"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "ctime2time"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.CTime2Time
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "md5"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.MD5
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "md5init"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.MD5Init
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "md5update"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.MD5Update
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "md5finalize"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.MD5Finalize
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "getpwuid"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.GetPWUID
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "getpwname"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.GetPWName
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "putpw"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.PutPW
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "getgrpgid"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.GetGRGID
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "getgrpname"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.GetGRName
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "putgr"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.PutGR
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "opensession"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "closesession"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "slistgetdata"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "slistadddata"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "slistsetdata"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "slistgetbyid"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "slistnewkey"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "slistlookup"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "slistfree"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "slistnew"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "malloc"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.GetMem
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "realloc"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #SYS.Realloc
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "getmemptr"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-10-07 19:21:37 +00:00
|
|
|
|
* .PS "freemem"
|
|
|
|
|
* .DA #SYS.FreeMem
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "free"
|
2022-10-07 19:21:37 +00:00
|
|
|
|
.DA #SYS.Free
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "newstkobj"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "getstkobjptr"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
2022-09-11 19:11:32 +00:00
|
|
|
|
* .PS "freestkobj"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
* .DA #0
|
|
|
|
|
.DA #0
|
2021-12-02 21:28:26 +00:00
|
|
|
|
*--------------------------------------
|
2022-09-11 19:11:32 +00:00
|
|
|
|
CC.FPUCALL .PS "pwr"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #FPU.PWR
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "log"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #FPU.LOG
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "sqr"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #FPU.SQR
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "exp"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #FPU.EXP
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "cos"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #FPU.COS
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "sin"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #FPU.SIN
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "tan"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #FPU.TAN
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "atan"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #FPU.ATAN
|
2022-09-11 19:11:32 +00:00
|
|
|
|
.PS "lrintf"
|
2022-09-04 20:12:49 +00:00
|
|
|
|
.DA #FPU.QINT
|
|
|
|
|
.DA #0
|
2022-08-20 14:37:37 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.INB usr/src/bin/cc.s.pcc
|
2021-12-02 21:28:26 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
.DUMMY
|
|
|
|
|
.OR 0
|
|
|
|
|
DS.START
|
|
|
|
|
PathBuf .BS MLI.MAXPATH+1
|
|
|
|
|
|
2022-12-30 16:29:57 +00:00
|
|
|
|
*bDebug .BS 1
|
2022-12-23 16:50:50 +00:00
|
|
|
|
bVerbose .BS 1
|
2022-01-30 21:47:08 +00:00
|
|
|
|
|
2022-09-04 20:12:49 +00:00
|
|
|
|
LibCount .BS 1
|
|
|
|
|
hLibNs .BS LIBS.MAX
|
|
|
|
|
hLibOs .BS LIBS.MAX
|
|
|
|
|
|
2022-06-22 06:26:44 +00:00
|
|
|
|
CC.InFileArg .BS 1
|
|
|
|
|
CC.OutFileArg .BS 1
|
|
|
|
|
CC.hOutFile .BS 1
|
|
|
|
|
|
2021-12-02 21:28:26 +00:00
|
|
|
|
hFilePtr .BS 1
|
|
|
|
|
hFiles .BS FILES.MAX
|
|
|
|
|
|
|
|
|
|
LineCntPtr .BS 1
|
|
|
|
|
.BS 1 for inc inc
|
2022-06-12 20:42:22 +00:00
|
|
|
|
LineCnts .BS FILES.MAX*2
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
|
|
|
|
hLineBuf .BS 1
|
|
|
|
|
LineBufPtr .BS 2
|
|
|
|
|
|
|
|
|
|
CC.CmdSave .BS 1
|
|
|
|
|
|
2022-06-12 20:42:22 +00:00
|
|
|
|
CC.hDefineBuf .BS 1
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2022-06-12 20:42:22 +00:00
|
|
|
|
CC.hDefines .BS 1
|
|
|
|
|
CC.SaveDefine .BS 2
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2023-01-26 16:38:20 +00:00
|
|
|
|
CC.DirState .BS 1
|
|
|
|
|
CC.DirDepth .BS 1
|
|
|
|
|
|
2022-06-12 20:42:22 +00:00
|
|
|
|
CC.hTags .BS 1
|
2023-01-06 22:07:00 +00:00
|
|
|
|
CC.hScopeStk .BS 1
|
|
|
|
|
CC.hStmtStk .BS 1
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
2022-12-07 07:02:29 +00:00
|
|
|
|
CC.hSyms .BS 1
|
|
|
|
|
|
|
|
|
|
CC.ScopeID .BS 2
|
2022-08-20 14:37:37 +00:00
|
|
|
|
|
2022-12-23 16:50:50 +00:00
|
|
|
|
CC.bInitCode .BS 1
|
2022-06-12 20:42:22 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CC.hSymBuf .BS 1
|
2022-06-22 06:26:44 +00:00
|
|
|
|
CC.SymID .BS 2
|
|
|
|
|
CC.SymIDSave .BS 2
|
|
|
|
|
CC.ArgBuf .BS SYM
|
2023-01-06 14:02:35 +00:00
|
|
|
|
|
|
|
|
|
CC.Label .BS 3 _X\0
|
|
|
|
|
CC.LabelID .BS 2
|
|
|
|
|
CC.LabelBuf .BS SYM
|
2022-06-12 20:42:22 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CC.LookupSymSize .BS 2
|
2022-06-22 06:26:44 +00:00
|
|
|
|
CC.LookupSymPtr .BS 2
|
|
|
|
|
CC.LookupIdx .BS 1
|
|
|
|
|
CC.hLookupBufs .BS LOOKUP.MAX
|
2021-12-02 21:28:26 +00:00
|
|
|
|
|
|
|
|
|
DS.END .ED
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
MAN
|
|
|
|
|
SAVE usr/src/bin/cc.s
|
|
|
|
|
ASM
|