Kernel 0.94++

This commit is contained in:
Rémy GIBERT 2021-05-22 23:05:12 +02:00
parent 8ff85dfd1a
commit 31548cde8c
17 changed files with 467 additions and 176 deletions

View File

@ -70,7 +70,7 @@ This document lists all of the **ACOS Words** supported in the A2osX implementat
| SETINT | SETINT (*string1* [,*string1*...])<br>SETINT ("")<br>SETINT (*number*) | Not Yet Implemented | Sets the interrupt table with specified keys. | The <tt>SETINT</tt> command is used to set up 'interrupt' keys. Once setup the system will check for those keys whenever text is being displayed. If one of the keys are encountered, all further output will be suppressed until an input statement of some kind is encountered or the <tt>SETINT</tt> is reset. To reset the <tt>SETINT</tt> command, use the second syntax. If you wish to set the interrupt keys to those pre-defined by the ACOS config program, use the third syntax. <tt>SETINT(1)</tt> will set the interrupt key to the 'file stop' character. <tt>SETINT(2)</tt> will set the interrupt keys to the 'file stop' and 'file next' characters. | | | SETINT | SETINT (*string1* [,*string1*...])<br>SETINT ("")<br>SETINT (*number*) | Not Yet Implemented | Sets the interrupt table with specified keys. | The <tt>SETINT</tt> command is used to set up 'interrupt' keys. Once setup the system will check for those keys whenever text is being displayed. If one of the keys are encountered, all further output will be suppressed until an input statement of some kind is encountered or the <tt>SETINT</tt> is reset. To reset the <tt>SETINT</tt> command, use the second syntax. If you wish to set the interrupt keys to those pre-defined by the ACOS config program, use the third syntax. <tt>SETINT(1)</tt> will set the interrupt key to the 'file stop' character. <tt>SETINT(2)</tt> will set the interrupt keys to the 'file stop' and 'file next' characters. | |
| STR$ | *string*=STR$(*number*) | Not Yet Implemented | Returns string representation of a numerical expression. | Returns the numerical supplied numerical expression as a string. | | | STR$ | *string*=STR$(*number*) | Not Yet Implemented | Returns string representation of a numerical expression. | Returns the numerical supplied numerical expression as a string. | |
| TEXT | TEXT | Not Yet Implemented | Clear the screen and any window on the local console. | Used to clear the screen and any window on the local console. BJB REMY TODO: How is this different from HOME? | | | TEXT | TEXT | Not Yet Implemented | Clear the screen and any window on the local console. | Used to clear the screen and any window on the local console. BJB REMY TODO: How is this different from HOME? | |
| THEN | THEN | Not Yet Implemented | Statement separator for logical IF statements. | Separates statements within <tt>IF</tt> statements. | | | THEN | THEN | Impl. | Statement separator for logical IF statements. | Separates statements within <tt>IF</tt> statements. | |
| TIME$ | *string*=TIME$ | Not Yet Implemented | Returns the current TIME into a string. | The <tt>TIME$</tt> function is used to get the current time from your clock. If your system is equipped with a clock, the time will be returned in a "HH:MM:SS XM" format. If your clock is in the 24 hour configuration then it will be returned in the "HH:MM:SS" format. If you have no clock, then your estimated time on will be returned. The estimated time is based upon the number of characters output and the speed they were sent. The format for estimated time is "HH:MM:SS ET". When the clock is first reset via a <tt>MODEM(0)</tt> command, the time will be "00:00:00 ET" and will advance from there. REMY TODO: How is your implementation of no clocks? | | | TIME$ | *string*=TIME$ | Not Yet Implemented | Returns the current TIME into a string. | The <tt>TIME$</tt> function is used to get the current time from your clock. If your system is equipped with a clock, the time will be returned in a "HH:MM:SS XM" format. If your clock is in the 24 hour configuration then it will be returned in the "HH:MM:SS" format. If you have no clock, then your estimated time on will be returned. The estimated time is based upon the number of characters output and the speed they were sent. The format for estimated time is "HH:MM:SS ET". When the clock is first reset via a <tt>MODEM(0)</tt> command, the time will be "00:00:00 ET" and will advance from there. REMY TODO: How is your implementation of no clocks? | |
| TONE | TONE (*pitch*, *duration*) | Not Yet Implemented | Generates a tone on the local speaker. | The TONE function is used to generate a tone from the speaker in your computer. BJB TODO: Need to determine limits. | | | TONE | TONE (*pitch*, *duration*) | Not Yet Implemented | Generates a tone on the local speaker. | The TONE function is used to generate a tone from the speaker in your computer. BJB TODO: Need to determine limits. | |
| UPDATE | UPDATE | Not Yet Implemented | Flushes any cached data for the current message database. | The <tt>UPDATE</tt> statement is used to write any information about the current message base from memory out to disk (i.e. a flush operation). Normally, certain things are buffered and will stay within memory for long periods of time. In the event of a power failure or a system reset, this data will be lost before it is written out to disk. Use the <tt>UPDATE</tt> statement to force the data to be written out to disk. | | | UPDATE | UPDATE | Not Yet Implemented | Flushes any cached data for the current message database. | The <tt>UPDATE</tt> statement is used to write any information about the current message base from memory out to disk (i.e. a flush operation). Normally, certain things are buffered and will stay within memory for long periods of time. In the event of a power failure or a system reset, this data will be lost before it is written out to disk. Use the <tt>UPDATE</tt> statement to force the data to be written out to disk. | |

