home *** CD-ROM | disk | FTP | other *** search
/ ticalc.org / ticalc_org_rev_b.iso / archives / 92 / asm / source / fargo / sierpin.asm < prev    next >
Encoding:
Assembly Source File  |  2001-07-01  |  780 b   |  51 lines

  1.     include    "tios.h"
  2.     include    "flib.h"
  3.     xdef    _main
  4.     xdef    _comment
  5.  
  6. ;*****************************************************
  7.  
  8. _main:
  9.     jsr    flib::clr_scr
  10.  
  11.     lea    point_table(pc),a0
  12.     move.l    (a0),d4
  13.  
  14. main_loop:
  15.     tst.w    tios::kb_globals+$1C
  16.     beq    no_key
  17.     clr.w    tios::kb_globals+$1C
  18.     move.w    tios::kb_globals+$1E,d0
  19.     cmp.w    #$108,d0
  20.     beq    exit
  21.  
  22. no_key:
  23.     move.l    d4,-(a7)
  24.     jsr    flib::pixel_on
  25.     add.l    #4,a7
  26.  
  27.     move.w    #3,d0
  28.     jsr    flib::random
  29.     lsl.w    #2,d0
  30.     add.l    0(a0,d0.w),d4
  31.     lsr.l    #1,d4
  32.     and.l    #$0FFF0FFF,d4
  33.  
  34.     bra    main_loop
  35.  
  36. exit:
  37.     rts
  38.  
  39. ;*****************************************************
  40.  
  41. point_table:
  42.     dc.w    120,000
  43.     dc.w    000,120
  44.     dc.w    239,120
  45.  
  46. _comment    dc.b    "Sierpinski (Chaos Game)",0
  47.  
  48. ;*****************************************************
  49.  
  50.     end
  51.