home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 2 / goldfish_vol2_cd2.bin / bbs / util / acmautils.lha / AcmaUtils / Source / ListLibs.s < prev    next >
Encoding:
Text File  |  1994-03-05  |  1.8 KB  |  103 lines

  1. ;
  2. ; ListLibs V1.00  Saturday 03-Jul-93
  3. ;
  4. ; Lists libraries in the memory
  5. ;
  6.  
  7.  
  8.   XREF _LVOOpenLibrary
  9.   XREF _LVOOldOpenLibrary
  10.   XREF _LVOCloseLibrary
  11.   XREF _LVOOutput
  12.   XREF _LVOWrite
  13.   XREF _LVOVPrintf
  14.  
  15. ListLib
  16.   move.l  4,a6
  17.   lea     DosName(pc),a1
  18.   moveq.l #36,d0
  19.   jsr     _LVOOpenLibrary(a6)
  20.   move.l  d0,DosBase
  21.   tst.l   d0
  22.   beq.s   NoDos
  23.  
  24.   move.l  DosBase(pc),a6
  25.   move.l  #HeaderString,d1
  26.   moveq.l #0,d2
  27.   jsr     _LVOVPrintf(a6)
  28.  
  29.   move.l  4,a5
  30. LibLoop
  31.   tst.l   4(a5)
  32.   beq.s   LibsDone
  33.   move.l  10(a5),LibName
  34.   move.l  a5,LibBase
  35.   move.w  20(a5),LibVer
  36.   move.w  22(a5),LibRev
  37.   move.l  #LibString,d1
  38.   move.l  #LibArgs,d2
  39.   jsr     _LVOVPrintf(a6)
  40.   move.l  4(a5),a5
  41.   add.w   #1,LibAmount
  42.   bra.s   LibLoop
  43. LibsDone
  44.   move.l  #FooterString,d1
  45.   move.l  #FooterArgs,d2
  46.   jsr     _LVOVPrintf(a6)
  47.  
  48. Quit
  49.   move.l  4,a6
  50.   move.l  DosBase(pc),a1
  51.   cmp.l   #0,a1
  52.   beq.s   Quit2
  53.   jsr     _LVOCloseLibrary(a6)
  54. Quit2
  55.   moveq.l #0,d0
  56.   rts
  57.  
  58. NoDos
  59.   move.l  #NoDosMessage,d2
  60.   moveq.l #32,d3
  61.   bra.s   PrintError
  62.  
  63.   nop
  64.  
  65. PrintError
  66.   tst.l   DosBase
  67.   bne.s   PrintError2
  68.   move.l  4,a6
  69.   lea     DosName(pc),a1
  70.   jsr     _LVOOldOpenLibrary(a6)
  71.   tst.l   d0
  72.   beq.s   Quit
  73.   move.l  d0,DosBase
  74. PrintError2
  75.   move.l  DosBase(pc),a6
  76.   jsr     _LVOOutput(a6)
  77.   move.l  d0,d1
  78.   jsr     _LVOWrite(a6)
  79.   bra.s   Quit
  80.  
  81.  
  82. DosBase            dc.l 0
  83.  
  84. LibArgs
  85. LibName            dc.l 0
  86. LibBase            dc.l 0
  87. LibVer            dc.w 0
  88. LibRev            dc.w 0
  89.             dc.l 0
  90. FooterArgs
  91. LibAmount        dc.w 0
  92.             dc.l 0
  93.  
  94. DosName            dc.b 'dos.library',0
  95. NoDosMessage        dc.b 'This program needs DOS2.0 (V36)',10,0
  96. HeaderString        dc.b 10,'The list of the resident libraries:',10,10
  97.             dc.b 'Name                              Base     Ve.Rev',10
  98.             dc.b '-------------------------------------------------',10,0
  99. LibString        dc.b '%-30s  $%08lx  %2d.%-3d',10,0
  100. FooterString        dc.b 10,'%d libraries listed.',10,10,0
  101.  
  102.   END
  103.