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

  1. *************************************************
  2. *                        *
  3. *         (C)opyright 1992        *
  4. *                        *
  5. *        by  Tomi Blinnikka        *
  6. *                        *
  7. *    Don't try to understand the code    *
  8. *                        *
  9. * Version 0.01    29/12/1992            *
  10. *                        *
  11. * BUGS:                        *
  12. *                        *
  13. *************************************************
  14.  
  15.     INCLUDE    "JMPLibs.i"
  16.     INCLUDE    "libraries/dos.i"
  17.  
  18.     INCLUDE    "XREF:2.0.xref"
  19.     INCLUDE    "XREF:exec.xref"
  20.     INCLUDE    "XREF:dos.xref"
  21.  
  22.         section    Parse,CODE
  23.  
  24.         openlib    Dos,NoDos
  25.  
  26.         lea.l    CLTemplate1,a0
  27.         move.l    a0,d1
  28.         lea.l    CLArray1,a0
  29.         move.l    a0,d2
  30.         clr.l    d3
  31.         lib    Dos,ReadArgs
  32.         move.l    d0,RDArgs1
  33.         beq    NoRDArgs
  34.  
  35.         lea.l    FromFileText1,a0
  36.         bsr    Printer
  37.         move.l    FromFile,a0
  38.         bsr    Printer
  39.         lea.l    CRLFText1,a0
  40.         bsr    Printer
  41.         lea.l    OptionText1,a0
  42.         bsr    Printer
  43.         tst.l    Option1
  44.         bne    Check1
  45.         lea.l    NotText1,a0
  46.         bsr    Printer
  47. Check1:        lea.l    SetText1,a0
  48.         bsr    Printer
  49.         lea.l    CRLFText1,a0
  50.         bsr    Printer
  51.         bra    ShutDown
  52.  
  53. ShutDown:    move.l    RDArgs1,d1
  54.         beq    ShutDown9000
  55.         lib    Dos,FreeArgs
  56. ShutDown9000:
  57.  
  58. ShutDown1000:    closlib    Dos
  59.         move.l    #RETURN_OK,d0
  60.         rts
  61.  
  62. NoDos:        move.l    #RETURN_FAIL,d0
  63.         rts
  64.  
  65. NoRDArgs:    lib    Dos,IoErr
  66.         move.l    d0,d1
  67.         clr.l    d2
  68.         lib    Dos,PrintFault
  69.         bra    ShutDown
  70.  
  71. Printer:    printa    a0
  72.         rts
  73.  
  74.  
  75. ;Library stuff
  76.  
  77.         libnames
  78.  
  79. ;Reservations
  80.  
  81. RDArgs1:    dc.l    0
  82.  
  83. ;Options
  84.  
  85. CLArray1:
  86. FromFile:    dc.l    0
  87. Option1:    dc.l    0
  88.  
  89. ;Strings, part I
  90.  
  91. CLTemplate1:    dc.b    "FROM/A,O=OPTION/S",0
  92. VersionString:    dc.b    "$VER: Parser tester 0.01 (29.12.1992) (C)opyright Tomi Blinnikka 1992",0
  93. FromFileText1:    dc.b    "Given filename is : ",0
  94. OptionText1:    dc.b    "Option was : ",0
  95. NotText1:    dc.b    "NOT ",0
  96. SetText1:    dc.b    "SET",0
  97. CRLFText1:    dc.b    13,10,0
  98.         ds.w    0
  99.  
  100.  
  101. ;Other stuff, part II
  102.  
  103.  
  104.  
  105.         end
  106.