Re: Checking syntax for 1541 and more...

From: William Levak (wlevak_at_sdf.lonestar.org)
Date: 2007-08-25 01:33:50

On Fri, 24 Aug 2007, ruud.baltissen@abp.nl wrote:

>
> 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)


"D" is for "Duplicate". On dual drive units, the drive could copy an 
entire disk on it's own.  Also on dual drive units, most of the commands 
could operate on a file on one drive and put the result on the other 
drive.  The command structure probably allowed for two files on all 
commands as a simplified command structure.  When Commodore introduced 
single drive units, the disk operating system simply did not use the 
second drive information.



wlevak@sdf.lonestar.org
SDF Public Access UNIX System - http://sdf.lonestar.org

       Message was sent through the cbm-hackers mailing list

Archive generated by hypermail pre-2.1.8.