home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 2: PC / frozenfish_august_1995.bin / bbs / d07xx / d0764.lha / CLI-Tools / Reset.S < prev    next >
Text File  |  1992-11-21  |  1KB  |  73 lines

  1.     incdir "ram:include/"
  2.     include exec_lib.i
  3.     include dos_lib.i
  4.  
  5. CALLLIB    MACRO
  6.     jsr _LVO\1(a6)
  7.     ENDM
  8.  
  9. _LVOColdReboot = -$2d6
  10.  
  11. START
  12.     movea.l    4.w,a6            ;a6: ExecBase
  13.  
  14.     move.b (a0),d0
  15.     cmpi.b    #'?',d0            ;'?' als Parameter?
  16.     beq.s    reset_usage
  17.     bclr    #5,d0            ;'w' oder 'W' als Parameter?
  18.     cmpi.b    #'W',d0
  19.     beq.s    reset_wait
  20.  
  21.     CALLLIB Disable            ;stop the system
  22.     move.l    a6,$26(a6)        ;ChkBase zerst÷ren => Kaltstart
  23.  
  24.     moveq    #36,d0
  25.     cmp.w    20(a6),d0        ;bei OS >= 2.0 Kickstart-Routine
  26.     bhs.s    .oldkick        ;verwenden
  27.     CALLLIB ColdReboot        ;fⁿhrt Reset aus (Warmstart)
  28.  
  29. .oldkick
  30.     CALLLIB SuperState
  31.     lea    $fc0002,a0        ;Adresse Reset-Routine
  32.     reset                ;Peripherie-Reset
  33.     jmp    (a0)            ;Reset
  34.  
  35.  
  36. reset_wait:
  37.     move.l    a6,$26(a6)        ;ChkBase zerst÷ren
  38.     moveq    #0,d0            ;Ende
  39.     rts
  40.  
  41. reset_usage:
  42.     lea    DOSName(pc),a1        ;DOS-Lib ÷ffnen
  43.     moveq    #0,d0
  44.     CALLLIB OpenLibrary
  45.     tst.l    d0
  46.     beq.s    ende
  47.  
  48.     movea.l    d0,a6            ;Ausgabe ermitteln
  49.     CALLLIB Output
  50.     move.l    d0,d1
  51.     move.l    #text,d2        ;Text ausgeben
  52.     move.l    #textlen,d3
  53.     CALLLIB Write
  54.  
  55.     movea.l    a6,a1            ;DOS-Lib schlie▀en
  56.     CALLEXEC CloseLibrary
  57. ende:
  58.     moveq    #0,d0
  59.     rts
  60.  
  61. ;*** Daten ***
  62.  
  63. DOSName: dc.b "dos.library",0
  64.  
  65. ;fⁿr DOS-Befehl Version
  66.     dc.b 0,"$VER: Reset 1.2 (30.7.92  ⌐ Thies Wellpott)",0
  67. text:    dc.b "Usage:",$a
  68.     dc.b "  Reset w   next reset (e. g. CTRL-A-A) is a cold reset",$a
  69.     dc.b "  Reset     confirm cold reset",$a
  70. textlen = *-text
  71.     even
  72.  
  73.