mirror of
https://github.com/A2osX/A2osX.git
synced 2024-12-26 11:30:07 +00:00
Kernel 0.94+
This commit is contained in:
parent
632a6693f2
commit
24ff6f27c0
@ -20,14 +20,14 @@ This document lists all of the **ACOS Words** supported in the A2osX implementat
|
||||
| DATE$ | *string*=DATE$ | dev | The <tt>DATE$</tt> function returns the current date in MM/DD/YY format. The input will be taken from whatever device was configured as a clock. If 00/00/00 is returned, then there is no clock in the system and the date hasn't been set. |
|
||||
| ECHO | ECHO=*string*<br>ECHO="" | dev | The <tt>ECHO</tt> statement is used to set the echo character to be used with the <tt>INPUT</tt> statement (e.g <code>ECHO="\*"</code> will mask password entry with asterisks). Once the echo has been set, that character will be sent each time a user types a character when entering text. The <tt>ECHO</tt> statement in the second syntax (setting to an empty string) will reset the echo function to normal where user input will send the character that is being typed. |
|
||||
| EDIT | EDIT(*number*) | dev | The <tt>EDIT</tt> statement is the command used to interface ACOS with its editor. With the different <tt>EDIT</tt> statements, you can clear the editor, see how much space is free, etc. The following list gives all legal calls:<p><ul><li><tt>EDIT(0)</tt>- clears the editor. there will be a total of 4096 bytes free after a clear takes place.<br><li><tt>EDIT(1)</tt>- enter the editor. If no data is present, the editor will start to accept input right away. If other data is present, the editor will start in the prompt mode.<br><li><tt>EDIT(2)</tt>- this is a function that returns the number of bytes used within the editor. If this number equals 0 the editor is empty.<br><li><tt>EDIT(3)</tt>- this is used to set the video width to be used within the editor. Any value from 1 to 255 is legal. the most often used widths are 32, 40, 64, 80, 128. All operations within the editor will be based around this width. You can also read the current width using <tt>EDIT(3)</tt> as a function.<br><li><tt>EDIT(4)</tt>- this is used to set the 'back-space mode' that the editor will use. Certain modes allow more control than others. Mode 0 indicates that the actual mode is not known. The editor will work fine, but some functions will be disabled. Under mode 1, the editor will assume that the user has a 'non-destructible' backspace. This allows all the editor functions to be used and is how the local console is setup. Mode 2 tells the editor that the user has a 'destructible' backspace. Under this mode, some functions are disabled, but the editor speeds up certain other functions. |
|
||||
| END | END | dev | Same as AppleSoft, this command terminates program. Returns to ACOS restart state. REMY TODO: Does this just return to A2osX shell? |
|
||||
| END | END | impl | Same as AppleSoft, this command terminates program. Returns to ACOS restart state. REMY TODO: Does this just return to A2osX shell? |
|
||||
| FILL | FILL *start*, *length*, *data* | dev | The <tt>FILL</tt> statement is used to fill an area of memory with some bytes of data. Generally it is used to zero out memory. *start* is a 16 bit memory address, *length* is an 8 bit [0-255] number, and *data* is the byte that will be used to fill memory. |
|
||||
| FLAG | *variable*=FLAG<br>FLAG=*memloc*<br>FLAG=(*flagnum*)<br>FLAG(*flagnum*)=*value* | dev | The <tt>FLAG</tt> function is a low overhead way to store 1 bit information. You just need to point the <tt>FLAG</tt> function to a point in memory (typically 'ram' or 'ram2') that you wish to store your data in, and you can manipulate as many flags as you need. Each byte of memory can contain 8 flags.<p>To setup the <tt>FLAG</tt> function, you need to first point it to a location in memory (*memloc*), which is typically 'ram' or 'ram2', but you can specify an offset, e.g. <code>FLAG=ram+20</code> will specify that you're using the 20th byte inside of the 'ram' location.<p>Once the pointer is set up, you can use the <tt>FLAG</tt> function just like any variable using the remaining syntax forms outlined for reading/writing flags. |
|
||||
| FOR | FOR *numvar*=*startvalue* TO *targetvalue* [STEP *number*]<br>...<br>NEXT | dev | Creates a loop in program execution that sets a variable *numvar* to initially *startvalue* and increments its value with each iteration and will repeat until that variable reaches *targetvalue*. The <tt>STEP</tt> keyword is optional, but allows you to specify *number* which overrides the typical +1 increment of the loop, i.e. you can count by 2 by specifying <code>STEP 2</code> or you can *decrement* by specifying a negative step number. In general, operates much the same way as AppleSoft FOR-NEXT loops, However, you can only have ONE for loop active at a time, i.e. the <tt>NEXT</tt> command does not allow for a variable, it only operates on the currently active FOR loop. |
|
||||
| FREE | FREE | dev | Has the same function as the AppleSoft <tt>FRE(0)</tt> command, in that it returns the amount of free memory. REMY TODO: Does this garbage collect? |
|
||||
| GET | GET *varstr* | dev | The <tt>GET</tt> statement is used to get a single keypress from the user. This is a blocking call in that the system will wait until a key is pressed. The key will be returned in *varstr*. Control characters will not be filtered out as they are with <tt>INPUT.</tt> |
|
||||
| GOSUB | GOSUB *label* | dev | Calls subroutine *label* in the program and sets the point in code so that when a <tt>RETURN</tt> function is encountered, execution will resume after the <code>GOSUB</code> statement. While behaves the same way as AppleSoft basic, it is worth pointing out that ACOS uses labels as targets instead of line numbers. |
|
||||
| GOTO | GOTO *label* | Working | Redirects program execution to continue from *label*. Unlike <tt>GOSUB</tt>, no record of where the <tt>GOTO</tt> call occurred. As with <tt>GOSUB</tt>, it is worth pointing out that ACOS uses labels as targets intead of line number. |
|
||||
| GOSUB | GOSUB *label* | impl | Calls subroutine *label* in the program and sets the point in code so that when a <tt>RETURN</tt> function is encountered, execution will resume after the <code>GOSUB</code> statement. While behaves the same way as AppleSoft basic, it is worth pointing out that ACOS uses labels as targets instead of line numbers. |
|
||||
| GOTO | GOTO *label* | impl | Redirects program execution to continue from *label*. Unlike <tt>GOSUB</tt>, no record of where the <tt>GOTO</tt> call occurred. As with <tt>GOSUB</tt>, it is worth pointing out that ACOS uses labels as targets intead of line number. |
|
||||
| HOME | HOME | dev | Clears the screen and positions the cursor at the top left. REMY TODO: Does this clear the remote session as well? |
|
||||
| IF | IF *condition* [THEN] *statement1* [ELSE] *statement2* | dev | Evaluate *condition* and if true (or greater than zero), execute *statement1*. If optional <tt>ELSE</tt> keyword is specified, then a false condition will execute *statement2*. If <tt>ELSE</tt> is used, it must appear on the same line as the <tt>IF</tt> statement, i.e. there is no multi-line if/then/else construct like some other languages. Logical constructs for *condition* supports parenthesis, <tt>AND</tt>, and <tt>OR</tt>.<p><tt>THEN</tt> is optional (as it is in AppleSoft BASIC) but if you use THEN, it cannot be followed by a label directly.(use IF arg THEN GOTO label). |
|
||||
| INFO | *expression*=INFO(*optional*)<br>INFO(*optional*)=*expression* | dev | INFO can be used as either a statement or as a function. It is really a 'catch-all' of ACOS state value functions in nature in that many values that are more or less unrelated are accessible through it. The following table gives the meanings of all the INFO data.<p><pre>argument r/w function<br>-------- ---- -----------------<br>INFO(0) r is there a caller online? (0=no)<br>INFO(1) r capacity of current message file.<br>INFO(2) r callers baud rate /300 (1=300)<br>INFO(3) r/w current number of nulls.<br>INFO(4) w top screen stats. (1=chat, 2=exec)<br>INFO(5) r/w executive user online? (1=yes)<br>INFO(6) r checks bit map for mail/msg bases for room.</pre> |
|
||||
@ -54,7 +54,7 @@ This document lists all of the **ACOS Words** supported in the A2osX implementat
|
||||
| POKE | POKE *address*, *value* | dev | Sets the value of the memory location specified at *address* with *value*. REMY TODO: Does this work in A2osX? Perhaps limit it to $C000-CFFF? |
|
||||
| POP | POP | dev | Removes the last execution address from the stack, i.e. if a <tt>PUSH</tt> or <tt>GOSUB</tt> was called which put an execution address on the stack, the <tt>POP</tt> command can be used to remove it (and render that <tt>PUSH</tt> or <tt>GOSUB</tt> 'forgotten'). Works the same as the AppleSoft <tt>POP</tt> statement with the exception of it also can be used with the ACOS <tt>PUSH</tt> command. |
|
||||
| POSITION | POSITION #*device,* *record_length,* *record_number* [,*offset*] | dev | The <tt>POSITION</tt> statement is used to position within a random access file. The *device* argument is the disk device channel number that was used to open the file. The *record_length* argument is the length of each record. The *record_number* argument is the record number to be positioned to. The optional *offset* argument is the offset within the record that is to be positioned to. Note that there is no check to see if files actually conform to *record_length*; it along with the other *record_number* and *offset* arguments simply form a means of providing a calculation for a byte offset in the file as a while. For example, <code>POSITION #1, 1000, 3, 50</code> would result in seeking file device #1 to the 3050'th byte in the file. |
|
||||
| PRINT | PRINT [#*device*,] [*expression*] [,*expression*] [;] | dev | Sends/displays text or data to the screen, remote user, or specified device handler. There are a few rules for <tt>PRINT</tt>:<p><ul><li>control: '<tt>,</tt>' - the comma is used to separate expressions within the print statement and will be printed literally, i.e. this is for creating comma-separated file output.<li>control: '<tt>;</tt>' - the semi-colon is also used to separate expressions it will not be printed when encountered, if a semi-colon is the last character in the line, then the carriage return will be suppressed.<li>control: '<tt>\\</tt>' - the backslash is used to generate a newline character. Using the backslash, there is no need to put a bunch of <code>print:print...</code> statements.<li>exprs: TEXT - text must be contained within quotes and will be printed exactly as typed. Within quotes, you may have any special characters including return. Note that you MUST close quotes on the same line - multi-line quotes are not allowed.<li>exprs: STRING- the contents of the listed string will be printed.<li>exprs: NUMBER- the content of the listed number will be printed.</ul> |
|
||||
| PRINT | PRINT [#*device*,] [*expression*] [,*expression*] [;] | impl | Sends/displays text or data to the screen, remote user, or specified device handler. There are a few rules for <tt>PRINT</tt>:<p><ul><li>control: '<tt>,</tt>' - the comma is used to separate expressions within the print statement and will be printed literally, i.e. this is for creating comma-separated file output.<li>control: '<tt>;</tt>' - the semi-colon is also used to separate expressions it will not be printed when encountered, if a semi-colon is the last character in the line, then the carriage return will be suppressed.<li>control: '<tt>\\</tt>' - the backslash is used to generate a newline character. Using the backslash, there is no need to put a bunch of <code>print:print...</code> statements.<li>exprs: TEXT - text must be contained within quotes and will be printed exactly as typed. Within quotes, you may have any special characters including return. Note that you MUST close quotes on the same line - multi-line quotes are not allowed.<li>exprs: STRING- the contents of the listed string will be printed.<li>exprs: NUMBER- the content of the listed number will be printed.</ul> |
|
||||
| PUBLIC | PUBLIC *label* | dev | The <tt>PUBLIC</tt> statement is used to make a label within a program module available to other modules to <tt>LINK</tt> to. If you wish to link to another program module, and start execution at a point other than the beginning of the module, you will need to make that point public. You can have a maximum of 8 public labels within a program module. |
|
||||
| PUSH | PUSH *label* | dev | The <tt>PUSH</tt> statement is a subset of the <tt>GOSUB</tt> statement. It does not actually change the current point of execution, but places a return address on the stack so that the next time a <tt>RETURN</tt> statement is encountered, control will return to this present point. A <tt>POP</tt> statement will remove the last address added to the return table. |
|
||||
| RAM | RAM | dev | The <tt>RAM</tt> function is really just a constant pointer. It just points to a free 64 bytes of memory that has been set aside for program use. |
|
||||
@ -62,7 +62,7 @@ This document lists all of the **ACOS Words** supported in the A2osX implementat
|
||||
| RANDOM | *expression*=RANDOM(*number*) | dev | The <tt>RANDOM</tt> function is used to generate a random number within the range 0-*number*. It is important to note that the random number generator only runs when the system goes to get input. In other words, if you take two random numbers in a row without some kind of user input in the middle, the random numbers will always be the same. If you need more than one, use the <tt>RND$</tt> string between. The <tt>RND$</tt> string will cause the random number generator to re-random. REMY TODO: Is there an A2osX random number service that would be used instead? |
|
||||
| READ | READ #*device*, *memloc*, *number* | dev | The <tt>READ</tt> statement is used to load data from a file into memory in its binary form without any processing or changing. The input does not have to come from a file, it can come from the editor or a message file. It is similar to an Apple DOS BLOAD command. BJB TODO: Need to improve this to describe memloc, number. |
|
||||
| READY | READY *filename*<br>READY #MSG(*number*) | dev | The <tt>READY</tt> statement is used to make a message file ready for use. It is similar to an <tt>OPEN</tt> statement being used before a file is accessed. After a message file is ready, all the following references to <tt>MSG</tt> will be directed to that file. Once a message file has been made ready, it can also be used in its second syntax to ready a specific message within the file. This is generally used if further references to the file will use the device channel associated with the message base. |
|
||||
| RETURN | RETURN | dev | Return from a subroutine. More specifically, it retrieves the last execution point off the stack and continues program execution from that point. Used in conjunction with <tt>GOSUB</tt> and <tt>PUSH</tt> statements. |
|
||||
| RETURN | RETURN | impl | Return from a subroutine. More specifically, it retrieves the last execution point off the stack and continues program execution from that point. Used in conjunction with <tt>GOSUB</tt> and <tt>PUSH</tt> statements. |
|
||||
| REWIND | REWIND | dev | The <tt>REWIND</tt> statement is to change the pointer within a message file to some previously accessed point within the file. Normally this is used in conjunction with the <code>READY MSG(x):COPY #7</code> statements. Using <tt>REWIND</tt> will put the internal pointer back to where it was before the last message operation took place. This is generally used for doing a 're-read' function of sorts. |
|
||||
| RIGHT$ | *string*=RIGHT$(*source*, *length*) | dev | Returns the last *length* number of characters from the *source*. |
|
||||
| RND$ | *char*=RND$ | dev | The <tt>RND$</tt> function is used to generate random characters. Each time <tt>RND$</tt> is accessed a new random character will be returned. Be warned: the random number is generated from timing how long a user takes to enter his input. This is really a pretty random number since it is based on the users typing skill and speed. The only problem is that the random character generator can start repeating patterns after about 15-20 characters have been generated and before another input has taken place. REMY TODO: Is this how your implementation works or are you using an A2osX random generator? |
|
||||
|
@ -41,7 +41,7 @@ This document lists all of the **Forth Words** supported in the A2osX implementa
|
||||
| 0< | ( n - f ) | Working | True if top number negative |
|
||||
| 0= | ( n - f ) | Working | True if top number zero |
|
||||
| . | ( n - ) | Working | Print number |
|
||||
| U. | ( u - ) | Working | Print UNSINGED number |
|
||||
| U. | ( u - ) | Working | Print UNSIGNED number |
|
||||
| .R | ( n u - ) | | Print number, right-justified in u column |
|
||||
| D. | ( d - ) | | Print double-precision number |
|
||||
| D.R | ( d u - ) | | Print double-precision number in u column |
|
||||
@ -67,7 +67,8 @@ This document lists all of the **Forth Words** supported in the A2osX implementa
|
||||
| DECIMAL | ( - ) | | Set decimal base |
|
||||
| HEX | ( - ) | | Set hexadecimal base |
|
||||
| OCTAL | ( - ) | | Set octal base |
|
||||
| @ | ( addr - n ) |Working | Replace word address by contents |
|
||||
| SP@ | ( - addr ) | Working | Return the address of the top of the stack, just before SP@ was executed |
|
||||
| @ | ( addr - n ) | Working | Replace word address by contents |
|
||||
| ! | ( n addr - ) | Working | Store second word at address on top |
|
||||
| C@ | ( addr - b ) | Working | Fetch one byte only |
|
||||
| C! | ( b addr - ) | Working | Store one byte only |
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -35,6 +35,17 @@ CORE.Init >LDYAI CODESEG
|
||||
bcs .9
|
||||
|
||||
>STA.G hVars
|
||||
|
||||
>LDYAI FWREF
|
||||
>SYSCALL GetMem
|
||||
bcs .9
|
||||
|
||||
>STYA ZPFWRefBufPtr
|
||||
txa
|
||||
>STA.G hFWRefBuf
|
||||
|
||||
lda #0
|
||||
sta (ZPFWRefBufPtr)
|
||||
|
||||
clc
|
||||
.9 rts
|
||||
@ -142,7 +153,42 @@ CORE.Compile jsr CORE.GetChar
|
||||
sec
|
||||
.99 rts
|
||||
*--------------------------------------
|
||||
CORE.Run lda #$60 RTS
|
||||
CORE.FWREF >LDA.G hFWRefBuf
|
||||
>SYSCALL GetMemPtr
|
||||
>STYA ZPInputBufPtr
|
||||
>DEBUG
|
||||
.1 lda (ZPInputBufPtr)
|
||||
beq .8
|
||||
|
||||
sta ZPPtr1+1
|
||||
|
||||
jsr CORE.GetNextChar
|
||||
sta ZPPtr1
|
||||
|
||||
jsr CORE.GetNextChar
|
||||
|
||||
jsr CORE.GetLabel
|
||||
bcs .9
|
||||
|
||||
lda ZPADDR
|
||||
sta (ZPPtr1)
|
||||
ldy #1
|
||||
lda ZPADDR+1
|
||||
sta (ZPPtr1),y
|
||||
|
||||
bra .1
|
||||
|
||||
.8 clc
|
||||
rts
|
||||
|
||||
.9 >PUSHW L.MSG.FWREFERR
|
||||
>PUSHW ZPInputBufPtr
|
||||
>PUSHBI 2
|
||||
>SYSCALL PrintF
|
||||
sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
CORE.Run lda #$0 RTS
|
||||
sta (ZPCodeBufPtr)
|
||||
|
||||
jsr CORE.Cleanup
|
||||
@ -170,7 +216,7 @@ CORE.Run lda #$60 RTS
|
||||
>PUSHW ZPPtr2
|
||||
>PUSHBI 2
|
||||
>SYSCALL PrintF
|
||||
* >DEBUG
|
||||
|
||||
jmp (ZPCodeBufPtr)
|
||||
*--------------------------------------
|
||||
CORE.Lookup >STYA ZPPtr1
|
||||
@ -241,6 +287,59 @@ CORE.CreateLabel
|
||||
>SYSCALL SListAddData
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
CORE.GetLabel >PUSHB.G hLabels
|
||||
>PUSHW ZPInputBufPtr
|
||||
>SYSCALL SListLookup
|
||||
bcs .9
|
||||
|
||||
>STYA ZPSID
|
||||
|
||||
txa
|
||||
jsr CORE.SkipA
|
||||
|
||||
>PUSHB.G hLabels
|
||||
>PUSHW ZPSID
|
||||
>PUSHWI ZPADDR
|
||||
>PUSHWI 2 2 bytes : ADDR
|
||||
>PUSHWZ From Start
|
||||
>SYSCALL SListGetData
|
||||
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
CORE.AddFWRef lda ZPCodeBufPtr+1
|
||||
|
||||
jsr CORE.2FWRefBuf
|
||||
|
||||
lda ZPCodeBufPtr
|
||||
jsr CORE.2FWRefBuf
|
||||
|
||||
ldy #$ff
|
||||
|
||||
.1 iny
|
||||
lda (ZPInputBufPtr),y
|
||||
beq .8
|
||||
|
||||
jsr CORE.IsIDValid
|
||||
bcs .8
|
||||
|
||||
jsr CORE.2FWRefBuf
|
||||
bra .1
|
||||
|
||||
.8 tya
|
||||
jsr CORE.SkipA
|
||||
|
||||
lda #0
|
||||
|
||||
clc
|
||||
*--------------------------------------
|
||||
CORE.2FWRefBuf sta (ZPFWRefBufPtr)
|
||||
inc ZPFWRefBufPtr
|
||||
bne .8
|
||||
|
||||
inc ZPFWRefBufPtr+1
|
||||
|
||||
.8 rts
|
||||
*--------------------------------------
|
||||
CORE.CreateOrGetVar
|
||||
>LDA.G hVars
|
||||
jsr CORE.GetAddr
|
||||
@ -250,6 +349,8 @@ CORE.CreateOrGetVar
|
||||
jsr CORE.NewKey
|
||||
bcs .9
|
||||
|
||||
stz ZPTYPE
|
||||
|
||||
jsr CORE.GetChar
|
||||
cmp #'$'
|
||||
bne .1
|
||||
@ -362,6 +463,10 @@ CORE.IsEndInst cmp #':' CS=TRUE
|
||||
|
||||
.8 rts
|
||||
*---------------------------------------
|
||||
CORE.IsIDValid cmp #'.'
|
||||
clc
|
||||
beq CORE.IsLetterRTS
|
||||
*---------------------------------------
|
||||
CORE.IsLetterOrDigit
|
||||
jsr CORE.IsDigit10
|
||||
bcc CORE.IsLetterRTS
|
||||
|
@ -12,7 +12,7 @@ KW.COPY
|
||||
KW.CREATE
|
||||
KW.ECHO
|
||||
KW.EDIT
|
||||
KW.END
|
||||
*KW.END
|
||||
KW.FILL
|
||||
KW.FLAG
|
||||
KW.FOR
|
||||
@ -22,38 +22,30 @@ KW.GET
|
||||
sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
KW.GOSUB sec
|
||||
.HS 90 CLC
|
||||
KW.GOSUB lda #$20 JSR abs
|
||||
bra KW.GOTO1
|
||||
*--------------------------------------
|
||||
KW.GOTO clc
|
||||
php
|
||||
|
||||
KW.GOTO lda #$4C JMP abs
|
||||
|
||||
KW.GOTO1 jsr CODE.EmitByte
|
||||
jsr CORE.GetNextCharNB
|
||||
bcs .90
|
||||
|
||||
>LDA.G hLabels
|
||||
jsr CORE.GetAddr
|
||||
bcs .99
|
||||
|
||||
plp
|
||||
|
||||
lda #$4C JMP abs
|
||||
jsr CORE.GetLabel
|
||||
bcc .1
|
||||
|
||||
lda #$20 JSR abs
|
||||
jsr CORE.AddFWRef
|
||||
bcs .99
|
||||
|
||||
.1 jsr CODE.EmitByte
|
||||
lda ZPADDR
|
||||
.1 lda ZPADDR
|
||||
jsr CODE.EmitByte
|
||||
lda ZPADDR+1
|
||||
|
||||
clc
|
||||
jmp CODE.EmitByte
|
||||
|
||||
.90 lda #E.CSYN
|
||||
.99 plp
|
||||
sec
|
||||
rts
|
||||
|
||||
.99 rts
|
||||
*--------------------------------------
|
||||
KW.HOME
|
||||
KW.IF
|
||||
@ -179,7 +171,10 @@ KW.READY
|
||||
sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
KW.RETURN lda #$60 RTS
|
||||
KW.RETURN
|
||||
* TODO : check context
|
||||
|
||||
KW.END lda #$60 RTS
|
||||
|
||||
clc
|
||||
jmp CODE.EmitByte
|
||||
|
@ -8,6 +8,7 @@ NEW
|
||||
CODESEG .EQ 4096
|
||||
CONSTSEG .EQ 1024
|
||||
DATASEG .EQ 256
|
||||
FWREF .EQ 1024
|
||||
EXP.DEPTH.MAX .EQ 16
|
||||
*--------------------------------------
|
||||
.INB inc/macros.i
|
||||
@ -36,13 +37,13 @@ hOut .BS 1
|
||||
ZPCodeBufPtr .BS 2
|
||||
ZPConstBufPtr .BS 2
|
||||
ZPDataBufPtr .BS 2
|
||||
ArgIndex .BS 1
|
||||
bFlag .BS 1
|
||||
ZPFWRefBufPtr .BS 2
|
||||
|
||||
EXP.ADDR .BS 2
|
||||
EXP.TYPE .BS 1
|
||||
EXP.AOPS .BS 1
|
||||
*EXP.DEPTH .BS 1
|
||||
ArgIndex .BS 1
|
||||
bFlag .BS 1
|
||||
|
||||
ZS.END .ED
|
||||
*--------------------------------------
|
||||
@ -73,6 +74,7 @@ L.MSG.COMPILING .DA MSG.COMPILING
|
||||
L.MSG.DEBUG .DA MSG.DEBUG
|
||||
L.MSG.ERR .DA MSG.ERR
|
||||
L.MSG.RUN .DA MSG.RUN
|
||||
L.MSG.FWREFERR .DA MSG.FWREFERR
|
||||
L.MSG.STR .DA MSG.STR
|
||||
L.MSG.INT32 .DA MSG.INT32
|
||||
*--------------------------------------
|
||||
@ -211,6 +213,9 @@ CS.RUN >PUSHW L.MSG.GREETINGS
|
||||
cmp #MLI.E.EOF
|
||||
bne .9
|
||||
|
||||
jsr CORE.FWREF
|
||||
bcs .9
|
||||
|
||||
jsr CORE.Run
|
||||
bcc .8
|
||||
|
||||
@ -472,7 +477,8 @@ MSG.ECHOCRLF .AZ "\r\n"
|
||||
MSG.COMPILING .AZ "Compiling : %s...\r\n"
|
||||
MSG.DEBUG .AZ "pStack=%H CodePtr=%H\r\n"
|
||||
MSG.ERR .AZ "-^\r\nLine #%D:"
|
||||
MSG.RUN .AZ "Success, Code size = %D Bytes\r\nExecuting...\r\n"
|
||||
MSG.RUN .AZ "Success, Code size = %D Bytes\r\nResolving FWRefs...\r\n"
|
||||
MSG.FWREFERR .AZ "Unresolved FWRef : %s\r\n"
|
||||
MSG.STR .AZ "%s"
|
||||
MSG.INT32 .AZ "%L"
|
||||
*--------------------------------------
|
||||
@ -590,6 +596,7 @@ hConstBuf .BS 1
|
||||
hDataBuf .BS 1
|
||||
hLabels .BS 1
|
||||
hVars .BS 1
|
||||
hFWRefBuf .BS 1
|
||||
DS.END .ED
|
||||
*--------------------------------------
|
||||
MAN
|
||||
|
@ -682,6 +682,22 @@ KW.. jsr KW.DUP
|
||||
|
||||
* clc
|
||||
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
KW.U. jsr KW.DUP
|
||||
bcs .9
|
||||
|
||||
ldy #2
|
||||
lda L.FMT.uint16
|
||||
sta (pStack),y
|
||||
iny
|
||||
lda L.FMT.uint16+1
|
||||
sta (pStack),y
|
||||
>PUSHBI 2
|
||||
>SYSCALL PrintF
|
||||
|
||||
* clc
|
||||
|
||||
.9 rts
|
||||
*--------------------------------------
|
||||
KW..R
|
||||
@ -803,6 +819,16 @@ KW.OCTAL lda #E.SYN
|
||||
sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
KW.FETCHSP lda pStack+1
|
||||
ldy pStack
|
||||
bne .1
|
||||
|
||||
inc
|
||||
|
||||
.1 >PUSHYA
|
||||
clc
|
||||
rts
|
||||
*--------------------------------------
|
||||
KW.FETCHW lda (pStack)
|
||||
sta ZPAddrPtr
|
||||
ldy #1
|
||||
|
@ -92,6 +92,7 @@ L.MSG.TYPES .DA MSG.CONST
|
||||
.DA MSG.CODE
|
||||
L.FMT.Byte .DA FMT.Byte
|
||||
L.FMT.int16 .DA FMT.int16
|
||||
L.FMT.uint16 .DA FMT.uint16
|
||||
J.ESC .DA CL.BS left arrow
|
||||
.DA HIS.GetNext
|
||||
.DA HIS.GetPrev
|
||||
@ -132,6 +133,7 @@ J.KEYWORDS.LWR .DA KW.LWR
|
||||
.DA KW.NEGATIVE
|
||||
.DA KW.ZERO
|
||||
.DA KW..
|
||||
.DA KW.U.
|
||||
.DA KW..R
|
||||
.DA KW.D.
|
||||
.DA KW.D.R
|
||||
@ -157,6 +159,7 @@ J.KEYWORDS.LWR .DA KW.LWR
|
||||
.DA KW.DECIMAL
|
||||
.DA KW.HEX
|
||||
.DA KW.OCTAL
|
||||
.DA KW.FETCHSP
|
||||
.DA KW.FETCHW
|
||||
.DA KW.STOREW
|
||||
.DA KW.FETCHB
|
||||
@ -643,12 +646,22 @@ PrintPrompt >PUSHW L.MSG.PROMPT
|
||||
>SYSCALL PrintF
|
||||
rts
|
||||
*--------------------------------------
|
||||
PrintDebugMsg >PUSHW L.MSG.DEBUG
|
||||
PrintDebugMsg lda pStack+1
|
||||
ldy pStack
|
||||
bne .1
|
||||
|
||||
inc
|
||||
|
||||
.1 pha
|
||||
|
||||
>PUSHW L.MSG.DEBUG
|
||||
>PUSHW ZPCodePtr
|
||||
>PUSHW ZPDataPtr
|
||||
>PUSHB pStack
|
||||
|
||||
pla
|
||||
>PUSHYA
|
||||
>PUSHB RP
|
||||
>PUSHBI 6
|
||||
>PUSHBI 7
|
||||
>SYSCALL PrintF
|
||||
|
||||
rts
|
||||
@ -805,7 +818,7 @@ MSG.USAGE .AS "Usage : FORTH <option> file\r\n"
|
||||
.AS " -D : Debug Mode\r\n"
|
||||
.AS " -T : Trace On"
|
||||
MSG.ECHOCRLF .AZ "\r\n"
|
||||
MSG.DEBUG .AZ "(CODE:%H, DATA=%H, SP=%h, RP=%h)\r\n"
|
||||
MSG.DEBUG .AZ "(CODE:%H, DATA=%H, SP=%H, RP=%h)\r\n"
|
||||
MSG.TRACE .AZ "[%5D]%s\r\n"
|
||||
MSG.PROMPT .AZ "\e[?7h\r\n> " Enable Line Wrap
|
||||
MSG.PROMPTCRLF .AZ "\e[?7l\r\n" Disable Line Wrap
|
||||
@ -816,6 +829,7 @@ MSG.VAR .AZ "Var @="
|
||||
MSG.CODE .AZ "Code @="
|
||||
FMT.Byte .AZ "%d "
|
||||
FMT.int16 .AZ "%I "
|
||||
FMT.uint16 .AZ "%D "
|
||||
*--------------------------------------
|
||||
OptionList .AS "DdTt"
|
||||
OptionVars .DA #bDebug,#bDebug,#bTrace,#bTrace
|
||||
@ -861,6 +875,7 @@ KEYWORDS .AT "PLOT"
|
||||
.AT "0=" ( n - f ) True if top number zero.
|
||||
*--------------------------------------
|
||||
.AT "." ( n - ) Print number.
|
||||
.AT "U." ( u - ) Print UNSIGNED number
|
||||
.AT ".R" ( n u - ) Print number, right-justified in u column.
|
||||
.AT "D." ( d - ) Print double-precision number.
|
||||
.AT "D.R" ( d u - ) Print double-precision number in u column.
|
||||
@ -887,6 +902,7 @@ KEYWORDS .AT "PLOT"
|
||||
.AT "HEX" ( - ) Set hexadecimal base.
|
||||
.AT "OCTAL" ( - ) Set octal base.
|
||||
*--------------------------------------
|
||||
.AT "SP@" ( - addr ) Return the address of the top of the stack, just before SP@ was executed
|
||||
.AT "@" ( addr - n ) Replace word address by contents.
|
||||
.AT "!" ( n addr - ) Store second word at address on top.
|
||||
.AT "C@" ( addr - b ) Fetch one byte only.
|
||||
|
@ -2,9 +2,9 @@ NEW
|
||||
AUTO 3,1
|
||||
*--------------------------------------
|
||||
IO.D2.SeekTimeR .EQ 48 LIBBLKDEV Recalibration
|
||||
IO.D2.SeekTimeF .EQ 68 LIBBLKDEV Track Formatter
|
||||
IO.D2.SeekTimeB .EQ 68 LIBBLKDEV Boot Block
|
||||
IO.D2.SeekTimeP .EQ 68 ProDOS.FX initial
|
||||
IO.D2.SeekTimeF .EQ 48 LIBBLKDEV Track Formatter
|
||||
IO.D2.SeekTimeB .EQ 48 LIBBLKDEV Boot Block
|
||||
IO.D2.SeekTimeP .EQ 48 ProDOS.FX initial
|
||||
IO.D2.SeekTimeI .EQ 10 ProDOS.FX increment -> until > 128
|
||||
*--------------------------------------
|
||||
IO.D2.Ph0Off .EQ $C080
|
||||
|
@ -333,8 +333,6 @@ BB.Seek lda BB.HdrTrk get track we're on
|
||||
bne .1
|
||||
|
||||
jsr .10 we are on 0/4 or 2/4 track
|
||||
|
||||
lda #1
|
||||
bra .9 no wait, next operation will be phy/plx/Ph0On,y
|
||||
|
||||
.1 cmp BB.TargetQTrack we are on 1/4 or 3/4
|
||||
@ -383,29 +381,19 @@ BB.Seek lda BB.HdrTrk get track we're on
|
||||
.6 jsr .10 now X and Y on
|
||||
|
||||
.8 lda #IO.D2.SeekTimeB
|
||||
jsr BB.Wait100usecA ...wait...
|
||||
|
||||
.9 jsr BB.Wait100usecA ...wait...
|
||||
|
||||
lda BB.CurrentQTrack
|
||||
.9 lda BB.CurrentQTrack
|
||||
cmp BB.TargetQTrack
|
||||
bne .3
|
||||
|
||||
lda #0
|
||||
jsr BB.Wait100usecA
|
||||
|
||||
txa
|
||||
bit #2
|
||||
beq .11
|
||||
|
||||
phy
|
||||
plx
|
||||
tay
|
||||
|
||||
.11 lda IO.D2.Ph0Off,x
|
||||
* ldx BB.Slotn0
|
||||
* lda IO.D2.RData,x
|
||||
lda IO.D2.Ph0Off,x
|
||||
nop
|
||||
nop
|
||||
lda IO.D2.Ph0Off,y
|
||||
* lda IO.D2.RData,x
|
||||
*--------------------------------------
|
||||
BB.Read ldx BB.Slotn0
|
||||
|
||||
|
@ -84,11 +84,8 @@ D2.MoveHead.SEI lda D2.CurrentQTrack
|
||||
bne .1
|
||||
|
||||
jsr D2.SeekPhOnY we are on 0/4 or 2/4 track
|
||||
* lda #1
|
||||
* bra .9 no wait, next operation will be phy/plx/Ph0On,y
|
||||
bra .9 no wait, next operation will be phy/plx/Ph0On,y
|
||||
|
||||
bra .8
|
||||
|
||||
.1 cmp D2.TargetQTrack we are on 1/4 or 3/4
|
||||
|
||||
bcs .2 if CS, C > T, must move out
|
||||
@ -129,32 +126,19 @@ D2.MoveHead.SEI lda D2.CurrentQTrack
|
||||
.6 jsr D2.SeekPhOnY now X and Y on
|
||||
|
||||
.8 lda #IO.D2.SeekTimeF
|
||||
jsr D2.Wait100usecA ...wait...
|
||||
|
||||
.9 jsr D2.Wait100usecA ...wait...
|
||||
|
||||
lda D2.CurrentQTrack
|
||||
.9 lda D2.CurrentQTrack
|
||||
cmp D2.TargetQTrack
|
||||
bne .3
|
||||
|
||||
pha
|
||||
jsr D2.Wait25600usec
|
||||
pla
|
||||
lsr
|
||||
bcc .90
|
||||
|
||||
* txa
|
||||
* bit #2
|
||||
* beq .11
|
||||
|
||||
* phy
|
||||
* plx
|
||||
* tay
|
||||
*.11
|
||||
sta IO.D2.Ph0Off,x
|
||||
ldx D2.Slotn0
|
||||
lda IO.D2.RData,x
|
||||
.90 sta IO.D2.Ph0Off,y
|
||||
* lda IO.D2.RData,x
|
||||
|
||||
lda IO.D2.Ph0Off,x
|
||||
nop
|
||||
nop
|
||||
lda IO.D2.Ph0Off,y
|
||||
|
||||
rts
|
||||
|
||||
D2.SeekPhOnY and #6
|
||||
@ -412,8 +396,13 @@ D2.Wait100usecA phx
|
||||
D2.PutSyncBytePtr2
|
||||
lda #$7f
|
||||
|
||||
.1 jsr D2.PutBytePtr2
|
||||
dey
|
||||
.1 sta (ZPPtr2)
|
||||
inc ZPPtr2
|
||||
bne .2
|
||||
|
||||
inc ZPPtr2+1
|
||||
|
||||
.2 dey
|
||||
bne .1
|
||||
|
||||
rts
|
||||
@ -506,8 +495,15 @@ D2.PutData stz D2.Checksum
|
||||
|
||||
lda FC2Nib,x
|
||||
|
||||
jsr D2.PutBytePtr2
|
||||
dey
|
||||
* jsr D2.PutBytePtr2
|
||||
|
||||
sta (ZPPtr2)
|
||||
inc ZPPtr2
|
||||
bne .31
|
||||
|
||||
inc ZPPtr2+1
|
||||
|
||||
.31 dey
|
||||
bpl .3
|
||||
|
||||
ldy #0
|
||||
@ -522,16 +518,20 @@ D2.PutData stz D2.Checksum
|
||||
|
||||
lda FC2Nib,x
|
||||
|
||||
jsr D2.PutBytePtr2
|
||||
* jsr D2.PutBytePtr2
|
||||
|
||||
iny
|
||||
sta (ZPPtr2)
|
||||
inc ZPPtr2
|
||||
bne .41
|
||||
|
||||
inc ZPPtr2+1
|
||||
|
||||
.41 iny
|
||||
bne .4
|
||||
|
||||
ldx D2.Checksum
|
||||
lda FC2Nib,x
|
||||
jsr D2.PutBytePtr2
|
||||
|
||||
rts
|
||||
bra D2.PutBytePtr2
|
||||
*--------------------------------------
|
||||
D2.PutByte44Ptr2
|
||||
pha
|
||||
@ -545,7 +545,9 @@ D2.PutByte44Ptr2
|
||||
D2.PutBytePtr2 sta (ZPPtr2)
|
||||
inc ZPPtr2
|
||||
bne .8
|
||||
|
||||
inc ZPPtr2+1
|
||||
|
||||
.8 rts
|
||||
*--------------------------------------
|
||||
D2.WriteTrackPtr2
|
||||
|
@ -447,11 +447,12 @@ LDR.ClkDevTCLK lda CLRC8ROM switch out $C8 ROMs
|
||||
lda idxl+1
|
||||
and #$f
|
||||
tax
|
||||
sta CLRPAGE2
|
||||
|
||||
sta SETPAGE2
|
||||
stz $478,x
|
||||
stz $7f8,x
|
||||
|
||||
sta SETPAGE2
|
||||
sta CLRPAGE2
|
||||
stz $478,x
|
||||
stz $7f8,x
|
||||
|
||||
|
@ -203,7 +203,13 @@ XRW.E.EXIT ldx A2L
|
||||
XRW.SectorIO bit XRW.bWrite
|
||||
bpl .1
|
||||
|
||||
* jsr XRW.SeekPhOnXY
|
||||
* phx
|
||||
* phy
|
||||
jsr XRW.PreNibble
|
||||
* ply
|
||||
* plx
|
||||
* jsr XRW.SeekPhOff
|
||||
|
||||
.1 lda #64
|
||||
sta XRW.RetryCnt
|
||||
@ -399,8 +405,11 @@ XRW.Write bit IO.D2.ReadProt,x (4) PREWRITE MODE
|
||||
bit IO.D2.ReadMode,x (4)
|
||||
|
||||
lda #$FF (2)
|
||||
|
||||
* nop (2)
|
||||
|
||||
jsr XRW.Write.RTS (12)
|
||||
|
||||
sta IO.D2.WriteMode,x (5) goto write mode
|
||||
ora IO.D2.WShift,x (4)
|
||||
|
||||
@ -409,7 +418,7 @@ XRW.Write bit IO.D2.ReadProt,x (4) PREWRITE MODE
|
||||
ldy nbuf2 (4)
|
||||
sty pcl (3)
|
||||
|
||||
ldy #5 (2)
|
||||
ldy #6 (2)
|
||||
|
||||
.1 pha (3) exact timing.
|
||||
pla (4) exact timing.
|
||||
@ -693,9 +702,10 @@ XRW.TrackSelect lda #2
|
||||
|
||||
rts
|
||||
|
||||
.4 .DO XRWDBG=1
|
||||
jsr XRW.DEBUG2
|
||||
.FIN
|
||||
.4
|
||||
* .DO XRWDBG=1
|
||||
* jsr XRW.DEBUG2
|
||||
* .FIN
|
||||
|
||||
ldx XRW.UnitIndex
|
||||
lda XRW.AddrField.V
|
||||
@ -730,6 +740,7 @@ XRW.TrackSelect lda #2
|
||||
|
||||
lda IO.D2.Ph0Off,y
|
||||
lda IO.D2.Ph0Off+4,y
|
||||
|
||||
pla
|
||||
|
||||
.50 sta XRW.ReqTrack2
|
||||
@ -760,22 +771,7 @@ XRW.TrackSelect lda #2
|
||||
|
||||
bra .3
|
||||
|
||||
.8
|
||||
* jsr XRW.Trk2Qtrk
|
||||
* pha
|
||||
* jsr XRW.SeekPhOnY
|
||||
* pla
|
||||
* phy
|
||||
* plx
|
||||
* inc
|
||||
* jsr XRW.SeekPhOnY
|
||||
|
||||
* lda #50
|
||||
* jsr XRW.Wait100usecA
|
||||
|
||||
* jsr XRW.SeekPhOff
|
||||
|
||||
clc
|
||||
.8 clc
|
||||
XRW.TrackSelect.RTS
|
||||
rts
|
||||
*--------------------------------------
|
||||
@ -803,10 +799,7 @@ XRW.SeekYA sta XRW.D2Trk-1,x will be current track at the end
|
||||
bne .1
|
||||
|
||||
jsr XRW.SeekPhOnY we are on 0/4 or 2/4 track : PhY on
|
||||
* lda #1
|
||||
* bra .9 no wait, next operation will be phy/plx/Ph0On,y
|
||||
|
||||
bra .8
|
||||
bra .9 no wait, next operation will be phy/plx/Ph0On,y
|
||||
|
||||
.1 cmp XRW.TargetQTrack we are on 1/4 or 3/4
|
||||
|
||||
@ -848,35 +841,32 @@ XRW.SeekYA sta XRW.D2Trk-1,x will be current track at the end
|
||||
.6 jsr XRW.SeekPhOnY now X and Y on
|
||||
|
||||
.8 lda XRW.SeekTime
|
||||
jsr XRW.Wait100usecA ...wait...
|
||||
|
||||
.9 jsr XRW.Wait100usecA ...wait...
|
||||
|
||||
lda XRW.CurrentQTrack
|
||||
.9 lda XRW.CurrentQTrack
|
||||
cmp XRW.TargetQTrack
|
||||
bne .3
|
||||
|
||||
pha
|
||||
jsr XRW.Wait25600usec
|
||||
pla
|
||||
lsr
|
||||
bcc .90
|
||||
*XRW.SeekPhOff
|
||||
* txa
|
||||
* bit #2
|
||||
* beq .11
|
||||
|
||||
* phy
|
||||
* plx
|
||||
* tay
|
||||
*.11
|
||||
sta IO.D2.Ph0Off,x
|
||||
ldx A2L
|
||||
lda IO.D2.RData,x
|
||||
.90 sta IO.D2.Ph0Off,y
|
||||
* lda IO.D2.RData,x
|
||||
|
||||
XRW.SeekPhOff lda IO.D2.Ph0Off,x
|
||||
nop
|
||||
nop
|
||||
lda IO.D2.Ph0Off,y
|
||||
|
||||
clc Exit wit CC (recalibrate)
|
||||
rts
|
||||
*--------------------------------------
|
||||
*XRW.SeekPhOnXY lda XRW.ReqTrack2
|
||||
|
||||
* jsr XRW.Trk2Qtrk
|
||||
* and #6
|
||||
* ora A2L
|
||||
* tax
|
||||
|
||||
* bit IO.D2.Ph0On,x
|
||||
|
||||
* inc
|
||||
|
||||
XRW.SeekPhOnY and #6
|
||||
ora A2L
|
||||
|
@ -977,11 +977,11 @@ IrqMgrInit.TClock
|
||||
|
||||
lda #$40
|
||||
|
||||
sta CLRPAGE2
|
||||
sta SETPAGE2
|
||||
sta $478,x
|
||||
sta $7f8,x
|
||||
|
||||
sta SETPAGE2
|
||||
sta CLRPAGE2
|
||||
sta $478,x
|
||||
sta $7f8,x
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user