Binary file not shown.

View File

@ -39,9 +39,24 @@ A2osX.QC.Start1 sei
lda #$8C Reset 80 col screen ($0C=FF=HOME) lda #$8C Reset 80 col screen ($0C=FF=HOME)
jsr $C300 jsr $C300
lda $280 ldx $280
beq A2osX.QC.Start2 beq A2osX.QC.Start2
.2 dex
lda $280,x
cmp #'/'
bne .2
stx A2osX.QC.BOOT
.3 lda $280,x
sta A2osX.QC.BOOT,x
dex
bne .3
jsr A2osX.QC.SetPFX
bcs A2osX.QC.Start2
jsr A2osX.QC.Load jsr A2osX.QC.Load
bcs A2osX.QC.Start2 bcs A2osX.QC.Start2
@ -51,9 +66,7 @@ A2osX.QC.Start2 sec
>LDYAI MSG.INIT1 >LDYAI MSG.INIT1
jsr A2osX.QC.PrintYA jsr A2osX.QC.PrintYA
.3 jsr MLI .3 jsr A2osX.QC.SetPFX
.DA #MLISETPREFIX
.DA MLISETPREFIX03
bcc .4 bcc .4
>LDYAI MSG.SETPREFIXKO >LDYAI MSG.SETPREFIXKO
@ -113,6 +126,11 @@ A2osX.QC.Start2 sec
A2osX.QC.JMP >DEBUGOA A2osX.QC.JMP >DEBUGOA
jmp $2000 jmp $2000
*-------------------------------------- *--------------------------------------
A2osX.QC.SetPFX jsr MLI
.DA #MLISETPREFIX
.DA MLISETPREFIX03
rts
*--------------------------------------
A2osX.QC.Load >LDYAI MSG.LOAD A2osX.QC.Load >LDYAI MSG.LOAD
clc clc
jsr A2osX.QC.PrintYA jsr A2osX.QC.PrintYA

View File

@ -160,7 +160,7 @@ CORE.Compile jsr CORE.GetChar
bra .8 bra .8
*-------------------------------------- *--------------------------------------
.3 jsr CORE.CreateOrGetVar .3 jsr CORE.CreateOrGetVar
bcs .90 bcs .99
jsr CORE.GetCharNB jsr CORE.GetCharNB
bcs .90 bcs .90
@ -425,6 +425,8 @@ CORE.CreateLabel
jsr CORE.NewKey jsr CORE.NewKey
bcs .9 bcs .9
>STYA ZPSID
>PUSHB.G hLabels >PUSHB.G hLabels
>PUSHW ZPSID >PUSHW ZPSID
>PUSHWI ZPCodeBufPtr >PUSHWI ZPCodeBufPtr
@ -490,21 +492,15 @@ CORE.CreateOrGetVar
jsr CORE.GetAddr jsr CORE.GetAddr
bcc .2 bcc .2
>LDA.G hVars jsr CORE.NewVarKey
jsr CORE.NewKey
bcs .99 bcs .99
jsr CORE.GetChar >STYA ZPSID
bcs .1
stz ZPTYPE jsr CORE.GetVarType
stx ZPTYPE
cmp #'$' beq .1
bne .1
sta ZPTYPE
jsr CORE.GetNextChar skip $
lda STRID lda STRID
sta ZPADDR sta ZPADDR
@ -537,19 +533,9 @@ CORE.CreateOrGetVar
>SYSCALL SListAddData >SYSCALL SListAddData
rts rts
*-------------------------------------- *--------------------------------------
.2 ldx #0 .2 jsr CORE.GetVarType
jsr CORE.GetChar cpx ZPTYPE
bcs .3
cmp #'$'
bne .3
tax
jsr CORE.GetNextChar skip $
.3 cpx ZPTYPE
bne .90 bne .90
clc clc
@ -560,15 +546,22 @@ CORE.CreateOrGetVar
.99 rts .99 rts
*-------------------------------------- *--------------------------------------
CORE.NewVarKey >LDA.G hVars
CORE.NewKey >PUSHA CORE.NewKey >PUSHA
>PUSHW ZPInputBufPtr >PUSHW ZPInputBufPtr
>SYSCALL SListNewKey >SYSCALL SListNewKey
bcs CORE.GetAddr.RTS bcs .9
>STYA ZPSID pha
txa txa
jmp CORE.SkipA jsr CORE.SkipA
pla Y,A = KeyID
clc
.9 rts
*-------------------------------------- *--------------------------------------
CORE.GetAddr >PUSHA CORE.GetAddr >PUSHA
>PUSHA for SListGetData >PUSHA for SListGetData
@ -590,9 +583,27 @@ CORE.GetAddr >PUSHA
rts rts
.9 >POP 1 .9 >POP 1
CORE.GetAddr.RTS
rts rts
*-------------------------------------- *--------------------------------------
CORE.GetVarType jsr CORE.GetChar
bcs .9
cmp #'$'
bne .9
inc ZPInputBufPtr
bne .1
inc ZPInputBufPtr+1 skip $
.1 tax NZ
rts
.9 ldx #0 Z
rts
*--------------------------------------
CORE.ToUpperCase CORE.ToUpperCase
cmp #'a' cmp #'a'
bcc .8 bcc .8

View File

