home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format 50 / af050sub.adf / Enforcer / LawBreaker.asm < prev    next >
Assembly Source File  |  1993-06-25  |  6KB  |  157 lines

  1. ******* LawBreaker ************************************************************
  2. *
  3. *   NAME
  4. *    LawBreaker - A quicky test of Enforcer
  5. *
  6. *   SYNOPSIS
  7. *    This is a quick test of Enforcer and its reporting abilities.
  8. *
  9. *   FUNCTION
  10. *    This program is used to make sure that Enforcer is correctly
  11. *    installed and operating.  LawBreaker works from either the CLI
  12. *    or Workbench.  It will try to read and write certain memory
  13. *    areas that will cause an Enforcer hit or four.
  14. *
  15. *   INPUTS
  16. *    Just run it...
  17. *
  18. *   RESULTS
  19. *    When running Enforcer, you will see some output from Enforcer.
  20. *    Output on a 68030 machine would look something like this:
  21. *
  22. *WORD-WRITE to  00000000        data=0000       PC: 0783AC6A
  23. *USP:  078CAAEC SR: 0004 SW: 0729  (U0)(-)(-)  TCB: 078AADF8
  24. *Data: DDDD0000 DDDD1111 DDDD2222 DDDD3333 DDDD4444 DDDD5555 DDDD6666 DDDD7777
  25. *Addr: AAAA0000 AAAA1111 AAAA2222 AAAA3333 AAAA4444 AAAA5555 07800804 --------
  26. *Stck: 00000000 0784991C 00009C40 078AB81C BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB
  27. *Stck: BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB 00000000 006B54E0 ABADCAFE
  28. *PC-8: AAAA1111 247CAAAA 2222267C AAAA3333 287CAAAA 44442A7C AAAA5555 31C00000
  29. *PC *: 522E0127 201433FC 400000DF F09A522E 012611C1 01004EAE FF7621C0 0104532E
  30. *Name: "Shell"  CLI: "NewTest:LawBreaker"  Hunk 0000 Offset 0000007A
  31. *
  32. *LONG-READ from AAAA4444                        PC: 0783AC6E
  33. *USP:  078CAAEC SR: 0015 SW: 0749  (U0)(F)(-)  TCB: 078AADF8
  34. *Data: DDDD0000 DDDD1111 DDDD2222 DDDD3333 DDDD4444 DDDD5555 DDDD6666 DDDD7777
  35. *Addr: AAAA0000 AAAA1111 AAAA2222 AAAA3333 AAAA4444 AAAA5555 07800804 --------
  36. *Stck: 00000000 0784991C 00009C40 078AB81C BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB
  37. *Stck: BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB 00000000 006B54E0 ABADCAFE
  38. *PC-8: 247CAAAA 2222267C AAAA3333 287CAAAA 44442A7C AAAA5555 31C00000 522E0127
  39. *PC *: 201433FC 400000DF F09A522E 012611C1 01004EAE FF7621C0 0104532E 01266C08
  40. *Name: "Shell"  CLI: "NewTest:LawBreaker"  Hunk 0000 Offset 0000007E
  41. *
  42. *BYTE-WRITE to  00000100        data=11         PC: 0783AC80
  43. *USP:  078CAAEC SR: 0010 SW: 0711  (U0)(F)(D)  TCB: 078AADF8
  44. *Data: 00000000 DDDD1111 DDDD2222 DDDD3333 DDDD4444 DDDD5555 DDDD6666 DDDD7777
  45. *Addr: AAAA0000 AAAA1111 AAAA2222 AAAA3333 AAAA4444 AAAA5555 07800804 --------
  46. *Stck: 00000000 0784991C 00009C40 078AB81C BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB
  47. *Stck: BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB 00000000 006B54E0 ABADCAFE
  48. *PC-8: 2A7CAAAA 555531C0 0000522E 01272014 33FC4000 00DFF09A 522E0126 11C10100
  49. *PC *: 4EAEFF76 21C00104 532E0126 6C0833FC C00000DF F09A201F 66024E75 22404EEE
  50. *Name: "Shell"  CLI: "NewTest:LawBreaker"  Hunk 0000 Offset 00000090
  51. *
  52. *LONG-WRITE to  00000104        data=00000000   PC: 0783AC88
  53. *USP:  078CAAEC SR: 0014 SW: 0709  (U0)(-)(D)  TCB: 078AADF8
  54. *Data: 00000000 DDDD1111 DDDD2222 DDDD3333 DDDD4444 DDDD5555 DDDD6666 DDDD7777
  55. *Addr: AAAA0000 AAAA1111 AAAA2222 AAAA3333 AAAA4444 AAAA5555 07800804 --------
  56. *Stck: 00000000 0784991C 00009C40 078AB81C BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB
  57. *Stck: BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB BBBBBBBB 00000000 006B54E0 ABADCAFE
  58. *PC-8: 0000522E 01272014 33FC4000 00DFF09A 522E0126 11C10100 4EAEFF76 21C00104
  59. *PC *: 532E0126 6C0833FC C00000DF F09A201F 66024E75 22404EEE FE860024 5645523A
  60. *Name: "Shell"  CLI: "NewTest:LawBreaker"  Hunk 0000 Offset 00000098
  61. *
  62. *   NOTES
  63. *    If enforcer is not running, the program should not cause the
  64. *    system to crash.  It will, however, write to certain areas
  65. *    of low memory.  Also, it will cause read access of some
  66. *    addresses that may not exist.  This may cause bus faults.
  67. *
  68. *   SEE ALSO
  69. *    "Quantum Physics:  The Dreams that Stuff is made of." - Michael Sinz
  70. *
  71. *   BUGS
  72. *    There are 4 known Enforcer hits in this code, however, they
  73. *    will not be fixed.  ;^)
  74. *
  75. *******************************************************************************
  76. *
  77.         INCLUDE    "exec/types.i"
  78.         INCLUDE    "exec/execbase.i"
  79.         INCLUDE    "exec/macros.i"
  80.         INCLUDE    "dos/dosextens.i"
  81. *
  82. *******************************************************************************
  83. *
  84. * The main code...
  85. *
  86. LawBreaker:    move.l    4.w,a6        ; Get ExecBase...
  87.         clr.l    -(sp)        ; Clear the message pointer...
  88.         move.l    ThisTask(a6),a4    ; Get our process pointer...
  89.         tst.l    pr_CLI(a4)    ; Are we a CLI?
  90.         bne.s    Do_Law        ; If NULL, we are a WB run program...
  91. *
  92. * Handle Workbench Startup...
  93. *
  94.         lea    pr_MsgPort(a4),a4    ; Get message port...
  95.         move.l    a4,a0        ; We first wait for the WB Startup MSG
  96.         JSRLIB    WaitPort    ; (it should be here very quickly)
  97.         move.l    a4,a0        ; Now we get the message...
  98.         JSRLIB    GetMsg        ; Get it...
  99.         move.l    d0,(sp)        ; Now, store it on the stack...
  100. *
  101. * Ok, now be nasty...
  102. *
  103. * First fill up the registers with patterns
  104. *
  105. Do_Law:        move.l    #$DDDD0000,d0
  106.         move.l    #$DDDD1111,d1
  107.         move.l    #$DDDD2222,d2
  108.         move.l    #$DDDD3333,d3
  109.         move.l    #$DDDD4444,d4
  110.         move.l    #$DDDD5555,d5
  111.         move.l    #$DDDD6666,d6
  112.         move.l    #$DDDD7777,d7
  113.         move.l    #$AAAA0000,a0
  114.         move.l    #$AAAA1111,a1
  115.         move.l    #$AAAA2222,a2
  116.         move.l    #$AAAA3333,a3
  117.         move.l    #$AAAA4444,a4
  118.         move.l    #$AAAA5555,a5
  119. *
  120.         move.w    d0,$0000    ; Ping location 0 (to 0)
  121.         JSRLIB    Forbid
  122.         move.l    (a4),d0        ; Ping another spot
  123.         JSRLIB    Disable
  124.         move.b    d1,$0101    ; Ping one more...
  125.         JSRLIB    Permit
  126.         move.l    d0,$0102    ; One last one...
  127.         JSRLIB    Enable
  128. *
  129. * Ok, so now we quit...
  130. *
  131.         move.l    (sp)+,d0    ; Get message...
  132.         beq.s    Done        ; If we have one, do WB exit...
  133. *
  134. * We have a Workbench message, so reply it...
  135. *
  136.         JSRLIB    Forbid        ; We need to FORBID for a bit...
  137.         move.l    d0,a1        ; Get message into register
  138.         JSRLIB    ReplyMsg    ; Reply the workbench message...
  139. *
  140. Done:        rts            ; Return with NULL...
  141. *
  142. *******************************************************************************
  143. *
  144. * The version string...
  145. *
  146.         INCLUDE    "lawbreaker_rev.i"
  147.         VERSTAG
  148. *
  149. *******************************************************************************
  150. *
  151. * "A master's secrets are only as good as the
  152. *  master's ability to explain them to others."  -  Michael Sinz
  153. *
  154. *******************************************************************************
  155. *
  156.         END
  157.