home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / kaypro / skipmap.lbr / SKIPMAP.PZN / SKIPMAP.PRN
Encoding:
Text File  |  1988-04-19  |  8.6 KB  |  219 lines

  1.  
  2.  
  3.  
  4.  CDL Z80 MACRO III Assembler C12012- 414X                                      Page 1
  5.  86/02/18 00:05:58
  6.  skipmap.asm 2/17/86 bmm
  7.  -1    
  8.  
  9.  
  10.               2     ; 2/17    fixed cleared map on A:    
  11.               3     ; 2/16    FIXED 'ani 80h'
  12.               4     .remark "Patch    bdos to    skip rebuilding    allocation bitmap for
  13.               5         permanently mounted drives. Uses bit 7    of extended
  14.               6         dph for Turborom."
  15.               7     
  16.    0000              8         debug    =\"Debug=1, rel    = 0 ==>    "
  17.               9     
  18.              10     .phex
  19.              11     
  20.              28         .xlink
  21.              29     ;
  22.    0000'         30     origin:
  23.    0200'         31     ccpbase = origin+200h
  24.    0A00'         32     bdoslc     = origin+200h+800h
  25.    0C8A'         33     patch     = bdoslc+28ah         ;first    free byte
  26.    0CCD'         34     patche     = bdoslc+2cdh         ;last free byte
  27.    10A3'        158         .LOC     BITMAP
  28.             159     ;
  29.    10A3' C3 0C8A'   160         jmp     skpmap         ;returns to bitmap caller if not A:
  30.             161                     ;  and    map already built
  31.    10A6' 0E03        162     BITM0A: mvi     c,3         ; hl =    dsksiz
  32.    10A8' CD 0EEA'   163         call     shiftr
  33.    10AB' 23        164         inx     h
  34.    10AC' 44        165         mov     b,h
  35.    10AD' 4D        166         mov     c,l
  36.    10AE' 2A 17BF'   167         lhld     alocvect
  37.    10B1' 3600        168     ..1:     mvi     m,0
  38.    10B3' 23        169         inx     h
  39.    10B4' 0B        170         dcx     b
  40.    10B5' 78        171         mov     a,b
  41.    10B6' B1        172         ora     c
  42.    10B7' C2 10B1'   173         jnz     ..1
  43.    10BA' 2A 17CA'   178         lhld     alloc0         ;general DateStamper must match here
  44.    10BD' EB        179         xchg
  45.    10BE' 2A 17BF'   180         lhld     alocvect
  46.    10C1' 73        181         mov     m,e
  47.    10C2' 23        182         inx     h
  48.    10C3' 72        183         mov     m,d
  49.    10C4' CD 0DA1'   188         call     homedrv     ; and here
  50.    10C7' 2A 17B3'   189         lhld     scrat1
  51.    10CA' 3603        190         mvi     m,3
  52.    10CC' 23        191         inx     h
  53.    10CD' 77        192         mov     m,a         ;homedrv returns with A=0
  54.    10CE' CD 0FFE'   193         call     stfilpos
  55.             194     ;
  56.    10D1' 0EFF        195     ..2:     mvi     c,0ffh         ;loop over the    directory
  57.    10D3' CD 1005'   196         call     nxentry
  58.    10D6' CD 0FF5'   197         call     ckfilpos
  59.    10D9' 2820        198         jrz     setbit         ;no more files    - exit
  60.    10DB' CD 0F5E'   199         call     fcb2hl
  61.    10DE' 3EE5        200         mvi     a,0E5h
  62.    10E0' BE        201         cmp     m
  63.    10E1' 28EE        202         jrz     ..2
  64.  
  65.  
  66.  
  67.  CDL Z80 MACRO III Assembler C12012- 414X                                      Page 2
  68.  86/02/18 00:05:58
  69.  skipmap.asm 2/17/86 bmm
  70.  -2    
  71.  
  72.  
  73.    10E3' 3A 0D41'   203         lda     userno
  74.    10E6' BE        204         cmp     m
  75.    10E7' 200A        205         jrnz     ..3
  76.    10E9' 23        206         inx     h
  77.    10EA' 7E        207         mov     a,m
  78.    10EB' D624        208         sui     '$'
  79.    10ED' 2004        209         jrnz     ..3
  80.    10EF' 3D        210         dcr     a         ;show submit clue in returned STATUS
  81.    10F0' 32 0D45'   211         sta     status
  82.    10F3' CD 0CA2'   212     ..3:     call     skipa         ;set bitmap, unless hard A: already built
  83.    10F6' CD 0F8C'   213         call     chknmbr
  84.    10F9' 18D6        214         jr     ..2
  85.             215     ;
  86.             216     ; (use    free space for:)
  87.             217     ;
  88.             218     ; On exit from    bitmap routine,
  89.             219     ; set the "don't-need-to-rebuild" bit for active drive.
  90.             220     ;
  91.    10FC'        221     xdph =    .+1
  92.    10FB' 21 0000    222     SETBIT: lxi     h,0000         ;set map-built    bit
  93.    10FE' CBFE        223         set     7,m
  94.    1100' C9        224         ret             ;assumes Z flag not needed on return
  95.             225     ;
  96.    0000            226     bmfre = (bdoslc+0701h)    - .
  97.    0D63'        238         .LOC     SELCT0         ;following 'call seldsk'
  98.             239                     ;and bad-drive    test
  99.    0D63' 2B        240         dcx     h
  100.    0D64' 2B        241         dcx     h
  101.    0D65' 22 10FC'   242         shld     xdph         ;save extended    dph addr
  102.    0D68' 01 0002    243         lxi     b,2         ;shorter
  103.    0D6B' 09        244         dad     b
  104.    0D6C' 5E        245         mov     e,m
  105.    0D6D' 23        246         inx     h
  106.    0D6E' 56        247         mov     d,m
  107.    0D6F' 23        248         inx     h
  108.    0D70' 22 17B3'   249         shld     scrat1         ;scratch1
  109.    0D73' 09        250         dad     b
  110.    0D74' 22 17B5'   251         shld     scrat2
  111.    0D77' 09        252         dad     b
  112.    0D78' 22 17B7'   253         shld     scrat3
  113.    0D7B' 09        254         dad     b
  114.    0D7C' EB        255         xchg
  115.    0D7D' 22 17D0'   256         shld     xlate
  116.    0D80' 21 17B9'   257         lxi     h,dirbuf
  117.    0D83' 0E08        258         mvi     c,8
  118.    0D85' CD 0D4F'   259         call     de2hl
  119.    0D88' ED5B 17BB' 260         lded     diskpb
  120.    0D8C' 21 17C1'   261         lxi     h,sectrs     ;sectors
  121.    0D8F' 0E0F        262         mvi     c,15
  122.    0D91' CD 0D4F'   263         call     de2hl         ;returns with c=0
  123.    0D94' 3A 17C7'   264         lda     dsksiz    + 1     ;shortened here...
  124.    0D97' 21 17DD'   265         lxi     h,bigdsk
  125.    0D9A' 71        266         mov     m,c         ;set bigdisk =    c = 0 for >255 spg
  126.    0D9B' B7        267         ora     a
  127.  
  128.  
  129.  
  130.  CDL Z80 MACRO III Assembler C12012- 414X                                      Page 3
  131.  86/02/18 00:05:58
  132.  skipmap.asm 2/17/86 bmm
  133.  -3    
  134.  
  135.  
  136.    0D9C' 2001        268         jrnz     selct1
  137.    0D9E' 35        269         dcr     m         ;set bigdisk =    0ff if <= 255
  138.    0D9F' B6        270     selct1: ora     m         ;set NZ = good    select in both cases
  139.    0DA0' C9        271         ret
  140.             272         ;
  141.    0000            273     selfre    = (bdoslc+3a1h)    - .         ; 0 ?
  142.    0C8A'        296         .loc     PATCH
  143.             297     ;
  144.    0C8A' 3A 0D42'   298     SKPMAP: lda     active
  145.    0C8D' B7        299         ora     a
  146.    0C8E' 2008        300         jrnz     ..b
  147.             301     ;
  148.             302     ; drive A:
  149.             303     ;
  150.    0C90' CD 0CB1'   304     ..a:     call     dontskip     ;and first-timers and floppies
  151.    0C93' 2007        305         jrnz     ..x         ;1st-time, continue
  152.    0C95' C3 10BA'   306         jmp     BITM1A         ;skip clearing    the A: bitmap
  153.             307     ;
  154.             308     ; all other drives
  155.             309     ;
  156.    0C98' CD 0CB1'   310     ..b:     call     dontskip
  157.    0C9B' C8        311         rz             ;already built    - return to BITMAP'S CALLER
  158.    0C9C' 2A 17C6'   312     ..x:     lhld     dsksize     ;overlayed instr.
  159.    0C9F' C3 10A6'   313         jmp     BITM0A         ;go back to next sequential instr in BITMAP
  160.             314     ;
  161.             315     ;
  162.             316     ; If drive A:,    a hard drive, and map already built,
  163.             317     ;     skip building map.
  164.             318     ; Else    build it.
  165.             319     ;
  166.    0CA2' 3A 0D42'   320     SKIPA:     lda     active         ;f A:
  167.    0CA5' B7        321         ora     a
  168.    0CA6' 2004        322         jrnz     ..0
  169.    0CA8' CD 0CB1'   323         call     dontskip     ;..and    already    built
  170.    0CAB' C8        324         rz             ;..skip rebuild
  171.    0CAC' 0E01        325     ..0:     mvi     c,1         ;c=1 to
  172.    0CAE' C3 106B'   326         jmp     setfile     ;.. set the bits
  173.             327     ;
  174.             328     ; return NZ if    map must be built, Z if    ok to skip
  175.             329     ;
  176.    0CB1'        330     dontskip:
  177.    0CB1' 2A 17CC'   331         lhld     cks         ;if # check dir. entries >0
  178.    0CB4' 7C        332         mov     a,h
  179.    0CB5' B5        333         ora     l
  180.    0CB6' C0        334         rnz
  181.    0CB7' 2A 10FC'   335         lhld     xdph         ;or drive not yet logged in
  182.    0CBA' 7E        336         mov     a,m
  183.    0CBB' EE80        337         xri     80h         ;reverse sense    of bit
  184.    0CBD' E680        338         ani     80h
  185.    0CBF' C9        339         ret             ;NZ if    bit is NOT set
  186.             340     ;
  187.    0036            341     needed    = .-patch         ;space    needed in bios/bdos holes
  188.    000E            342     unused    = patche+1-.
  189.             348         .end
  190.  
  191.  
  192.  
  193.  CDL Z80 MACRO III Assembler C12012- 414X                                      Page 4
  194.  86/02/18 00:05:58
  195.  skipmap.asm 2/17/86 bmm
  196.  -4    +++++ Symbol Table +++++
  197.  
  198.  
  199.    ACTIVE 0D42'           ALLOC0 17CA'       ALOCVE 17BF'           BACKUP 0BA4'       BDOSLC 0A00'        
  200.    BIGDSK 17DD'           BITM0A 10A6'       BITM1A 10BA'           BITM1B 10C4'       BITMAP 10A3'        
  201.    BMFRE  0000           CCP    0200'       CCP3      0203'           CCPBAS 0200'       CHARBU 0D0E'        
  202.    CHKNMB 0F8C'           CHKROF 0F44'       CHKVEC 17BD'           CHKWPR 0F54'       CKCONS 0B23'        
  203.    CKFILP 0FF5'           CKS    17CC'       CLOSEF 17D2'           COUNTE 17D8'       CURPOS 0D0C'        
  204.    DE2HL  0D4F'           DEBUG  0000       DELFIL 16D7'           DIRBUF 17B9'       DIRWRI 0FC6'        
  205.    DISKPB 17BB'           DONTSK 0CB1'       DOWRIT 0DB8'           DSKSIZ 17C6'       ERROR5 0AB4'        
  206.    EXTMAS 17C5'           FCB2HL 0F5E'       FILEPO 17EA'           FINDFS 1118'       FINDNX 112D'        
  207.    FNDSTA 17D4'           GETCHA 0AFB'       GETEMP 1324'           GETNEX 135A'       GETRDR 0CCE'        
  208.    GETS2  0F69'           GOBACK 1791'       HOMEDR 0DA1'           IOERR1 0D05'       MODE      17D5'        
  209.    MOREFL 0F7F'           NEEDED 0036       NEWLIN 0BB1'           NXENTR 1005'       OPENIT 125A'        
  210.    ORIGIN 0000'           OUTCHA 0B48'       OUTFLA 0D0A'           PARAMS 0D43'       PATCH  0C8A'        
  211.    PATCHE 0CCD'           PRTFLA 0D0D'       RDBUFF 0BE1'           RDWRTF 17D3'       READER 1815'        
  212.    SAMEXT 1107'           SAVEFC 17D9'       SAVNRE 17E3'           SAVNXT 17E1'       SCRAT1 17B3'        
  213.    SCRAT2 17B5'           SCRAT3 17B7'       SECTRS 17C1'           SELCT0 0D63'       SELCT1 0D9F'        
  214.    SELFRE 0000           SETBIT 10FB'       SETFIL 106B'           SETNRE 0ED2'       SETS2B 0F78'        
  215.    SETSTA 0D01'           SHIFTR 0EEA'       SHOWIT 0B7F'           SKIPA  0CA2'       SKPMAP 0C8A'        
  216.    STARTI 0D0B'           STATUS 0D45'       STFILP 0FFE'           STRDAT 0EBB'       TRKSEC 0DD1'        
  217.    UNUSED 000E           USERNO 0D41'       USRSTK 0D0F'           WTSEQ6 146E'       WTSPEC 179B'        
  218.    XDPH      10FC'           XLATE  17D0'       
  219.