mirror of
https://github.com/A2osX/A2osX.git
synced 2024-09-10 07:54:37 +00:00
Merge branch 'master' of https://github.com/A2osX/A2osX
This commit is contained in:
commit
f2f170660a
@ -7,6 +7,7 @@ This document lists all of the **ACOS Words** supported in the A2osX implementat
|
||||
## Words
|
||||
| Word | Syntax | Status | Short | Description | Comment |
|
||||
|-|-|-|-|-|-|
|
||||
| Word | Syntax | Status | Short | Description | Comment |
|
||||
| ADDINT | ADDINT (*string1* [,*string2*...]) | Not Yet Implemented | Add keys to the interrupt table. | The <tt>ADDINT</tt> command will add more keys to the existing interrupt keys table. previous keys will not be cleared. The functions of the keys is the same as with the <tt>SETINT</tt> command. | |
|
||||
| APPEND | APPEND #*device* | Not Yet Implemented | Set write operations for specified device to append to the end. | The <tt>APPEND</tt> statement is generally used to add data to an existing file. If you issue an <tt>APPEND</tt> statement, the file pointer will be moved to the end of the file. You can also find out the length of a file by doing an <tt>APPEND</tt> and then using the <tt>MARK</tt> function. Mark will then return the length of the file in bytes. | |
|
||||
| BYTE | byte=*number*<br>byte=(*number*)<br>byte=(*number*)=*number*256 | Not Yet Implemented | Byte-level data manipulation function. | The <tt>BYTE</tt> function is similar to the <tt>FLAG</tt> function. It is a low overhead data storage unit. Just point to where in memory you want the data to be stored using the first syntax, and you can then access the data using the second or third syntax's. | |
|
||||
@ -20,6 +21,7 @@ This document lists all of the **ACOS Words** supported in the A2osX implementat
|
||||
| DATE$ | *string*=DATE$ | Not Yet Implemented | Return string with current date. | 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="" | Not Yet Implemented | Specify or clear characters to be echoed during user input. | 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*) | Not Yet Implemented | Text editor operations. | 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. | |
|
||||
| ELSE | ELSE | Impl. | Failure result operator for IF THEN ELSE statements. | See <tt>IF</tt> statement. | |
|
||||
| END | END | Not Yet Implemented | Terminate program. | 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* | Not Yet Implemented | Fill an area of memory with specified data. | 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* | Not Yet Implemented | Bit-level data manipulation function. | 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. | |
|
||||
@ -29,7 +31,7 @@ This document lists all of the **ACOS Words** supported in the A2osX implementat
|
||||
| GOSUB | GOSUB *label* | Impl. | Call subroutine at specified label. | 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. | Redirect program execution to specified label. | 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 | Not Yet Implemented | Clear screen. | 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* | In Development | Logical condition test and execution. | 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). | |
|
||||
| IF | IF *condition* [THEN] *statement1* [ELSE] *statement2* | Impl. | Logical condition test and execution. | 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* | Not Yet Implemented | Byte-level data manipulation function, specific to ACOS internals. | 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> | |
|
||||
| INPUT | INPUT [#*device*,] [@*mode*,] [\\] ["*text*"] *variable* [,[\\] *variable*..] | Not Yet Implemented | Get input from user, device, or file. | Gets input from a device or interactively with the user and stores the result in one-to-many variables. There are quite a few variations how the <tt>INPUT</tt> statement can be used, but at a minimum it requires one *variable* to be specified. <p> Specifying the *device* is required if inputting data from a device handle (e.g. an open file). Omitting the *device* will default to getting input from the user. <p> A text prompt can be optionally specified by supplying *text* before the variables. The text can serve as a prompt (e.g. "What is your name? *input here*"). If backslash (\\) is put before or after the *text*, this will result in a newline being part of the prompt (note distinction between this and using backslash for multiple variables). <p> Multiple variables can be specified in either a comma-separated or backslash (\\) way (or a mixture thereof), though this is typically for file input rather than interactive user input. As with the <tt>PRINT</tt> statement, the comma is taken literally (e.g. if you were to read multiple fields from a comma-separated file), and the backslash as part of the variable list implies that there will be a newline to parse (e.g. <code>INPUT #1, A\$\\B\$</code> reads two lines from the file, <tt>A\$</tt> on the first line and <tt>B\$</tt> on the second line). <p> The *mode* (with '@' symbol prefix) is an optional way of specifying how the <tt>INPUT</tt> command will behave. Using *mode* is ONLY for interactive input and cannot be combined with a *device*. The various modes are as follows: <p> <ul><li><tt>INPUT</tt> - (no mode specified) set the input mode to uppercase, don't accept a blank line. <li><tt>INPUT @0</tt> - set the input mode to uppercase, don't accept a blank line, just return the first character. <li><tt>INPUT @1</tt> - set the input mode to uppercase, don't accept a blank line, don't accept any commas. <li><tt>INPUT @2</tt> - set the input mode to uppercase, blank lines will be accepted. <li><tt>INPUT @3</tt> - accept everything. (upper & lower). </ul> | |
|
||||
| INSTR | *expression*=INSTR(*match*, *source*) | Not Yet Implemented | Find a string within another and return offset if found. | The <tt>INSTR</tt> function is used to search within a *source* string for the existence of the specified *match* string. The search is case insensitive. The function will return the numerical position of the first character in the *source* string where the *match* was found. Note that the first character in *source* string starts at <tt>1</tt>, not <tt>0</tt> like many other languages. So in other words, if the function returns zero, no match was found. | |
|
||||
@ -81,7 +83,6 @@ This document lists all of the **ACOS Words** supported in the A2osX implementat
|
||||
| WRITE | WRITE #*device*, *memloc*, *number* | Not Yet Implemented | Writes binary data. | The <tt>WRITE</tt> statement is the opposite of the <tt>READ</tt> statement. It is used to write unprocessed binary data from memory to a file or other device. Almost all the device channels can be written and none will generate errors. Just specify the memory location and length to be written. BJB TODO: Need to expand on this for the arguments. | |
|
||||
|
||||
|
||||
|
||||
## License
|
||||
A2osX is licensed under the GNU General Pulic License |
|
||||
|
||||
|
Binary file not shown.
@ -198,9 +198,11 @@ MSG1.D .AZ "Dynamic"
|
||||
MSG.USAGE .AS "Usage : Add a static entry, DNSINFO <host> <IP>\r\n"
|
||||
.AZ " Dump DNS Cache, DNSINFO\r\n"
|
||||
*--------------------------------------
|
||||
.DUMMY
|
||||
.OR 0
|
||||
DS.START
|
||||
DST.IP .BS 4
|
||||
DS.END
|
||||
DS.END .ED
|
||||
*--------------------------------------
|
||||
MAN
|
||||
SAVE usr/src/bin/dnsinfo.s
|
||||
|
@ -18,12 +18,11 @@ ZS.START
|
||||
ZPPtr1 .BS 2
|
||||
ZPDataBufPtr .BS 2
|
||||
ZPDataLen .BS 2
|
||||
|
||||
ArgIndex .BS 1
|
||||
Arg1 .BS 1
|
||||
Arg2 .BS 1
|
||||
aOptD .BS 1
|
||||
aOptK .BS 1
|
||||
bText .BS 1
|
||||
bKey .BS 1
|
||||
bGotKey .BS 1
|
||||
hFile .BS 1
|
||||
hDataBuf .BS 1
|
||||
hHMACMD5Ctx .BS 1
|
||||
@ -51,6 +50,8 @@ CS.START cld
|
||||
.DA CS.QUIT
|
||||
L.LIBCRYPT .DA LIBCRYPT
|
||||
L.MSG.USAGE .DA MSG.USAGE
|
||||
L.HMACMD5.IPAD .DA HMACMD5.IPAD
|
||||
L.HMACMD5.OPAD .DA HMACMD5.OPAD
|
||||
.DA 0
|
||||
*--------------------------------------
|
||||
CS.INIT >LDYA L.LIBCRYPT
|
||||
@ -65,11 +66,12 @@ CS.INIT >LDYA L.LIBCRYPT
|
||||
CS.RUN ldy #S.PS.ARGC
|
||||
lda (pPS),y
|
||||
beq .99
|
||||
.0 ldx #0
|
||||
.0 lda #0
|
||||
pha
|
||||
|
||||
.1 inc ArgIndex
|
||||
lda ArgIndex
|
||||
phx
|
||||
|
||||
>SYSCALL ArgV
|
||||
plx
|
||||
bcs .8
|
||||
@ -82,7 +84,7 @@ CS.RUN ldy #S.PS.ARGC
|
||||
lda (ZPPtr1),y
|
||||
beq .99
|
||||
|
||||
ldy #OptionVars-OptionList-1
|
||||
ldy #OptionEnd-OptionList-1
|
||||
|
||||
.2 cmp OptionList,y
|
||||
beq .3
|
||||
@ -96,29 +98,28 @@ CS.RUN ldy #S.PS.ARGC
|
||||
sec
|
||||
rts
|
||||
|
||||
.3 ldx OptionVars,y
|
||||
.3 tya
|
||||
lsr
|
||||
pha
|
||||
tax
|
||||
sec
|
||||
ror 0,x
|
||||
ror bText,x
|
||||
bra .1
|
||||
|
||||
.4 txa
|
||||
bpl .99
|
||||
lda ArgIndex
|
||||
sta $fe,x
|
||||
.4 lda ArgIndex
|
||||
sta aOptD,x
|
||||
bra .0
|
||||
|
||||
.8 lda Arg1
|
||||
beq .99
|
||||
lda Arg2
|
||||
.8 lda bGotKey
|
||||
beq .99
|
||||
|
||||
lda bText
|
||||
beq CS.RUN.FILE
|
||||
*--------------------------------------
|
||||
CS.RUN.TEXT lda Arg1
|
||||
CS.RUN.TEXT lda aOptD
|
||||
>SYSCALL ArgV
|
||||
>PUSHYA
|
||||
lda Arg2
|
||||
lda aOptK
|
||||
>SYSCALL ArgV
|
||||
>PUSHYA
|
||||
>PUSHEA.G HMACMD5Buf
|
||||
@ -132,36 +133,89 @@ CS.RUN.FILE >LDYAI FILEBUF.SIZE
|
||||
>STYA ZPDataBufPtr
|
||||
stx hDataBuf
|
||||
|
||||
lda Arg1
|
||||
lda aOptD
|
||||
>SYSCALL ArgV
|
||||
>PUSHYA
|
||||
>PUSHBI O.RDONLY
|
||||
>PUSHBI 0 ftype
|
||||
>PUSHWZ Aux type
|
||||
>SYSCALL FOpen
|
||||
bcs .9
|
||||
bcc .1
|
||||
|
||||
sta hFile
|
||||
.9 rts
|
||||
|
||||
>LIBCALL hLIBCRYPT,LIBCRYPT.MD5Init
|
||||
.1 sta hFile
|
||||
|
||||
lda aOptK
|
||||
>SYSCALL ArgV
|
||||
>STYA ZPDataBufPtr
|
||||
>SYSCALL2 strlen
|
||||
>STYA ZPDataLen
|
||||
cpy #65
|
||||
bcs .2
|
||||
tay
|
||||
beq .3
|
||||
|
||||
.2 >LIBCALL hLIBCRYPT,LIBCRYPT.MD5Init
|
||||
bcs .9
|
||||
|
||||
sta hHMACMD5Ctx
|
||||
|
||||
.1 >SLEEP
|
||||
>SLEEP
|
||||
|
||||
>PUSHB hHMACMD5Ctx
|
||||
lda aOptK
|
||||
>SYSCALL ArgV
|
||||
>PUSHYA
|
||||
>PUSHW ZPDataLen
|
||||
>LIBCALL hLIBCRYPT,LIBCRYPT.MD5Update
|
||||
>PUSHB hHMACMD5Ctx
|
||||
>PUSHEA.G HMACMD5Buf
|
||||
>LIBCALL hLIBCRYPT,LIBCRYPT.MD5Finalize
|
||||
|
||||
jsr RevertASCII
|
||||
|
||||
.3 ldy #0
|
||||
.4 lda #$36
|
||||
cpy ZPDataLen
|
||||
bcs .5
|
||||
eor (ZPDataBufPtr),y
|
||||
.5 sta HMACMD5.IPAD,y
|
||||
eor #$6A #$36 eor #$5C
|
||||
sta HMACMD5.OPAD,y
|
||||
iny
|
||||
cpy #64
|
||||
bne .4
|
||||
stz HMACMD5.IPAD+64
|
||||
stz HMACMD5.OPAD+64
|
||||
|
||||
rebase
|
||||
>LIBCALL hLIBCRYPT,LIBCRYPT.MD5Init
|
||||
bcc .6
|
||||
|
||||
rts
|
||||
|
||||
.6 sta hHMACMD5Ctx
|
||||
|
||||
>PUSHB hHMACMD5Ctx
|
||||
>PUSHW L.HMACMD5.IPAD
|
||||
>PUSHWI 64
|
||||
>LIBCALL hLIBCRYPT,LIBCRYPT.MD5Update
|
||||
|
||||
.7 >SLEEP
|
||||
|
||||
>PUSHB hFile
|
||||
>PUSHW ZPDataBufPtr Dst Ptr
|
||||
>PUSHWI FILEBUF.SIZE Bytes To Read
|
||||
>SYSCALL FRead
|
||||
bcc .2
|
||||
bcc .8
|
||||
|
||||
cmp #MLI.E.EOF
|
||||
beq .8
|
||||
beq .10
|
||||
|
||||
.9 rts
|
||||
.99 rts
|
||||
|
||||
.2 >STYA ZPDataLen
|
||||
.8 >STYA ZPDataLen
|
||||
|
||||
>SLEEP
|
||||
|
||||
@ -169,17 +223,65 @@ CS.RUN.FILE >LDYAI FILEBUF.SIZE
|
||||
>PUSHW ZPDataBufPtr
|
||||
>PUSHW ZPDataLen
|
||||
>LIBCALL hLIBCRYPT,LIBCRYPT.MD5Update
|
||||
bra .1
|
||||
bra .7
|
||||
|
||||
.8 >PUSHB hHMACMD5Ctx
|
||||
.10 >PUSHB hHMACMD5Ctx
|
||||
>PUSHEA.G HMACMD5Buf
|
||||
>LIBCALL hLIBCRYPT,LIBCRYPT.MD5Finalize
|
||||
|
||||
jsr RevertASCII
|
||||
|
||||
>LIBCALL hLIBCRYPT,LIBCRYPT.MD5Init
|
||||
bcs .99
|
||||
|
||||
sta hHMACMD5Ctx
|
||||
|
||||
>PUSHB hHMACMD5Ctx
|
||||
>PUSHW L.HMACMD5.OPAD
|
||||
>PUSHWI 64
|
||||
>LIBCALL hLIBCRYPT,LIBCRYPT.MD5Update
|
||||
|
||||
>PUSHB hHMACMD5Ctx
|
||||
>PUSHW L.HMACMD5.IPAD
|
||||
>PUSHWI 16
|
||||
>LIBCALL hLIBCRYPT,LIBCRYPT.MD5Update
|
||||
|
||||
>PUSHB hHMACMD5Ctx
|
||||
>PUSHEA.G HMACMD5Buf
|
||||
>LIBCALL hLIBCRYPT,LIBCRYPT.MD5Finalize
|
||||
|
||||
CS.RUN.PRINT >LEA.G HMACMD5Buf
|
||||
>SYSCALL PutS
|
||||
lda #0
|
||||
* sec
|
||||
* rts
|
||||
sec
|
||||
rts
|
||||
|
||||
*--------------------------------------
|
||||
RevertASCII >LEA.G HMACMD5Buf
|
||||
>STYA ZPDataBufPtr
|
||||
ldx #16
|
||||
stx ZPDataLen
|
||||
ldy #31
|
||||
.1 lda (ZPDataBufPtr),y
|
||||
cmp #$3A
|
||||
bcc .2
|
||||
sbc #7
|
||||
.2 and #$0f
|
||||
sta bText
|
||||
dey
|
||||
lda (ZPDataBufPtr),y
|
||||
cmp #$3A
|
||||
bcc .3
|
||||
sbc #7
|
||||
.3 asl
|
||||
asl
|
||||
asl
|
||||
asl
|
||||
ora bText
|
||||
sta HMACMD5.IPAD-1,x
|
||||
dex
|
||||
dey
|
||||
bpl .1
|
||||
*--------------------------------------
|
||||
CS.DOEVENT sec
|
||||
rts
|
||||
@ -206,9 +308,12 @@ LIBCRYPT .AZ "libcrypt"
|
||||
hLIBCRYPT .BS 1
|
||||
*--------------------------------------
|
||||
OptionList .AS "DdKk"
|
||||
OptionVars .DA #bText,#bText, #bKey,#bKey
|
||||
OptionEnd
|
||||
*--------------------------------------
|
||||
MSG.USAGE .AZ "Usage : HMACMD5 [ -d input text | input file -k key ]\r\n"
|
||||
MSG.USAGE .AZ "Usage : HMACMD5 [ -d input text | input file ] [ -k key ]\r\n"
|
||||
*--------------------------------------
|
||||
HMACMD5.IPAD .BS 65
|
||||
HMACMD5.OPAD .BS 65
|
||||
*--------------------------------------
|
||||
.DUMMY
|
||||
.OR 0
|
||||
|
@ -8,11 +8,11 @@ LIBCRYPT.MD4Update .EQ 8
|
||||
LIBCRYPT.MD4Finalize .EQ 10
|
||||
*--------------------------------------
|
||||
LIBCRYPT.MD5 .EQ 12
|
||||
LIBCRYPT.MD5Init .EQ LIBCRYPT.MD4Init
|
||||
LIBCRYPT.MD5Update .EQ 14
|
||||
LIBCRYPT.MD5Init .EQ 14
|
||||
LIBCRYPT.MD5Update .EQ 16
|
||||
LIBCRYPT.MD5Finalize .EQ LIBCRYPT.MD4Finalize
|
||||
*--------------------------------------
|
||||
LIBCRYPT.HMACMD5 .EQ 16
|
||||
LIBCRYPT.HMACMD5 .EQ 18
|
||||
*--------------------------------------
|
||||
* S.MD4, S.MD5 STRUCT
|
||||
*--------------------------------------
|
||||
|
@ -11,6 +11,12 @@ S.NETBIOS .EQ 4
|
||||
S.SMB.H.PROTO .EQ 0 \xFF 'SMB'
|
||||
S.SMB.H.CMD .EQ 4
|
||||
S.SMB.H.CMD.CLOSE .EQ $04
|
||||
S.SMB.H.CMD.FLUSH .EQ $05
|
||||
S.SMB.H.CMD.DELETE .EQ $06
|
||||
S.SMB.H.CMD.RENAME .EQ $07
|
||||
|
||||
S.SMB.H.CMD.SEEK .EQ $12
|
||||
|
||||
S.SMB.H.CMD.READ.ANDX .EQ $2E
|
||||
S.SMB.H.CMD.WRITE.ANDX .EQ $2F
|
||||
S.SMB.H.CMD.TRANS2 .EQ $32
|
||||
|
@ -9,17 +9,17 @@ CIFS2.ChMod
|
||||
*--------------------------------------
|
||||
CIFS.FStat
|
||||
*--------------------------------------
|
||||
CIFS2.FStat
|
||||
txa
|
||||
ora #$80
|
||||
|
||||
* lda #MLI.E.BADCALL
|
||||
CIFS2.FStat >DEBUG
|
||||
lda #MLI.E.BADCALL
|
||||
sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
CIFS.Stat >STYA pPath resolved path
|
||||
|
||||
jsr ClearSocket
|
||||
|
||||
jsr GetGTX
|
||||
|
||||
jsr MakeTrans2Req
|
||||
|
||||
ldx #0
|
||||
@ -31,14 +31,22 @@ CIFS.Stat >STYA pPath resolved path
|
||||
cpx #SMB.QueryPathInfo.Len
|
||||
bne .1
|
||||
|
||||
jsr AppendPath
|
||||
jsr ReqT2SetupPtr2
|
||||
|
||||
lda #0
|
||||
sta (ZPReqPtr),y
|
||||
iny
|
||||
jsr AppendPathPtr2
|
||||
|
||||
jsr SetT2ReqLenYA
|
||||
tya
|
||||
|
||||
inc +1 for \0
|
||||
|
||||
clc
|
||||
adc ZPReqLen
|
||||
sta ZPReqLen
|
||||
bcc .2
|
||||
|
||||
inc ZPReqLen+1
|
||||
|
||||
.2 jsr SetT2ReqLen
|
||||
jsr WriteSocket
|
||||
bcs .9
|
||||
|
||||
@ -55,16 +63,20 @@ CIFS2.Stat jsr ReadSocket
|
||||
lda (ZPRespPtr),y
|
||||
beq .1
|
||||
|
||||
lda hResp
|
||||
>SYSCALL2 FreeMem
|
||||
|
||||
lda #MLI.E.FNOTFND
|
||||
bra .99
|
||||
|
||||
.1 >PULLW ZPPtr2 Stat Buffer
|
||||
.1 jsr GetRespDataOffset
|
||||
jsr FileInfo2StatBuf
|
||||
|
||||
>PULLW ZPPtr2 Stat Buffer
|
||||
|
||||
inc pStack Skip Filename
|
||||
inc pStack
|
||||
|
||||
jsr GetRespDataOffset
|
||||
jsr FileInfo2StatBuf
|
||||
jsr StatBuf2Ptr2
|
||||
|
||||
lda hResp
|
||||
@ -92,6 +104,8 @@ CIFS2.Stat jsr ReadSocket
|
||||
*--------------------------------------
|
||||
CIFS.MKDir >STYA pPath resolved path
|
||||
|
||||
jsr GetGTX
|
||||
|
||||
jsr MakeTrans2Req
|
||||
|
||||
ldx #0
|
||||
@ -191,6 +205,8 @@ CIFS.ReadDir jsr GetPFD
|
||||
|
||||
jsr ClearSocket
|
||||
|
||||
jsr GetGTX
|
||||
|
||||
ldy #S.FD.DIR.EPB
|
||||
lda (pFD),y
|
||||
beq .1
|
||||
@ -531,30 +547,51 @@ CIFS.FOpen >STYA pPath resolved path
|
||||
cpx #SMB.ComCreate.H.Len
|
||||
bne .1
|
||||
|
||||
phy save Y = LEN
|
||||
jsr ReqSetupPtr2
|
||||
|
||||
jsr GetPathLen
|
||||
jsr AppendPathPtr2
|
||||
|
||||
ldy #S.NETBIOS+S.SMB.H+6
|
||||
tya
|
||||
|
||||
ldy #S.NETBIOS+S.SMB.H+6 NameLength
|
||||
sta (ZPReqPtr),y
|
||||
|
||||
ply
|
||||
phy
|
||||
inc +1 for \0
|
||||
|
||||
ldy ByteCountOfs
|
||||
sta (ZPReqPtr),y
|
||||
|
||||
iny Skip ByteCount
|
||||
iny
|
||||
clc
|
||||
adc ZPReqLen
|
||||
sta ZPReqLen
|
||||
bcc .2
|
||||
|
||||
jsr AppendPath
|
||||
inc ZPReqLen+1
|
||||
|
||||
lda #0
|
||||
.2 lda #0
|
||||
ror
|
||||
iny ByteCountOfs+1
|
||||
sta (ZPReqPtr),y
|
||||
iny
|
||||
|
||||
pla
|
||||
jsr SetReqLen
|
||||
|
||||
jsr SetReqLenYAtA
|
||||
ldx #1 FILE_OPEN
|
||||
|
||||
ldy #3 fopen flags
|
||||
lda (pStack),y
|
||||
bpl .3 O.CREATE
|
||||
|
||||
ldx #3 FILE_OPEN_IF
|
||||
|
||||
.3 bit #O.APPEND
|
||||
bmi .4
|
||||
|
||||
ldx #5 FILE_OVERWRITE_IF
|
||||
|
||||
.4 txa
|
||||
|
||||
ldy #S.NETBIOS+S.SMB.H+SMB.Trans2.H.Len+7 CreateDisposition
|
||||
sta (ZPReqPtr),y
|
||||
|
||||
jsr WriteSocket
|
||||
bcs .9
|
||||
@ -651,7 +688,8 @@ CIFS.FClose jsr GetPFD
|
||||
cpx #SMB.ComClose.H.Len
|
||||
bne .1
|
||||
|
||||
phy save Y = LEN
|
||||
sty ZPReqLen
|
||||
stz ZPReqLen+1
|
||||
|
||||
ldy #S.FD.REG.REF
|
||||
lda (pFD),y
|
||||
@ -665,14 +703,7 @@ CIFS.FClose jsr GetPFD
|
||||
dey
|
||||
sta (ZPReqPtr),y
|
||||
|
||||
ply
|
||||
|
||||
tya
|
||||
|
||||
iny Skip ByteCount
|
||||
iny
|
||||
|
||||
jsr SetReqLenYAtA
|
||||
jsr SetReqLen
|
||||
|
||||
jsr WriteSocket
|
||||
bcs .9
|
||||
@ -731,7 +762,7 @@ CIFS2.FRead
|
||||
clc
|
||||
>RET 5
|
||||
*--------------------------------------
|
||||
CIFS.FWrite ldy #4
|
||||
CIFS.FWrite ldy #4 hNod
|
||||
lda (pStack),y
|
||||
|
||||
jsr GetPFD
|
||||
@ -750,13 +781,7 @@ CIFS.FWrite ldy #4
|
||||
cpx #SMB.ComWrite.H.Len
|
||||
bne .1
|
||||
|
||||
sty LenOfs
|
||||
|
||||
iny
|
||||
iny
|
||||
|
||||
sty ZPReqLen
|
||||
stz ZPReqLen+1
|
||||
jsr ReqSetupPtr2
|
||||
|
||||
ldy #S.FD.REG.REF
|
||||
lda (pFD),y
|
||||
@ -770,12 +795,90 @@ CIFS.FWrite ldy #4
|
||||
dey
|
||||
sta (ZPReqPtr),y
|
||||
|
||||
ldy #3 DataPtr HI
|
||||
lda (pStack),y
|
||||
sta ZPPtr1+1
|
||||
|
||||
dey DataPtr LO
|
||||
lda (pStack),y
|
||||
sta ZPPtr1
|
||||
|
||||
dey DataLen HI
|
||||
lda (pStack),y
|
||||
beq .5
|
||||
|
||||
lda #0
|
||||
ldx #1 write $100
|
||||
|
||||
bra .6
|
||||
|
||||
.5 dey DataLen LO
|
||||
lda (pStack),y
|
||||
ldx #0 write $0xx
|
||||
|
||||
.6 pha
|
||||
ldy #S.NETBIOS+S.SMB.H+21 DataLength
|
||||
clc
|
||||
adc #2
|
||||
sta (ZPReqPtr),y
|
||||
|
||||
iny
|
||||
|
||||
txa
|
||||
adc #0
|
||||
sta (ZPReqPtr),y
|
||||
|
||||
pla
|
||||
pha
|
||||
clc
|
||||
adc ZPReqLen
|
||||
sta ZPReqLen
|
||||
|
||||
txa
|
||||
adc ZPReqLen+1
|
||||
sta ZPReqLen+1
|
||||
|
||||
pla
|
||||
pha
|
||||
ldy ByteCountOfs
|
||||
sta (ZPReqPtr),y
|
||||
|
||||
txa
|
||||
iny
|
||||
sta (ZPReqPtr),y
|
||||
|
||||
ldy #0
|
||||
plx
|
||||
|
||||
.70 lda (ZPPtr1),y
|
||||
sta (ZPPtr2),y
|
||||
iny
|
||||
dex
|
||||
bne .70
|
||||
|
||||
jsr SetReqLen
|
||||
|
||||
jsr WriteSocket
|
||||
bcs .9
|
||||
|
||||
jmp Sleep
|
||||
ldy #1 DataLen HI
|
||||
lda (pStack),y
|
||||
beq .7
|
||||
|
||||
dec
|
||||
sta (pStack),y
|
||||
|
||||
ldy #3 DataPtr HI
|
||||
lda (pStack),y
|
||||
inc
|
||||
sta (pStack),y
|
||||
|
||||
bra .8
|
||||
|
||||
.7 lda #0
|
||||
sta (pStack) DataLen LO
|
||||
|
||||
.8 jmp Sleep
|
||||
|
||||
.9 >RET 5
|
||||
*--------------------------------------
|
||||
@ -797,9 +900,13 @@ CIFS2.FWrite ldy #4
|
||||
|
||||
.8 jsr FreeRespData
|
||||
|
||||
stz CIFS.Status
|
||||
ldy #1
|
||||
lda (pStack),y
|
||||
ora (pStack)
|
||||
clc
|
||||
beq .90
|
||||
|
||||
>RET 5
|
||||
jmp Sleep2
|
||||
|
||||
.9 cmp #E.NODATA
|
||||
bne .99
|
||||
@ -814,7 +921,8 @@ CIFS2.FWrite ldy #4
|
||||
.98 lda #MLI.E.IO
|
||||
|
||||
.99 sec
|
||||
stz CIFS.Status
|
||||
|
||||
.90 stz CIFS.Status
|
||||
|
||||
>RET 5
|
||||
*--------------------------------------
|
||||
@ -829,10 +937,8 @@ CIFS2.FEOF
|
||||
CIFS.Remove
|
||||
CIFS2.Remove
|
||||
CIFS.Rename
|
||||
CIFS2.Rename
|
||||
* lda #MLI.E.BADCALL
|
||||
txa
|
||||
ora #$80
|
||||
CIFS2.Rename >DEBUG
|
||||
lda #MLI.E.BADCALL
|
||||
sec
|
||||
rts
|
||||
*--------------------------------------
|
||||
|
@ -35,7 +35,7 @@ auxtype .BS 2
|
||||
ZPRespPtr .BS 2
|
||||
|
||||
bFlag .BS 1
|
||||
LenOfs .BS 1
|
||||
ByteCountOfs .BS 1
|
||||
|
||||
ZS.END .ED
|
||||
*--------------------------------------
|
||||
@ -536,6 +536,7 @@ CIFS.CallBack bit CIFS.Status
|
||||
|
||||
phy
|
||||
pha
|
||||
|
||||
ldy #S.PS.PID
|
||||
lda (pPS),y
|
||||
cmp CIFS.PID
|
||||
@ -574,9 +575,7 @@ GetGTX lda MountTable+2
|
||||
>STYA ZPCtxPtr
|
||||
rts
|
||||
*--------------------------------------
|
||||
MakeTrans2Req jsr GetGTX
|
||||
|
||||
ldx #S.SMB.H.CMD.TRANS2
|
||||
MakeTrans2Req ldx #S.SMB.H.CMD.TRANS2
|
||||
jsr RequestSetupX
|
||||
|
||||
ldx #0
|
||||
@ -601,15 +600,13 @@ RequestSetupX phx
|
||||
>SYSCALL2 GetMemPtr
|
||||
>STYA ZPReqPtr
|
||||
|
||||
plx
|
||||
|
||||
ldy #0
|
||||
|
||||
.1 lda (ZPCtxPtr),y
|
||||
cpy #S.NETBIOS+S.SMB.H.CMD
|
||||
bne .2
|
||||
|
||||
txa
|
||||
pla
|
||||
|
||||
.2 sta (ZPReqPtr),y
|
||||
iny
|
||||
@ -618,13 +615,52 @@ RequestSetupX phx
|
||||
|
||||
rts
|
||||
*--------------------------------------
|
||||
GetPathLen ldy #$ff
|
||||
ReqSetupPtr2 sty ByteCountOfs
|
||||
|
||||
iny
|
||||
iny +2 for ByteCount
|
||||
|
||||
ReqT2SetupPtr2 sty ZPReqLen
|
||||
stz ZPReqLen+1
|
||||
|
||||
tya
|
||||
|
||||
clc
|
||||
adc ZPReqPtr
|
||||
sta ZPPtr2
|
||||
|
||||
lda ZPReqPtr+1
|
||||
adc #0
|
||||
sta ZPPtr2+1
|
||||
|
||||
rts
|
||||
*--------------------------------------
|
||||
AppendPathPtr2 ldx #0
|
||||
|
||||
ldy #$ff
|
||||
|
||||
.1 iny
|
||||
lda (pPath),y
|
||||
bne .1
|
||||
beq .4
|
||||
|
||||
.2 cmp #'/'
|
||||
bne .3
|
||||
|
||||
lda #'\'
|
||||
|
||||
.3 sta (ZPPtr2),y
|
||||
tax
|
||||
bra .1
|
||||
|
||||
.4 cpx #'\'
|
||||
bne .5
|
||||
|
||||
dey
|
||||
|
||||
.5
|
||||
* lda #0
|
||||
sta (ZPPtr2),y
|
||||
|
||||
tya
|
||||
rts
|
||||
*--------------------------------------
|
||||
AppendPath ldx #0
|
||||
@ -654,21 +690,6 @@ AppendPath ldx #0
|
||||
|
||||
.5 rts
|
||||
*--------------------------------------
|
||||
SetReqLen lda ZPReqLen
|
||||
sec
|
||||
sbc LenOfs
|
||||
|
||||
ldy LenOfs
|
||||
sta (ZPReqPtr),y
|
||||
|
||||
iny
|
||||
|
||||
lda ZPReqLen+1
|
||||
sbc #0
|
||||
sta (ZPReqPtr),y
|
||||
|
||||
bra SetReqLenNETBIOS
|
||||
*--------------------------------------
|
||||
* Y = LEN from S.NETBIOS.TYPE
|
||||
* A = Ptr to LEN Word
|
||||
*--------------------------------------
|
||||
@ -691,12 +712,12 @@ SetReqLenYAtA sty ZPReqLen
|
||||
iny
|
||||
lda #0
|
||||
sta (ZPReqPtr),y
|
||||
bra SetReqLenNETBIOS
|
||||
bra SetReqLen
|
||||
*--------------------------------------
|
||||
SetT2ReqLenYA sty ZPReqLen
|
||||
stz ZPReqLen+1
|
||||
|
||||
tya
|
||||
SetT2ReqLen lda ZPReqLen
|
||||
sec
|
||||
sbc #S.NETBIOS+S.SMB.H+SMB.Trans2.H.Len+7
|
||||
|
||||
@ -712,13 +733,13 @@ SetT2ReqLenYA sty ZPReqLen
|
||||
|
||||
ldy #S.NETBIOS+S.SMB.H+SMB.Trans2.H.Len+2
|
||||
sta (ZPReqPtr),y
|
||||
|
||||
SetReqLenNETBIOS
|
||||
lda ZPReqLen
|
||||
*--------------------------------------
|
||||
SetReqLen lda ZPReqLen
|
||||
sec
|
||||
sbc #S.NETBIOS
|
||||
ldy #S.NETBIOS.LEN+2
|
||||
sta (ZPReqPtr),y
|
||||
|
||||
lda ZPReqLen+1
|
||||
sec
|
||||
sbc /S.NETBIOS
|
||||
@ -733,7 +754,7 @@ Sleep ldy #S.PS.PID
|
||||
|
||||
dec CIFS.Status
|
||||
|
||||
stz CIFS.Retries
|
||||
Sleep2 stz CIFS.Retries
|
||||
|
||||
lda #0
|
||||
sec
|
||||
@ -1008,7 +1029,7 @@ SMB.ComCreate.H .DA #24 WORD COUNT
|
||||
.BS 2 NameLength
|
||||
.HS 00000000 Flags
|
||||
.HS 00000000 RootDirectoryFID
|
||||
.BS 4 DesiredAccess
|
||||
.HS 00000010 DesiredAccess = GENERIC_ALL
|
||||
.HS 0000000000000000 AllocationSize
|
||||
.HS 00000000 ExtFileAttributes
|
||||
.HS 00000000 ShareAccess
|
||||
@ -1026,6 +1047,27 @@ SMB.ComClose.H .DA #3 WORD COUNT
|
||||
.HS 0000 ByteCount
|
||||
SMB.ComClose.H.Len .EQ *-SMB.ComClose.H
|
||||
*--------------------------------------
|
||||
SMB.ComFlush.H .DA #1 WORD COUNT
|
||||
.BS 2 FID
|
||||
.HS 0000 ByteCount
|
||||
SMB.ComFlush.H.Len .EQ *-SMB.ComFlush.H
|
||||
*--------------------------------------
|
||||
SMB.ComDelete.H .DA #1 WORD COUNT
|
||||
.HS 0000 SearchAttributes
|
||||
SMB.ComDelete.H.Len .EQ *-SMB.ComDelete.H
|
||||
* .BS 2 ByteCount
|
||||
* .HS 04 BufferFormat
|
||||
* .AZ "path\file"
|
||||
*--------------------------------------
|
||||
SMB.ComRename.H .DA #1 WORD COUNT
|
||||
.HS 0000 SearchAttributes
|
||||
SMB.ComRename.H.Len .EQ *-SMB.ComRename.H
|
||||
* .BS 2 ByteCount
|
||||
* .HS 04 BufferFormat
|
||||
* .AZ "oldpath"
|
||||
* .HS 04 BufferFormat
|
||||
* .AZ "newpath"
|
||||
*--------------------------------------
|
||||
SMB.ComRead.H .DA #10 WORD COUNT
|
||||
.HS FF000000 NO MORE CMD
|
||||
.BS 2 FID
|
||||
@ -1042,11 +1084,11 @@ SMB.ComWrite.H .DA #12 WORD COUNT
|
||||
.BS 2 FID
|
||||
.BS 4 Offset
|
||||
.HS 00000000 Timeout
|
||||
.HS 0001 WriteMode=WritethroughMode
|
||||
.HS 0100 WriteMode=WritethroughMode
|
||||
.HS 0000 Remaining
|
||||
.HS 0000 Reserved
|
||||
.BS 2 DataLength
|
||||
.BS 2 DataOffset
|
||||
.DA S.SMB.H+SMB.ComWrite.H.Len DataOffset
|
||||
SMB.ComWrite.H.Len .EQ *-SMB.ComWrite.H
|
||||
* .BS 2 ByteCount
|
||||
* DATA.....
|
||||
|
@ -43,11 +43,15 @@ PFT.CheckPathYA >PUSHYA
|
||||
|
||||
bra .8
|
||||
|
||||
.3 lda K.Buf256,y path is "/FILTER/..." ?
|
||||
cmp #'/'
|
||||
.3 lda K.Buf256,y
|
||||
beq .4 path is "/FILTER" ?
|
||||
|
||||
cmp #'/' path is "/FILTER/..." ?
|
||||
bne .8
|
||||
|
||||
lda Flt.Table.cbLO-1,x
|
||||
iny
|
||||
|
||||
.4 lda Flt.Table.cbLO-1,x
|
||||
sta .7+1
|
||||
|
||||
lda Flt.Table.cbHI-1,x
|
||||
@ -57,9 +61,8 @@ PFT.CheckPathYA >PUSHYA
|
||||
|
||||
pla discard JSR return @
|
||||
pla
|
||||
|
||||
lda /K.Buf256 pass full path to handler
|
||||
iny skip "/"
|
||||
* ldy #K.Buf256
|
||||
|
||||
.6 ldx #$ff SELF MODIFIED SYSCALL #
|
||||
|
||||
|
@ -311,6 +311,7 @@ STDIO.Get1 >PUSHA
|
||||
>PUSHA
|
||||
inc read 1 byte
|
||||
>PUSHA
|
||||
ldx #SYS.FRead
|
||||
jmp K.FRead
|
||||
*/--------------------------------------
|
||||
* # ungetc
|
||||
@ -834,6 +835,7 @@ K.PrintF.1 sec format string->ptr2
|
||||
>PUSHA
|
||||
>PUSHWI K.IOBuf
|
||||
>PUSHW PrintF.Cnt Writing to File/dev...
|
||||
ldx #SYS.FWrite Needed by PFT
|
||||
jsr K.FWrite
|
||||
bcc .81
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user