@ -60,16 +60,17 @@ EXP.Eval.R lda EXP.AOPS
bra .40 bra .40
.21 jsr EXP.VARLookup .21 jsr EXP.VARLookup
bcs .99 bcc .22
ldx EXP.TYPE
bne .22 .22 ldx EXP.TYPE
bne .23
jsr CODE.INTGET jsr CODE.INTGET
bra .40 bra .40
.22 jsr CODE.STRGET .23 jsr CODE.STRGET
bra .40 bra .40
*-------------------------------------- *--------------------------------------
@ -198,13 +199,13 @@ EXP.Int16 >PUSHW ZPInputBufPtr
EXP.VARLookup >LDA.G hVars EXP.VARLookup >LDA.G hVars
>PUSHA >PUSHA
>PUSHA for SListGetData >PUSHA for SListGetData/SListAddData
>PUSHW ZPInputBufPtr >PUSHW ZPInputBufPtr
>SYSCALL SListLookup >SYSCALL SListLookup
bcs .9 bcs .3
>PUSHYA ZPSID >PUSHYA KeyID
txa txa
jsr CORE.SkipA jsr CORE.SkipA
@ -215,31 +216,64 @@ EXP.VARLookup >LDA.G hVars
>SYSCALL SListGetData >SYSCALL SListGetData
bcs .99 bcs .99
ldx #0 jsr CORE.GetVarType
jsr CORE.GetChar cpx EXP.TYPE
bcs .2
cmp #'$'
bne .2
tax
jsr CORE.GetNextChar skip $
.2 cpx EXP.TYPE
bne .90 bne .90
clc clc
rts rts
.9 >PULLA
.99 rts
.90 lda #E.TMISMATCH .90 lda #E.TMISMATCH
sec sec
rts .99 rts
*-------------------------------------- *--------------------------------------
.3 jsr CORE.NewVarKey
bcs .39
phy
pha KeyID
jsr CORE.GetVarType
stx EXP.TYPE
beq .11
lda STRID
sta EXP.ADDR
lda STRID+1
sta EXP.ADDR+1
inc STRID
bne .10
inc STRID+1
bra .10
.11 lda ZPDataBufPtr
sta EXP.ADDR
clc
adc #2 Word
sta ZPDataBufPtr
lda ZPDataBufPtr+1
sta EXP.ADDR+1
adc #0
sta ZPDataBufPtr+1
.10 pla
>PUSHA
pla
>PUSHA
>PUSHWI EXP.ADDR
>PUSHWI 3 3 bytes : ADDR + TYPE
>SYSCALL SListAddData
rts
.39 inc pStack
rts
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE usr/src/bin/acos.s.exp SAVE usr/src/bin/acos.s.exp

View File

@ -294,7 +294,22 @@ KW.RIPCO
KW.SET KW.SET
KW.SETINT KW.SETINT
KW.TEXT KW.TEXT
KW.THEN lda #E.CSYN
sec
rts
*--------------------------------------
KW.THEN ldy pCCS
lda (pData),y
eor #KWID.IF
bne .9
clc
rts
.9 lda #E.NOIF
sec
rts
*--------------------------------------
KW.TONE KW.TONE
KW.UPDATE KW.UPDATE
KW.USE KW.USE

View File

@ -2,16 +2,14 @@ NEW
AUTO 3,1 AUTO 3,1
.LIST OFF .LIST OFF
*-------------------------------------- *--------------------------------------
STR.Add RT.StrSet
*-------------------------------------- *--------------------------------------
STR.replace RT.StrGet
*--------------------------------------
STR.Get
*-------------------------------------- *--------------------------------------
clc clc
rts rts
*-------------------------------------- *--------------------------------------
MAN MAN
SAVE usr/src/bin/acos.s.str SAVE usr/src/bin/acos.s.rt
LOAD usr/src/bin/acos.s LOAD usr/src/bin/acos.s
ASM ASM

View File

@ -506,6 +506,7 @@ CCODE.LEFT.LEN .EQ *-CCODE.LEFT
.INB usr/src/bin/acos.s.exp .INB usr/src/bin/acos.s.exp
.INB usr/src/bin/acos.s.fn .INB usr/src/bin/acos.s.fn
.INB usr/src/bin/acos.s.kw .INB usr/src/bin/acos.s.kw
.INB usr/src/bin/acos.s.rt
*-------------------------------------- *--------------------------------------
CS.END CS.END
*-------------------------------------- *--------------------------------------

View File

