home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / utils / asmutl / asmlib.lbr / BUGS.AZM / BUGS.ASM
Encoding:
Assembly Source File  |  1991-06-25  |  1.1 KB  |  75 lines

  1.     extrn    prolog,coe,dispatch,inline,quit
  2.     extrn    clear,cie,randinit,rand16,rand8,cst
  3.     extrn    cursor,setxy,delay,bell,caps,CUROFF,CURON
  4. ;
  5.     maclib    z80
  6. ;
  7.     call    prolog
  8.     call    clear
  9.     lxi    d,seed
  10.     call    randinit
  11.     lxi    h,items            ; point to screen characters
  12. ;
  13.     call    curoff            ; disable cursor
  14. start:
  15.     push    h
  16.     call    setup
  17.     pop    h
  18.     mov    a,m
  19.     cpi    0ffh            ; end ??
  20.     jrnz    start1
  21.     lxi    h,items            ; point to start of items again then
  22.     mov    a,m
  23. start1:
  24.     call    coe
  25.     inx    h            ; point to next item for next time
  26.     jmp    start
  27. ;
  28. setup:
  29.     lxi    d,3
  30.     call    delay
  31.     call    cst
  32.     jrz    loop1
  33.     call    cie
  34.     call    caps
  35.     cpi    03
  36.     jz    exit
  37.     cpi    'C'
  38.     cz    clear
  39.     call    bell
  40. loop1:
  41.     lxi    d,seed
  42.     call    rand8
  43.     cpi    79            ; greater than 79 ?
  44.     jrnc    loop1
  45.     sta    x
  46. ;
  47. loop2:
  48.     lxi    d,seed
  49.     call    rand8
  50.     cpi    23
  51.     jrnc    loop2
  52.     mov    e,a            ; load y value
  53. ;
  54.     lda    x
  55.     mov    d,a            ; load x value
  56.     call    cursor
  57.     ret
  58. ;
  59. exit:
  60.     lxi    d,023
  61.     call    cursor
  62.     call    curon
  63.     jmp    quit
  64. ;
  65. x:    db    00
  66. ;
  67. items:    db    ' O X V < > - + ^ * + : ',0ffh
  68. ;
  69. seed:
  70.     db    5,7,01,90,89,2
  71.     end
  72.  
  73.  
  74.  
  75.