Checking syntax for 1541 and more...

ruud.baltissen_at_abp.nl
Date: 2007-08-24 09:55:26

Hallo allemaal,  


A question for those who love to tinker with bits and bytes:

At $FE89 you find the table with valid commands for the 1541. Followed
with a table with the low bytes of the addresses where the code for
these commands is found, followed by the high bytes of these addresses.
Then you find some bytes used in the "Check syntax" routine, starting at
$C268. This routine fills a variable, called IMAGE, with bits and these
bits are checked later against the bytes mentioned above.

;** check input line           
;
; Settings of IMAGE ($028B) after check:
;
; bit  meaning
; ---  -------------------------
;  7   found wildcard (Y=1)              \
;  6   more then one file implied (Y=1)   |  file #1
;  5   Drive # specified                  |
;  4   filename given                    /
;  3   found wildcard (Y=1)              \
;  2   more then one file implied (Y=1)   |  file #2
;  1   Drive # specified                  |
;  0   filename given                    /

...... <snip>

L_C24C          ora     #$03            ; set bit 0 and 1
                eor     IMAGE
                sta     IMAGE           ; flag syntax test

L_C254          lda     IMAGE
                ldx     INSTRU
                and     CmdAddrHB+4,X   ; combine with checkbyte
                bne     L_C260          ; faulty syntax, ->

                rts

L_C260          sta     ERWORD          ; set error flag
                lda     #$30
                jmp     OutputErrorMsg  ; 30, 'Syntax error'



;** table of command words
[FE89]
TblCommands
.by "V"                                 ; Validate
.by "I"                                 ; Initialize
.by "D"                                 ; D (back up, not used)
.by "M"                                 ; Memory
.by "B"                                 ; Block
.by "U"                                 ; User
.by "P"                                 ; Position
.by "&"                                 ; USR execute
.by "C"                                 ; Copy
.by "R"                                 ; Rename
.by "S"                                 ; Scratch
.by "N"                                 ; New (Format)


;**  low byte of command addresses
CmdAddrLB       .BY <(Validate)
                .BY <(Initialize)
                .BY <(SyntaxError)
                .BY <(Memory)
                .BY <(Block)
                .BY <(User)
                .BY <(Position)
                .BY <(USRexec)
                .BY <(Copy)
                .BY <(Rename)
                .BY <(Scratch)
                .BY <(New)


;**  high byte of command addresses
[FEA1]
CmdAddrHB       .BY >(Validate)
                .BY >(Initialize)
                .BY >(SyntaxError)
                .BY >(Memory)
                .BY >(Block)
                .BY >(User)
                .BY >(Position)
                .BY >(USRexec)
                .BY >(Copy)
                .BY >(Rename)
                .BY >(Scratch)
                .BY >(New)


;** bytes for syntax check
.BY $51, $DD, $1C, $9E, $1C
;
;    ^                   ^
;    |                   |
;    +-------------------+---- why are these here?

;** file control methods
A_FEB2          .BY $52,$57,$41,$4D     ; "RWAM"


My idea is that the first byte was used for the COPY command but
discarded later because the routines at $C8F0 uses its own method to
check IMAGE.
But where is the last byte used for? As you can see it is followed by
characters Read, Write, Append and Modify. No connection with these
IMHO.


At $F10F a buffer is selected for loading the BAM. The result is always
13. IIRC the BAM was always loaded at $0700. Can anybody shine a light
on this, please?


--
     ___
    / __|__
   / /  |_/     Groetjes, Ruud
   \ \__|_\
    \___|       URL: Ruud.C64.org

  

De informatie in dit e-mailbericht is vertrouwelijk en uitsluitend bestemd voor de geadresseerde. Wanneer u dit bericht per abuis ontvangt, verzoeken wij u contact op te nemen met de afzender per kerende e-mail. Verder verzoeken wij u in dat geval dit e-mailbericht te vernietigen en de inhoud ervan aan niemand openbaar te maken. Wij aanvaarden geen aansprakelijkheid voor onjuiste, onvolledige dan wel ontijdige overbrenging van de inhoud van een verzonden e-mailbericht, noch voor daarbij overgebrachte virussen.

Stichting Pensioenfonds ABP is gevestigd te Heerlen en ingeschreven bij de Kamer van Koophandel Zuid Limburg onder nummer: 41074000


The information contained in this e-mail is confidential and may be privileged. It may be read, copied and used only by the intended recipient. If you have received it in error, please contact the sender immediately by return e-mail; please delete in this case the e-mail and do not disclose its contents to any person. We don't accept liability for any errors, omissions, delays of receipt or viruses in the contents of this message which arise as a result of e-mail transmission.

Stichting Pensioenfonds ABP, having its registered office at Heerlen, is registered in the Traderegister of the Chamber of Commerce Zuid Limburg (Maastricht), the Netherlands, registration number: 41074000





       Message was sent through the cbm-hackers mailing list

Archive generated by hypermail pre-2.1.8.