@ -3,12 +3,12 @@ NEW
.LIST OFF .LIST OFF
*-------------------------------------- *--------------------------------------
CSH.Init >SYSCALL SListNew CSH.Init >SYSCALL SListNew
bcs .9 bcs .99
>STA.G CSH.hDefines >STA.G CSH.hDefines
>SYSCALL SListNew >SYSCALL SListNew
bcs .9 bcs .99
>STA.G CSH.hTags >STA.G CSH.hTags
@ -19,7 +19,7 @@ CSH.Init >SYSCALL SListNew
>LDYAI 256 >LDYAI 256
>SYSCALL GetMem >SYSCALL GetMem
bcs .9 .99 bcs .9
>STYA ZPCSHCode >STYA ZPCSHCode
txa txa
@ -49,6 +49,14 @@ CSH.Init >SYSCALL SListNew
txa txa
>STA.G CSH.hStack >STA.G CSH.hStack
>LDYAI 256
>SYSCALL GetMem
bcs .9
>STYA ZPCSHfDecl
txa
>STA.G CSH.hfDecl
lda #0 lda #0
>STA.G CSH.ConstPtr >STA.G CSH.ConstPtr
>STA.G CSH.StackPtr >STA.G CSH.StackPtr
@ -81,6 +89,9 @@ CSH.Quit >LDA.G CSH.hSymbols
>LDA.G hFileBuf >LDA.G hFileBuf
jsr .7 jsr .7
>LDA.G CSH.hfDecl
jsr .7
>LDA.G CSH.hStack >LDA.G CSH.hStack
jsr .7 jsr .7
@ -115,30 +126,70 @@ CSH.Run.1 cmp #C.CR empty line....
jmp CSH.DIR jmp CSH.DIR
.4 cmp #'}' End of block ? .4 cmp #'}' End of block ?
bne .40 bne .10
jsr CSH.CheckStack must be something on stack.... jsr CSH.CheckStack must be something on stack....
bcs .9 bcs CSH.Quit.RTS
jsr CSH.GetNextCharNB Skip '}' jsr CSH.GetNextCharNB Skip '}'
jsr CSH.Pop was expected.... jsr CSH.Pop was expected....
jsr CSH.Pop get stacked Cmd... jsr CSH.Pop get stacked Cmd...
tax tax
jmp (J.CSH.KW.END,x) jmp (J.CSH.KW.END,x)
*--------------------------------------
.40 jsr CSH.IsLetter .10 jsr CSH.IsLetter
bcc .5 bcc .20
bra .99 error, todo : PREOPS ++ --..... bcs .29 error, todo : PREOPS ++ --.....
*--------------------------------------
.20 >LDYA L.CSH.TMODS
jsr CSH.LookupID
bcs .50
.5 jsr CSH.SavePtr Save Ptr, in case of while,for.... jsr CSH.tDecl.JMP
bcs .59
jsr CSH.AddSymbol add with undef value...
bcs .99 OOM or DUP
jsr CSH.GetCharNB
bcs .99
cmp #';'
beq .8
cmp #'='
bne .21
jsr CSH.GetNextCharNB skip '='
bcs .99
lda ZPVarType
jsr CSH.ExpEval
bcs .9
jsr CSH.SetVarValueFromStack X= Type, Set value to this var
.29 bcs .99
bra .68
.21 cmp #'('
bne .99
jsr CSH.fDecl
bcs .99
bra .68
*--------------------------------------
.50 jsr CSH.SavePtr Save Ptr, in case of while,for....
>LDYA L.CSH.KW >LDYA L.CSH.KW
jsr CSH.LookupID jsr CSH.LookupID
bcs .6 not an internal CSH keyword.... bcs .6 not an internal CSH keyword....
jsr CSH.KW.JMP jsr CSH.KW.JMP
bcs .9 .59 bcs .9
bra .8 bra .8
.6 jsr CSH.GetVar .6 jsr CSH.GetVar
@ -148,7 +199,13 @@ CSH.Run.1 cmp #C.CR empty line....
jsr CSH.GetVarDef Get Type & ptr... jsr CSH.GetVarDef Get Type & ptr...
bcs .9 bcs .9
jsr CSH.GetCharNB lda ZPVarQual
bit #CSH.Q.FUNC
beq .60
*--------------------------------------
.60 jsr CSH.GetCharNB
bcs .9 bcs .9
cmp #'=' TODO: all AOPS cmp #'=' TODO: all AOPS
@ -164,7 +221,7 @@ CSH.Run.1 cmp #C.CR empty line....
jsr CSH.SetVarValueFromStack X = Exp Type jsr CSH.SetVarValueFromStack X = Exp Type
bcs .9 bcs .9
jsr CSH.GetChar .68 jsr CSH.GetCharNB
cmp #';' cmp #';'
beq .8 beq .8
@ -337,56 +394,95 @@ CSH.AddSymbol >LDA.G CSH.hSymbols
.9 rts .9 rts
.99 lda #E.OOM .99 lda #E.OOM
.HS 2C BIT ABS * sec
CSH.TMISMATCH lda #E.TMISMATCH
sec
rts rts
*-------------------------------------- *--------------------------------------
CSH.fDeclaration CSH.fDecl lda ZPCSHfDecl
lda #CSH.Q.FUNC sta ZPVarDataPtr
tsb ZPVarType
lda ZPCSHfDecl+1
sta ZPVarDataPtr+1
jsr CSH.SkipLine
clc
rts
lda ZPVarID
jsr CSH.fDeclAddA
lda ZPVarID+1
jsr CSH.fDeclAddA
>DEBUG
jsr CSH.GetNextCharNB Skip ( jsr CSH.GetNextCharNB Skip (
bcs .9 bcs .9
.1 cmp #')' .1 cmp #')'
beq .5 beq .5
jsr CSH.GetDeclaration .2 jsr CSH.fDeclGetArg
bcs .99 bcs .99
jsr CSH.GetCharNB
bcs .9
cmp #')'
beq .5
cmp #','
bne .9
jsr CSH.GetNextCharNB Skip ,
bcs .9
bra .2
.5 jsr CSH.GetNextCharNB Skip ) .5 jsr CSH.GetNextCharNB Skip )
bcs .9
clc cmp #';'
rts bne .9
jsr CSH.GetNextCharNB Skip ;
.8 lda #0
sta (ZPCSHfDecl)
jmp CSH.SetVarValueFromStack
.9 lda #E.CSYN .9 lda #E.CSYN
sec sec
.99 rts .99 rts
*-------------------------------------- *--------------------------------------
CSH.GetDeclaration CSH.fDeclGetArg >ENTER 4
>ENTER 4
>LDYA L.CSH.MTYPES >LDYA L.CSH.TMODS
jsr CSH.LookupID jsr CSH.LookupID
bcs .9 bcs .9
jsr CSH.tDecl
bcs .9
bra .8 bra .8
.9 lda #E.CSYN .9 lda #E.CSYN
sec sec
.8 >LEAVE .8 >LEAVE
rts rts
*-------------------------------------- *--------------------------------------
CSH.fDeclAddA sta (ZPCSHfDecl)
inc ZPCSHfDecl
bne .8
inc ZPCSHfDecl+1
.8 rts
*--------------------------------------
CSH.tDecl jsr CSH.tDecl.JMP
bcs .9
.9 rts
CSH.tDecl.JMP jmp (J.CSH.TMODS,x)
*--------------------------------------
CSH.NewKey >PUSHA CSH.NewKey >PUSHA
>PUSHW ZPInputBufPtr >PUSHW ZPInputBufPtr
>SYSCALL SListNewKey >SYSCALL SListNewKey
@ -771,14 +867,19 @@ CSH.GetChar lda (ZPInputBufPtr)
sec sec
rts rts
*--------------------------------------- *---------------------------------------
CSH.IsEndArg
*---------------------------------------
CSH.IsOPChar ldx #CSH.OPChars.Cnt-1 CSH.IsOPChar ldx #CSH.OPChars.Cnt-1
.1 cmp CSH.OPChars,x .1 cmp CSH.OPChars,x
beq .8 beq .8
dex dex
bpl .1 bpl .1
sec sec
rts rts
.8 clc .8 clc
rts rts
*--------------------------------------- *---------------------------------------
@ -788,16 +889,21 @@ CSH.IsLetterOrDigit
*--------------------------------------- *---------------------------------------
CSH.IsLetter cmp #'_' CSH.IsLetter cmp #'_'
bne .1 bne .1
clc clc
rts rts
.1 cmp #'A' .1 cmp #'A'
bcc .9 bcc .9
cmp #'Z'+1 cmp #'Z'+1
bcc CSH.IsLetterRTS bcc CSH.IsLetterRTS
cmp #'a' cmp #'a'
bcc .9 bcc .9
cmp #'z'+1 cmp #'z'+1
rts CC if lowercase rts CC if lowercase
.9 sec .9 sec

