home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 612a.lha / PowerVisor_v1.13 / PowerVisor_v1.13.lzh / Source / BuggyProgram.asm next >
Assembly Source File  |  1991-08-07  |  1KB  |  67 lines

  1.    ;This program is buggy, if you try to run it normally it will crash
  2.    ;See the 'debug' file for an example to debug this program
  3.  
  4.    addsym
  5.  
  6. SysBase        equ   4
  7. ;_LVOAllocMem   equ   -198
  8. ;_LVOFreeMem    equ   -210
  9.  
  10.  
  11. StartProgram:
  12.       moveq    #0,d1
  13.       moveq    #100,d0
  14.  
  15. loop: addq.l   #1,d1
  16.       dbra     d0,loop
  17.  
  18.       bsr      Sub1
  19.       beq.s    theend
  20.       bsr      Sub2
  21.       bsr      Sub3
  22.  
  23. theend:
  24.       moveq    #0,d0
  25.       rts
  26.  
  27. Sub1:
  28.       move.l   #100,d0
  29.       moveq    #0,d1
  30.       move.l   (SysBase).w,a6
  31.       jsr      _LVOAllocMem(a6)
  32.       lea      Block(pc),a0
  33.       move.l   d0,(a0)
  34.       rts
  35.  
  36. Sub2:
  37.       moveq    #0,d0
  38.       moveq    #1,d1
  39.       moveq    #2,d2
  40.       moveq    #3,d3
  41.       moveq    #4,d4
  42.       moveq    #5,d5
  43.       moveq    #6,d6
  44.       moveq    #7,d7
  45.       move.l   Block(pc),a0
  46.       illegal
  47.       move.l   d0,(a0)+
  48.       move.l   d1,(a0)+
  49.       move.l   d2,(a0)+
  50.       move.l   d3,(a0)+
  51.       move.l   d4,(a0)+
  52.       move.l   d5,(a0)+
  53.       move.l   d6,(a0)+
  54.       move.l   d7,(a0)+
  55.       rts
  56.  
  57. Sub3:
  58.       move.l   #64,d0
  59.       move.l   Block(pc),a1
  60.       move.l   (SysBase).w,a6
  61.       jsr      _LVOFreeMem(a6)
  62.       rts
  63.  
  64. Block:   dc.l  0
  65.  
  66.       END
  67.