Plus/4 Kernal Disassembly $ca3f-$cb1e Build ....
Suche
Index
FAQ
Kontakt
Zurück
; $CA3F: Build command
BCMD:   jsr     CDS          ; clear disk status  
        ldx     #$00
        stx     $025D        ; counter for command-len 
LCA47:  lda     DOS Command table,y 
        beq     SCMD         ; get command-chars   
        cmp     #$80          
        beq     SCMD         ; send command-string 
        tax
        dex
        beq     LCA72        ; drive 1 ?
        dex
        beq     LCA78        ; drive 2 ?
        dex
        beq     LCA7E        ; REPLACE ?  
        dex
        beq     LCA85        ; filename 1 if exists   
        dex
        beq     LCA8D        ; filename 1 ? 
        dex
        beq     LCA97        ; filename 2 if exists
        dex
        beq     LCAA5        ; filename 2 ? 
        dex
        beq     LCAAF        ; ID ?  
        dex
        beq     LCAD2
LCA6C:  jsr     LCAEB        ; install command 
LCA6F:  iny
        bne     LCA47
;drive 1
LCA72:  lda     $82
        and     #$10         ; drive number present ? 
        beq     LCA6F        ; no  
LCA78:  lda     $026F        ; get drive number 1
        jmp     LCA81        
;drive 2
LCA7E:  lda     $0273        ; get drive number 2  
LCA81:  ora     #$30         ; to ASCII
        bne     LCA6C        
; replace
LCA85:  lda     #$40         ; get replace code
        bit     $82          ; syntax flag ?
        bmi     LCA6C        ; replace 
        bpl     LCA6F        
; filename 1
LCA8D:  lda     $026E        ; get len of filename 1
        beq     LCA6F
        lda     #$3A         ; get ":"   
        jsr     LCAEB        ; add to command-string
LCA97:  tya
        pha
        lda     $0270        ; get address
        ldy     $0271 
        ldx     $026E        ; get filename-len   
        jmp     LCABA        ; insert filenmae to command-string  
; filename 2
LCAA5:  lda     $0272        ; get len of filename 2
        beq     LCA6F
        lda     #$3A         ; get ":"   
        jsr     LCAEB        ; add to command-string 
LCAAF:  tya
        pha
        lda     $0274        ; get address 
        ldy     $0275
        ldx     $0272        ; get filename-len    
; insert filenmae to command-string  
LCABA:  sta     $22          
        sty     $23
        stx     $80
        ldy     #$00
LCAC2:  jsr     L04B0        ; get char from $22,y
        jsr     LCAEB        ; add char to command-string     
        iny
        cpy     $80          ; end of filename ?
        bne     LCAC2         
        pla
        tay
        jmp     LCA6F          
LCAD2:  lda     $0279        ; get present != 0 
        beq     LCA6F
        lda     #$2C         ; comma 
        jsr     LCAEB        ; add char to command-string       
        lda     $0279        ; 
        jsr     LCAEB        ; add char to command-string     
        lda     $027A        ; get ID 
        jsr     LCAEB        ; add char to command-string      
        jmp     LCA6F            
; add to command-string
LCAEB:  ldx     $025D        ; get offset
        sta     $027C,x      ; adds char 
        inc     $025D
        rts
; DOS Command table
LCAF5:
DOS Command table:
        .byte   "$"           ; DIRECTORY 
        .byte   $07,$05,$00,$04,$02
        .byte   ":"           ; DLOAD, DSAVE   
        .byte   $06,$00
        .byte   "N"           ; HEADER   
        .byte   $02
        .byte   ":"
        .byte   $06,$09,$80
        .byte   "S"           ; SCRATCH  
        .byte   $02
        .byte   ":"
        .byte   $06,$80 
        .byte   "V"           ; COLLECT  
        .byte   $02,$80
        .byte   "C"           ; COPY
        .byte   $03,$07
        .byte   "="
        .byte   $02,$05,$80
        .byte   "R"           ; RENAME
        .byte   $02
        .byte   ":"
        .byte   $08
        .byte   "="           
        .byte   $06,$80
        .byte   "D"           ; BACKUP 
        .byte   $03
        .byte   "="
        .byte   $02,$80

 

Letzte Änderung: 2019-01-06 09:50:59
  Rubrik:  C16
Rubriken-Übersicht
 79 Besucher online 

Valid XHTML 1.0 Transitional Valid CSS!