View File

@ -35,15 +35,18 @@ CSH.ExpEval ldx ZPPtr1
jsr CSH.ExpEval jsr CSH.ExpEval
bcs .19 bcs .19
stx ZPPtr2 stx ZPPtr2
jsr CSH.GetCharNB jsr CSH.GetCharNB
bcs .19 bcs .19
cmp #')' cmp #')'
bne .19 bne .19
jsr CSH.GetNextCharNB skip ) jsr CSH.GetNextCharNB skip )
bcc .31 bcc .31
.19 jmp .90 .19 jmp .90
*-------------------------------------- *--------------------------------------
.20 jsr CSH.IsLetter define, Fnc or Var ? .20 jsr CSH.IsLetter define, Fnc or Var ?
@ -81,25 +84,27 @@ CSH.ExpEval ldx ZPPtr1
.23 jsr CSH.GetNumOnStack .23 jsr CSH.GetNumOnStack
bcs .29 bcs .29
bra .30 bra .30
.24 cmp #'"' String literal .24 cmp #'"' String literal
bne .90 bne .90
jsr CSH.AddContCharP jsr CSH.AddContCharP
.29 bcs .99 .29 bcs .99
*-------------------------------------- *--------------------------------------
.30 jsr CSH.GetCharNB .30 jsr CSH.GetCharNB
bcs .90 bcs .90
.31 cmp #',' .31 cmp #';'
beq .80
cmp #','
beq .80 beq .80
cmp #')' cmp #')'
beq .80 beq .80
cmp #';'
beq .80
jsr CSH.IsOPChar jsr CSH.IsOPChar
bcs .90 bcs .90
@ -163,10 +168,13 @@ CSH.AddContCharP
.1 jsr CSH.GetNextChar .1 jsr CSH.GetNextChar
bcs .9 bcs .9
cmp #C.CR cmp #C.CR
beq .9 beq .9
cmp #'"' cmp #'"'
beq .2 beq .2
sta (ZPCSHConst),y sta (ZPCSHConst),y
iny iny
bra .1 bra .1

View File

