home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD2.bin / bbs / dev / tbsource.lha / TBSource / OpenWB / OpenWB.S < prev   
Text File  |  1993-12-21  |  2KB  |  87 lines

  1. *************************************************
  2. *                        *
  3. *           (C)opyright  1991-92        *
  4. *                        *
  5. *        by  Tomi Blinnikka        *
  6. *                        *
  7. *    Don´t try to understand the code    *
  8. *                        *
  9. * Version 0.01    28/07/1991            *
  10. *                        *
  11. * BUGS:    Version string missing.            *
  12. *                        *
  13. * Version 0.02    27/05/1992            *
  14. *                        *
  15. * BUGS:    What are they?                *
  16. *                        *
  17. *************************************************
  18.     
  19.  
  20.     INCLUDE    "INCLUDES:JMPLibs.i"
  21.     INCLUDE    "INCLUDES:exec/types.i"
  22.     INCLUDE    "INCLUDES:intuition/intuition.i"
  23.     INCLUDE    "INCLUDES:libraries/dos.i"
  24.  
  25.     INCLUDE    "XREF:intuition.xref"
  26.     INCLUDE    "XREF:exec.xref"
  27.     INCLUDE    "XREF:dos.xref"
  28.  
  29.         section    OpenWB,CODE
  30.  
  31.         push    d2-d7/a2-a6
  32.         move.l    a0,a4
  33.         openlib    Dos,ShutDown_Out
  34.  
  35.         cmp.b    #'?',(a4)
  36.         beq    CmdLineHelp
  37.         cmp.w    #'-?',(a4)
  38.         beq    CmdLineHelp
  39.         cmp.b    #'h',(a4)
  40.         beq    CmdLineHelp
  41.         cmp.w    #'-h',(a4)
  42.         beq    CmdLineHelp
  43.     
  44.         openlib    Intuition,NoIntuition
  45.         cmp.w    #'-c',(a4)
  46.         beq    DoClose
  47.         cmp.w    #'-C',(a4)
  48.         beq    DoClose
  49.         lib    Intuition,OpenWorkBench
  50.         bra    ShutDown
  51. DoClose:    lib    Intuition,CloseWorkBench
  52.  
  53. ShutDown:    closlib    Intuition
  54.         closlib    Dos
  55.         pull    d2-d7/a2-a6
  56.         move.l    #RETURN_OK,d0
  57.         rts
  58. ShutDown_Out:    move.l    #RETURN_FAIL,d0
  59.         pull    d2-d7/a2-a6
  60.         rts
  61.  
  62. Printer:    printa    a0
  63.         rts
  64.  
  65. NoIntuition:    lea.l    NoIntText1,a0
  66.         bsr    Printer
  67.         bra    ShutDown
  68.  
  69. CmdLineHelp:    lea.l    UsageText1,a0
  70.         bsr    Printer
  71.         bra    ShutDown
  72.  
  73.  
  74.         dc.b    "$VER: "
  75. UsageText1:    dc.b    "OpenWB 0.02 (8.10.92). (C)opyright Tomi Blinnikka",13,10,13,10
  76.         dc.b    "USAGE: OpenWB [-c]",13,10,13,10
  77.         dc.b    "Where: [-c] closes the Workbench screen",13,10,13,10,0
  78.  
  79. NoIntText1:    dc.b    "ERROR: Couldn't open intuition.library!",13,10,0
  80.  
  81. ;library stuff
  82.  
  83.         libnames
  84.  
  85.         END
  86.  
  87.