$E207/57863:   Perform [P] - Position command

E207: 20 B3 C2  JSR $C2B3       ; verify lines
E20A: AD 01 02  LDA $0201       ; secondary address
E20D: 85 83     STA $83
E20F: 20 EB D0  JSR $D0EB       ; find channel number
E212: 90 05     BCC $E219       ; found?
E214: A9 70     LDA #$70
E216: 20 C8 C1  JSR $C1C8       ; 70, 'no block'

Jump from $E212:

E219: A9 A0     LDA #$A0
E21B: 20 9D DD  JSR $DD9D       ; erase bits 6 & 7
E21E: 20 25 D1  JSR $D125       ; verify if 'REL'-file
E221: F0 05     BEQ $E228       ; yes
E223: A9 64     LDA #$64
E225: 20 C8 C1  JSR $C1C8       ; 64, 'file type mismatch'

Jump from $E221:

E228: B5 EC     LDA $EC,X
E22A: 29 01     AND #$01
E22C: 85 7F     STA $7F         ; drive number
E22E: AD 02 02  LDA $0202       ; record number lo
E231: 95 B5     STA $B5,X
E233: AD 03 02  LDA $0203       ; record number hi
E236: 95 BB     STA $BB,X
E238: A6 82     LDX $82         ; channel number
E23A: A9 89     LDA #$89
E23C: 95 F2     STA $F2,X       ; READ and WRITE flag
E23E: AD 04 02  LDA $0204       ; byte-pointer
E241: F0 10     BEQ $E253       ; zero?
E243: 38        SEC
E244: E9 01     SBC #$01
E246: F0 0B     BEQ $E253
E248: D5 C7     CMP $C7,X       ; compare with record length
E24A: 90 07     BCC $E253
E24C: A9 51     LDA #$51
E24E: 8D 6C 02  STA $026C       ; 51, 'overflow in record'
E251: A9 00     LDA #$00

Jump from $E241, $E246, $E24A:

E253: 85 D4     STA $D4
E255: 20 0E CE  JSR $CE0E       ; calculate pointer in rel-file
E258: 20 F8 DE  JSR $DEF8       ; and read appropriate side-sector
E25B: 50 08     BVC $E265       ; does block exist?
E25D: A9 80     LDA #$80
E25F: 20 97 DD  JSR $DD97       ; set bit 7
E262: 4C 5E E1  JMP $E15E       ; and 50, 'record not present'

Jump from $E25B:

E265: 20 75 E2  JSR $E275
E268: A9 80     LDA #$80
E26A: 20 A6 DD  JSR $DDA6       ; test bit 7
E26D: F0 03     BEQ $E272       ; not set
E26F: 4C 5E E1  JMP $E15E       ; 50, 'record not present'

Jump from $E26D:

E272: 4C 94 C1  JMP $C194       ; done

Jump from $E265, $E441:

E275: 20 9C E2  JSR $E29C
E278: A5 D7     LDA $D7         ; pointer in rel-file
E27A: 20 C8 D4  JSR $D4C8       ; set buffer pointer
E27D: A6 82     LDX $82         ; channel number
E27F: B5 C7     LDA $C7,X       ; record length
E281: 38        SEC
E282: E5 D4     SBC $D4         ; minus position
E284: B0 03     BCS $E289       ; positive?
E286: 4C 02 E2  JMP $E202       ; 67, 'illegal track or sector'

Jump from $E284:

E289: 18        CLC
E28A: 65 D7     ADC $D7         ; add pointer in data block
E28C: 90 03     BCC $E291       ; no overflow
E28E: 69 01     ADC #$01        ; plus 2
E290: 38        SEC

Jump from $E28C:

E291: 20 09 E0  JSR $E009       ; set pointer
E294: 4C 38 E1  JMP $E138       ; get byte from buffer
E297: A9 51     LDA #$51
E299: 20 C8 C1  JSR $C1C8       ; 51, 'overflow in record'

Jump from $E275, $CA6C, $E322:

E29C: A5 94     LDA $94         ; buffer pointer lo
E29E: 85 89     STA $89
E2A0: A5 95     LDA $95         ; buffer pointer hi
E2A2: 85 8A     STA $8A
E2A4: 20 D0 E2  JSR $E2D0       ; compare track and sector
E2A7: D0 01     BNE $E2AA       ; not equal?
E2A9: 60        RTS

Jump from $E2A7:

E2AA: 20 F1 DD  JSR $DDF1
E2AD: 20 0C DE  JSR $DE0C
E2B0: A5 80     LDA $80         ; track
E2B2: F0 0E     BEQ $E2C2       ; no block following?
E2B4: 20 D3 E2  JSR $E2D3       ; compare track and sector number
E2B7: D0 06     BNE $E2BF       ; not equal?
E2B9: 20 1E CF  JSR $CF1E       ; change buffer
E2BC: 4C DA D2  JMP $D2DA

Jump from $E2B7:

E2BF: 20 DA D2  JSR $D2DA

Jump from $E2B2:

E2C2: A0 00     LDY #$00
E2C4: B1 89     LDA ($89),Y     ; track
E2C6: 85 80     STA $80
E2C8: C8        INY
E2C9: B1 89     LDA ($89),Y     ; and sector of the next block
E2CB: 85 81     STA $81
E2CD: 4C AF D0  JMP $D0AF       ; read block

Jump from $E2A4:

E2D0: 20 3E DE  JSR $DE3E

Jump from $E2B4:

E2D3: A0 00     LDY #$00
E2D5: B1 89     LDA ($89),Y     ; track number
E2D7: C5 80     CMP $80         ; compare
E2D9: F0 01     BEQ $E2DC
E2DB: 60        RTS

Jump from $E2D9:

E2DC: C8        INY
E2DD: B1 89     LDA ($89),Y     ; sector number
E2DF: C5 81     CMP $81         ; compare
E2E1: 60        RTS

    Previous Page / Next Page