@ -116,21 +116,14 @@ CSH.STRUCT >ENTER 4
.99 >LEAVE .99 >LEAVE
rts rts
*-------------------------------------- *--------------------------------------
CSH.CONST lda ZPVarQual CSH.CONST lda #CSH.Q.CONST
bit #CSH.Q.PPPOINTER
bne .1
lda #CSH.Q.CONST
bra .2
.1 lda #CSH.Q.PCONST
.2 bit ZPVarQual
bne .9
tsb ZPVarQual tsb ZPVarQual
clc >LDYA L.CSH.TMODS2
rts jsr CSH.LookupID
bcs .9
jmp (J.CSH.TMODS2-2,x)
.9 lda #E.CSYN .9 lda #E.CSYN
sec sec
@ -224,59 +217,21 @@ CSH.TYPE stx ZPVarType
bra .9 more than *** bra .9 more than ***
.10 jsr CSH.IsLetter .10 jsr CSH.IsLetter
bcs .9 bcs .8
>LDYA L.CSH.FTYPES >LDYA L.CSH.FTYPES
jsr CSH.LookupID jsr CSH.LookupID
bcs .12 bcs .8 next char is an identifier
sec sec
ror bFastCall ror bFastCall
lda #CSH.Q.FUNC
tsb ZPVarQual
jsr CSH.GetNextCharNB jsr CSH.GetNextCharNB
bcs .9 bcs .9 next char is an identifier, ",", "(",")"
jsr CSH.AddSymbol
bcs .99
jsr CSH.GetCharNB
bcs .9
bra .13
.12 jsr CSH.AddSymbol add with undef value...
bcs .99 OOM or DUP
jsr CSH.GetCharNB
bcs .9
cmp #';'
beq .8
cmp #'='
beq .2
.13 cmp #'('
bne .9
jmp CSH.fDeclaration
.2 jsr CSH.GetNextCharNB Skip =
bcs .9
lda ZPVarType
jsr CSH.ExpEval
bcs .99
.7 jsr CSH.SetVarValueFromStack X= Type, Set value to this var
bcs .99
jsr CSH.GetChar
bcs .9
cmp #';'
bne .9
.8 clc .8 clc
rts rts

View File

@ -36,6 +36,7 @@ ZPCSHCode .BS 2
ZPCSHConst .BS 2 ZPCSHConst .BS 2
ZPCSHData .BS 2 ZPCSHData .BS 2
ZPCSHStack .BS 2 ZPCSHStack .BS 2
ZPCSHfDecl .BS 2
ZPVarID .BS 2 ZPVarID .BS 2
ZPVarDef .EQ * ZPVarDef .EQ *
@ -127,7 +128,8 @@ J.CSH.cBOPS .DA CSH.BOPS.cMUL
L.CSH.FN .DA CSH.FN L.CSH.FN .DA CSH.FN
L.CSH.DIRS .DA CSH.DIRS L.CSH.DIRS .DA CSH.DIRS
L.CSH.KW .DA CSH.KW L.CSH.KW .DA CSH.KW
L.CSH.MTYPES .DA CSH.MTYPES L.CSH.TMODS .DA CSH.TMODS
L.CSH.TMODS2 .DA CSH.TMODS2
L.CSH.TYPES .DA CSH.TYPES L.CSH.TYPES .DA CSH.TYPES
L.CSH.FTYPES .DA CSH.FTYPES L.CSH.FTYPES .DA CSH.FTYPES
J.CSH.DIRS .DA CSH.DIR.DEFINE J.CSH.DIRS .DA CSH.DIR.DEFINE
@ -146,8 +148,8 @@ J.CSH.KW .DA CSH.IF
.DA CSH.TYPEDEF .DA CSH.TYPEDEF
.DA CSH.STRUCT .DA CSH.STRUCT
*-------------------------------------- *--------------------------------------
J.CSH.MTYPES .DA CSH.CONST J.CSH.TMODS .DA CSH.CONST
.DA CSH.SIGNED J.CSH.TMODS2 .DA CSH.SIGNED
.DA CSH.UNSIGNED .DA CSH.UNSIGNED
.DA CSH.SHORT .DA CSH.SHORT
J.CSH.TYPES .DA CSH.VOID J.CSH.TYPES .DA CSH.VOID
@ -534,8 +536,12 @@ CSH.KW >PSTR "if"
>PSTR "sizeof" >PSTR "sizeof"
>PSTR "typedef" >PSTR "typedef"
>PSTR "struct" >PSTR "struct"
CSH.MTYPES >PSTR "const" ALL .HS 00
>PSTR "signed" char,int,long *--------------------------------------
* Type Declaration
*--------------------------------------
CSH.TMODS >PSTR "const" ALL
CSH.TMODS2 >PSTR "signed" char,int,long
>PSTR "unsigned" char,int,long >PSTR "unsigned" char,int,long
>PSTR "short" int >PSTR "short" int
CSH.TYPES >PSTR "void" CSH.TYPES >PSTR "void"
@ -700,6 +706,9 @@ CSH.DataPtr .BS 2
CSH.hStack .BS 1 CSH.hStack .BS 1
CSH.StackPtr .BS 1 CSH.StackPtr .BS 1
CSH.hfDecl .BS 1
CSH.fDeclBuf .BS 2
CSH.SaveInclude .BS 2 CSH.SaveInclude .BS 2
CSH.SaveDefine .BS 2 CSH.SaveDefine .BS 2

View File

