Global memory map for the 8250: IP (interface processor) 00xx: zero page 01xx: stack 02xx: I/O chips 020x: RIOT for IEEE 0200: IEEE data in 0202: IEEE data out 028x: RIOT for IEEE and floppy disk controller 0280: DDR is #$1F 0: out ATN out?? 1: out NDAC out? 2: out NRFD out? 3: out EOI out 4: out DAV out? 5: in EOI in 6: in DAV in? 7: in ATN in? 0282: DDR is #$38 0: in \ 1: in | Device # bits in 2: in / 3: out drive 1 led (1 is on) 4: out drive 0 led 5: out error led out 6: in NDAC in? 7: in NRFD in? C000-FFFF: ROM FDC (floppy disk controller) 0000-003F: zero page (partial) 004x: VIA 0040: Port B, DDR is #$7F 0: out \ stepper motor 1: out / control #1 ? 2: out \ stepper motor 3: out / control #0 ? 4: out 5: out 6: out 7: in index hole ??? 0041: Port A: disk data read 0042: DDRB #$7F 0043: DDRA 004B: ACR, set to #$01 %0000 0001 T1: PB7 unused, one shot T2: one shot Shift register disabled Port B latch: disabled Port A latch: enabled on CA1 transition 004C: PCR, set to #$FC %1111 1100 CB2: out manual 1 CB1: active high CA2: out manual 0 CA2 is write gate ($DC = CA2 low = write?) CA1: active low 004D: IFR 008x: RIOT 0080: disk data write 0082: port B 0: out drive select 1: out \ 2: out / density select 3: in 1 = write protected 4: in 1 = drive type 1 (2c format), 0 = drive type 0 (2a format) 4: out side select (1 = trk 1-77, 0 = trk 78-154) 5: 6: in 0 = 2 sided drive, 1 = 1 sided drive 7: 0083: ddr B, set to #$07 (drive type 0) or #$17 (type 1) 008F: riot t8 0100-013F: stack FC00-FFFF: ROM Shared memory: FDC IP 04xx 10xx Shared variables 05xx 11xx Buffer #0 06xx 12xx Buffer #1 07xx 13xx Buffer #2 1dxx Buffer #0 shadow 1exx Buffer #1 shadow 1fxx Buffer #2 shadow 08xx 20xx Buffer #3 09xx 21xx Buffer #4 0Axx 22xx Buffer #5 0Bxx 23xx Buffer #6 0Cxx 30xx Buffer #7 0Dxx 31xx Buffer #8 0Exx 32xx Buffer #9 0Fxx 33xx Buffer #a 10xx 40xx Buffer #b 11xx 41xx Buffer #c bam/header drive 0 12xx 42xx Buffer #d bam/header drive 1 13xx 43xx Buffer #e command buffer + ip variables Job codes and return values: 80 00 READ a sector 90 10 WRITE a sector A0 20 VERIFY a sector B0 30 SEEK a sector C0 40 BUMP (move) head to track 0 D0 50 JUMP to machine code in buffer E0 60 EXECUTE code in buffer once up to speed and head ready 01 job completed successfully 02 header block not found 03 no SYNC character 04 data block not found 05 data block checksum error 07 verify error after write 08 write protect error 09 header block checksum error 0A data block too long 0B ID mismatch error 0C format speed error 0F drive not ready 10 byte decoding error DRVST: disk drive status 4 10 shut down drive motor? 1=yes 5 20 drive motor 1=on 6 40 head stepping 1=on 7 80 drive up to speed 1=no How did I extract those ROMs? 1. The IP rom is easy: you can do that with M-R. I used KosMon which knows to read/write the drive's memory already, and simply did a T C000 FFFF 5000 to transfer the contents. 2. The FDC memory is slightly more difficult. You can't access that directly, so I wrote a small program: 1200 ldx #$00 1202 lda $ff00,x sta $0700,x dex bne $1202 lda #$01 jmp ($fc02) This runs at $0600 (buffer #1) of the FDC if you write D0 into 1004. A page of memory can then be read from $1300, again with M-R. Having a commented disassembly of the 1541 roms, or a good description such as in "Inside Commodore DOS", by Richard Immers and Gerald G Neufield, ISBN 0-88190-366-3, published 1984 by Datamost, 20660 Nordhoff Street, Chatsworth, CA 91311-6152, +1-818-709-1202, is an invaluable help. There is too much I/O going on. It looks from a software point of view that there are 4 pairs of I/O ports. On the hardware side however one finds only 2 RIOTs and 1 VIA, which is one pair short. -Olaf. -- ___ Olaf 'Rhialto' Seibert rhialto@mbfys.kun.nl What's the use of \X/ racism if you can't even see if a person belongs to your abhorred kind?