home *** CD-ROM | disk | FTP | other *** search
- ;
- ; ListLibs V1.00 Saturday 03-Jul-93
- ;
- ; Lists libraries in the memory
- ;
-
-
- XREF _LVOOpenLibrary
- XREF _LVOOldOpenLibrary
- XREF _LVOCloseLibrary
- XREF _LVOOutput
- XREF _LVOWrite
- XREF _LVOVPrintf
-
- ListLib
- move.l 4,a6
- lea DosName(pc),a1
- moveq.l #36,d0
- jsr _LVOOpenLibrary(a6)
- move.l d0,DosBase
- tst.l d0
- beq.s NoDos
-
- move.l DosBase(pc),a6
- move.l #HeaderString,d1
- moveq.l #0,d2
- jsr _LVOVPrintf(a6)
-
- move.l 4,a5
- LibLoop
- tst.l 4(a5)
- beq.s LibsDone
- move.l 10(a5),LibName
- move.l a5,LibBase
- move.w 20(a5),LibVer
- move.w 22(a5),LibRev
- move.l #LibString,d1
- move.l #LibArgs,d2
- jsr _LVOVPrintf(a6)
- move.l 4(a5),a5
- add.w #1,LibAmount
- bra.s LibLoop
- LibsDone
- move.l #FooterString,d1
- move.l #FooterArgs,d2
- jsr _LVOVPrintf(a6)
-
- Quit
- move.l 4,a6
- move.l DosBase(pc),a1
- cmp.l #0,a1
- beq.s Quit2
- jsr _LVOCloseLibrary(a6)
- Quit2
- moveq.l #0,d0
- rts
-
- NoDos
- move.l #NoDosMessage,d2
- moveq.l #32,d3
- bra.s PrintError
-
- nop
-
- PrintError
- tst.l DosBase
- bne.s PrintError2
- move.l 4,a6
- lea DosName(pc),a1
- jsr _LVOOldOpenLibrary(a6)
- tst.l d0
- beq.s Quit
- move.l d0,DosBase
- PrintError2
- move.l DosBase(pc),a6
- jsr _LVOOutput(a6)
- move.l d0,d1
- jsr _LVOWrite(a6)
- bra.s Quit
-
-
- DosBase dc.l 0
-
- LibArgs
- LibName dc.l 0
- LibBase dc.l 0
- LibVer dc.w 0
- LibRev dc.w 0
- dc.l 0
- FooterArgs
- LibAmount dc.w 0
- dc.l 0
-
- DosName dc.b 'dos.library',0
- NoDosMessage dc.b 'This program needs DOS2.0 (V36)',10,0
- HeaderString dc.b 10,'The list of the resident libraries:',10,10
- dc.b 'Name Base Ve.Rev',10
- dc.b '-------------------------------------------------',10,0
- LibString dc.b '%-30s $%08lx %2d.%-3d',10,0
- FooterString dc.b 10,'%d libraries listed.',10,10,0
-
- END
-