@ -534,14 +534,111 @@ CIFS2.ChOwn
sec sec
rts rts
*-------------------------------------- *--------------------------------------
CIFS.FOpen CIFS.FOpen jsr MakeTrans2Reg
ldx #0
CIFS2.FOpen .1 lda SMB.Open2,x
sta (ZPReqPtr),y
iny
inx
cpx #SMB.Open2.Len
bne .1
lda #MLI.E.BADCALL phy
ldy #5
lda (pStack),y
sta pPath+1
dey
lda (pStack),y
sta pPath
dey flags
lda (pStack),y
pha
and #O.RDWR
dec
ldy #S.NETBIOS+S.SMB.H+SMB.Trans2.H.Len+9 AccessMode
sta (ZPReqPtr),y
ldy #S.NETBIOS+S.SMB.H+SMB.Trans2.H.Len+19 OpenMode
pla
pha
and #O.CREATE
beq .2
lda #$10
sta (ZPReqPtr),y
.2 pla
and #O.APPEND
beq .3
lda (ZPReqPtr),y
ora #1
sta (ZPReqPtr),y
.3 ply
jsr AppendPath
lda #0
sta (ZPReqPtr),y
iny
jsr SetT2ReqLenYA
pha
>PUSHB MountTable+3 hSocket
>PUSHW ZPReqPtr
pla
>PUSHYA
ldx #LIBTCPIP.Send
jsr GO.LIBTCPIP
bcs .9
jmp Sleep
.9 >RET 6
*--------------------------------------
CIFS2.FOpen jsr ReadSocket
bcs .9
jsr GetRespData
ldy #S.NETBIOS+S.SMB.H.STATUS
lda (ZPRespPtr),y
clc
beq .8
lda #MLI.E.DUPFILE
sec
.8 jsr FreeRespData
stz CIFS.Status
>RET 4
.9 cmp #E.NODATA
bne .99
dec CIFS.Retries
beq .98
lda #0
sec sec
rts rts
.98 lda #MLI.E.IO
.99 sec
stz CIFS.Status
>RET 4
*-------------------------------------- *--------------------------------------
CIFS.FClose CIFS.FClose
CIFS2.FClose CIFS2.FClose

View File

@ -20,13 +20,18 @@ ZPReqPtr .BS 2
ZPReqLen .BS 2 ZPReqLen .BS 2
ZPCtxPtr .BS 2 ZPCtxPtr .BS 2
pFD .BS 2 pFD .BS 2
pPath .BS 2
ZPPtr1 .BS 2 ZPPtr1 .BS 2
ZPPtr2 .BS 2 ZPPtr2 .BS 2
BufPtr .BS 2 BufPtr .BS 2
hBuf .BS 1 hBuf .BS 1
hResp .BS 1 hResp .BS 1
pPath .BS 2
flags .BS 1
ftype .BS 1
auxtype .BS 2
ZPRespPtr .BS 2 ZPRespPtr .BS 2
bFlag .BS 1 bFlag .BS 1
@ -1032,7 +1037,7 @@ SMB.Open2 .DA 0 TRANS2_OPEN2
.BS 2 PrmCnt .BS 2 PrmCnt
.HS 000000 Padding .HS 000000 Padding
.HS 0000 Flags .HS 0000 Flags
.BS 2 Access Mode .BS 2 AccessMode
.HS 0000 Reserved1 .HS 0000 Reserved1
.BS 2 FileAttributes .BS 2 FileAttributes
.HS 00000000 CreationTime .HS 00000000 CreationTime

View File

@ -11,7 +11,7 @@ LOWERCASE .EQ 1
ACL .EQ 1 ACL .EQ 1
LOGO .EQ 1 LOGO .EQ 1
*-------------------------------------- *--------------------------------------
XRWDBG .EQ 1 XRWDBG .EQ 0
*-------------------------------------- *--------------------------------------
.INB inc/zp.i .INB inc/zp.i
.INB inc/io.i .INB inc/io.i

View File

@ -54,7 +54,9 @@ L.CMDS .DA BINSH
.DA BINSHUTDOWN .DA BINSHUTDOWN
.DA 0 .DA 0
*-------------------------------------- *--------------------------------------
CS.INIT clc CS.INIT
*--------------------------------------
CS.QUIT clc
rts rts
*-------------------------------------- *--------------------------------------
CS.RUN ldy #S.PS.PID CS.RUN ldy #S.PS.PID
@ -208,9 +210,6 @@ CS.RUN.ERRMSG tax
CS.DOEVENT sec CS.DOEVENT sec
rts rts
*-------------------------------------- *--------------------------------------
CS.QUIT clc
rts
*--------------------------------------
CS.END CS.END
*-------------------------------------- *--------------------------------------
MSG.CTRLR .AZ "INITD:Entering ROOT mode..." MSG.CTRLR .AZ "INITD:Entering ROOT mode..."
@ -224,12 +223,6 @@ BINMEM .AZ "${ROOT}bin/mem"
BINPS .AZ "${ROOT}bin/ps" BINPS .AZ "${ROOT}bin/ps"
BINLSOF .AZ "${ROOT}bin/lsof" BINLSOF .AZ "${ROOT}bin/lsof"
BINSHUTDOWN .AZ "${ROOT}bin/shutdown" BINSHUTDOWN .AZ "${ROOT}bin/shutdown"
*--------------------------------------
MLI.PARAMS .DA #4
.DA #0
.DA 0
.DA #0
.DA 0
*-------------------------------------- *--------------------------------------
.DUMMY .DUMMY
.OR 0 .OR 0

View File

