home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / turbodos / mdrv-td.lbr / MDRVFMT.MZC / MDRVFMT.MAC
Encoding:
Text File  |  1987-11-08  |  1.3 KB  |  51 lines

  1. TITLE    TurboDOS formater for M-Drive/H
  2. ; Assemble with M80 or compatible assembler.
  3. .Z80
  4.  
  5. ; This program formats a 2 Megabyte M-Drive/H to all E5Hs. It is optimized
  6. ; primarily for speed since the whole thing is easily less than 1 allocation
  7. ; block long anyway.
  8.  
  9. ; 09/11/87  Rev 0  Bob Clyne    Initial coding.
  10.  
  11. ; M-Drive ports. Set for whatever ports you are using.
  12.  
  13. HBASE    EQU    040H
  14. HDATA    EQU    HBASE        ;M-drive data port.
  15. HADDR    EQU    HBASE+1        ;M-drive address port.
  16.  
  17.     ASEG
  18.  
  19.     ORG    100H
  20.  
  21. START:    XOR    A        ;Zero the accumulator.
  22.     OUT    (HADDR),A    ;Send to M-drive address port to tell drive
  23.     OUT    (HADDR),A    ;to start at address 0. 
  24.     OUT    (HADDR),A
  25.     LD    B,A        ;Set B to 0.
  26.     LD    C,HDATA        ;Set C to M-drive data port.
  27.     LD    E,250        ;Setup E as loop counter.
  28.     LD    HL,BUFFER    ;Point to buffer.
  29. FMTLP:                ;Format loop.
  30.      REPT    16        ;Each of the following 2 instructions formats
  31.  
  32.     OTIR            ;256 bytes, by repeating them 16 times we
  33.     OTDR            ;format 8K each time through the loop.
  34.  
  35.      ENDM
  36.  
  37.     DEC    E        ;Decrement the loop counter.
  38.     JR    NZ,FMTLP    ;Loop if not done.
  39.     JP    0        ;Reset system if done.
  40.  
  41. ; Buffer contains the format bytes.
  42.  
  43. BUFFER:
  44.      REPT    258
  45.  
  46.     DB    0E5H        ;Value to format to.
  47.  
  48.      ENDM
  49.  
  50.     END
  51.