home *** CD-ROM | disk | FTP | other *** search
/ DTP Toolbox / DTPToolbox.iso / utilities / misc / shapeshifter / chipmempri / chipmempri.s < prev    next >
Encoding:
Text File  |  1996-02-10  |  1.7 KB  |  83 lines

  1. ******************************************************************************
  2. ;
  3. ;ChipMemPri 1.0 (8.2.96)
  4. ;by Torbjörn Andersson, Public Domain
  5. ;
  6. ;ChipMemPri was created for use with ShapeShifter.  It
  7. ;reboots and sets the priority of the chip memory to 127
  8. ;(max).  System resources will then be located in chip
  9. ;memory, leaving other memory free for other use.
  10. ;
  11. ******************************************************************************
  12.  
  13. NEWCHIPPRI=127
  14.  
  15. ******************************************************************************
  16.  
  17. Start:
  18.     move.l    (4).w,a6
  19.  
  20.     lea    $0142(a6),a0        ; MemList
  21.     jsr    -$0084(a6)        ; _LVOForbid
  22.  
  23. .Loop
  24.     move.l    (a0),a0
  25.     tst.l    (a0)
  26.     beq    .Quit
  27.     btst    #1,$000F(a0)        ; mh_Attributes+1, MEMB_CHIP
  28.     beq    .Loop
  29.     cmp.b    #NEWCHIPPRI,$0009(a0)    ; ln_Pri
  30.     beq    .Quit
  31.  
  32.     lea    Code(pc),a0
  33.     move.l    a0,$002E(a6)        ; CoolCapture
  34.     bsr    ChkSum
  35.     jsr    -$02D6(a6)        ; _LVOColdReboot
  36.  
  37. .Quit
  38.     jsr    -$008A(a6)        ; _LVOPermit
  39.     moveq    #0,d0
  40.     rts
  41.  
  42. ******************************************************************************
  43.  
  44. Code:
  45.     lea    $0142(a6),a2        ; MemList
  46.  
  47. .Loop
  48.     move.l    (a2),a2
  49.     tst.l    (a2)
  50.     beq    .Rts
  51.     btst    #1,$000F(a2)        ; mh_Attributes+1, MEMB_CHIP
  52.     beq    .Loop
  53.  
  54.     move.l    a2,a1            ; node
  55.     jsr    -$00FC(a6)        ; _LVORemove
  56.     move.b    #NEWCHIPPRI,$0009(a2)    ; ln_Pri
  57.     lea    $0142(a6),a0        ; list, MemList
  58.     move.l    a2,a1            ; node
  59.     jsr    -$010E(a6)        ; _LVOEnqueue
  60.  
  61. .Rts
  62.     rts
  63.  
  64. ******************************************************************************
  65.  
  66. ChkSum:
  67.     lea    $0022(a6),a0        ; SoftVer
  68.     moveq    #0,d0
  69.     moveq    #22,d1
  70.  
  71. .Loop
  72.     add    (a0)+,d0
  73.     dbf    d1,.Loop
  74.     not    d0
  75.     move    d0,$0052(a6)        ; ChkSum
  76.     rts
  77.  
  78. ******************************************************************************
  79.  
  80.     END
  81.  
  82. ******************************************************************************
  83.