@ -4,52 +4,70 @@ NEW
*-------------------------------------- *--------------------------------------
PrintFYA sty PrintFYA.Next+1 PrintFYA sty PrintFYA.Next+1
sta PrintFYA.Next+2 sta PrintFYA.Next+2
pla pla
sta PrintFYA.99+1 sta PrintFYA.99+1
pla pla
sta PrintFYA.98+1 sta PrintFYA.98+1
lda $C011 RDLCBNK2 lda $C011 RDLCBNK2
sta PrintFYA.91+1 sta PrintFYA.91+1
lda $C012 RDLCRAM lda $C012 RDLCRAM
sta PrintFYA.90+1 sta PrintFYA.90+1
lda $C08A RROMBNK1, make sure $D000-$FFFF ROM selected lda $C08A RROMBNK1, make sure $D000-$FFFF ROM selected
lda $CFFF get access to $C800-$CFFF internal ROM lda $CFFF get access to $C800-$CFFF internal ROM
PrintFYA.1 stz X.b0Flag PrintFYA.1 stz X.b0Flag
stz X.DigitCount stz X.DigitCount
jsr PrintFYA.Next jsr PrintFYA.Next
beq PrintFYA.90 beq PrintFYA.90
cmp #'%' cmp #'%'
bne .7 bne .7
.2 jsr PrintFYA.Next .2 jsr PrintFYA.Next
beq PrintFYA.90 beq PrintFYA.90
cmp #'0' cmp #'0'
bne .3 bne .3
ror X.b0Flag beq -> CS ror X.b0Flag beq -> CS
bra .2 bra .2
.3 bcc .4 .3 bcc .4
cmp #'9'+1 cmp #'9'+1
bcs .4 bcs .4
and #$0f and #$0f
sta X.DigitCount sta X.DigitCount
bra .2 bra .2
.4 ldx #PrintFYA.Tbl-PrintFYA.Esc-1 .4 ldx #PrintFYA.Tbl-PrintFYA.Esc-1
.5 cmp PrintFYA.Esc,x .5 cmp PrintFYA.Esc,x
beq .6 beq .6
dex dex
bpl .5 bpl .5
bra PrintFYA.1 bra PrintFYA.1
.6 txa .6 txa
asl asl
tax tax
jmp (PrintFYA.Tbl,x) jmp (PrintFYA.Tbl,x)
.7 cmp #'\' .7 cmp #'\'
bne .8 bne .8
jsr PrintFYA.Next jsr PrintFYA.Next
beq PrintFYA.90 beq PrintFYA.90
cmp #'n' cmp #'n'
bne .8 bne .8
lda #$0D lda #$0D
.8 ora #$80 .8 ora #$80
jsr $FDED COUT jsr $FDED COUT
bra PrintFYA.1 bra PrintFYA.1
@ -73,9 +91,12 @@ PrintFYA.99 lda #$ff Self modified RTS LOPrintFYAPrintFYA
*-------------------------------------- *--------------------------------------
PrintFYA.Next lda $ffff PrintFYA.Next lda $ffff
beq .8 beq .8
inc PrintFYA.Next+1 inc PrintFYA.Next+1
bne .8 bne .8
inc PrintFYA.Next+2 Always !=0 inc PrintFYA.Next+2 Always !=0
.8 rts .8 rts
*-------------------------------------- *--------------------------------------
PrintFYA.Esc .AS "dDhHS" PrintFYA.Esc .AS "dDhHS"
@ -96,11 +117,14 @@ PrintFYA.DD plx
stz X.BCDBuffer+2 stz X.BCDBuffer+2
ldx #16 let's roll 16 bits ldx #16 let's roll 16 bits
sed sed
.2 asl X.HexBuffer .2 asl X.HexBuffer
rol X.HexBuffer+1 rol X.HexBuffer+1
php cpy will disturb carry while BCD adc php cpy will disturb carry while BCD adc
ldy #0 ldy #0
.3 plp .3 plp
lda X.BCDBuffer,y lda X.BCDBuffer,y
adc X.BCDBuffer,y adc X.BCDBuffer,y
sta X.BCDBuffer,y sta X.BCDBuffer,y
@ -108,12 +132,15 @@ PrintFYA.DD plx
iny iny
cpy #3 Last byte of X.BCDBufferBUF? cpy #3 Last byte of X.BCDBufferBUF?
bne .3 bne .3
plp plp
dex dex
bne .2 bne .2
cld cld
ldx #0 ldx #0
ldy #5 ldy #5
.4 lda X.BCDBuffer,x .4 lda X.BCDBuffer,x
pha pha
and #$0F and #$0F
@ -131,12 +158,16 @@ PrintFYA.DD plx
inx inx
dey dey
bpl .4 bpl .4
lda X.DigitCount lda X.DigitCount
beq .5 beq .5
lda #6 lda #6
sec sec
sbc X.DigitCount sbc X.DigitCount
.5 tay .5 tay
.6 lda X.DigitBuffer,y .6 lda X.DigitBuffer,y
cmp #"0" cmp #"0"
beq .7 beq .7
@ -144,18 +175,24 @@ PrintFYA.DD plx
sec sec
ror X.b0Flag ror X.b0Flag
bra .8 bra .8
.7 cpy #5 .7 cpy #5
beq .8 beq .8
lda #" " lda #" "
bit X.b0Flag bit X.b0Flag
bpl .81 bpl .81
lda #"0" lda #"0"
.8 phy .8 phy
jsr $FDED COUT jsr $FDED COUT
ply ply
.81 iny .81 iny
cpy #6 cpy #6
bne .6 bne .6
.9 jmp PrintFYA.1 .9 jmp PrintFYA.1
*-------------------------------------- *--------------------------------------
PrintFYA.HH pla PrintFYA.HH pla
@ -170,16 +207,20 @@ PrintFYA.S pla
pla pla
sta .1+1 sta .1+1
sta .2+1 sta .2+1
.1 lda $ffff .1 lda $ffff
beq .9 beq .9
tax tax
ldy #1 ldy #1
.2 lda $ffff,y .2 lda $ffff,y
ora #$80 ora #$80
jsr $FDED COUT jsr $FDED COUT
iny iny
dex dex
bne .2 bne .2
.9 jmp PrintFYA.1 .9 jmp PrintFYA.1
*-------------------------------------- *--------------------------------------
X.HexBuffer .BS 2 X.HexBuffer .BS 2