home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 13 / CDA13.ISO / cdactual / demobin / share / program / Asm / AMSCLS.ZIP / JUBA.ASM < prev    next >
Encoding:
Assembly Source File  |  1991-02-13  |  6.9 KB  |  236 lines

  1.             include amscls.inc            ;ì\æóë╗âAâZâôâuâëélé`ébéqénér
  2.             $_init    GEN                    ;Åëè·ë╗â}âNâì
  3. ;---------------------------------------------------------------
  4. ; é`élérébékérüDéhémébé╠âTâôâvâïâvâìâOâëâÇ
  5. ; juba.asm
  6. ; Copyright Hortense S. Endoh 1991
  7. ; éSésé`éaé┼Åæé⌐éΩé─éóé▄é╖üD
  8. ;---------------------------------------------------------------
  9. SLOWWALK    = 10000            ;ò\Īæ¼ôxüi100ü`20000 Æ÷ôxé╠Ælüj
  10. WALKWAVE    = 10            ;ò\Īæ¼ôxé╠ò╧ë╗é╠ë┴æ¼ôx
  11. SPEEDLAW    = 1000            ;ì┼Æßò\Īæ¼ôx
  12. SPEEDHIGH    = 15000            ;ì┼ìéò\Īæ¼ôx
  13. ATTRIBUTE0    = 0e1h            ;Æ╩Åφé╠ò╢ÄÜò\Īé╠âAâgâèârâàü[âg
  14. ATTRIBUTE1    = 0c1h            ;éiubaîNé╠ÉF1üiâ}âXâNüj
  15. ATTRIBUTE2    = 081h            ;éiubaîNé╠ÉF2üiâfâtâHâïâgüj
  16. BEEPTIME    = 30h            ;ârü[âvë╣é╠Æ╖é│
  17. ;---------------------------------------------------------------
  18. $_ms2vram    macro $_msg        ;è┐ÄÜé▄é╢éΦò╢ÄÜù±é≡98é╠éuéqé`élâCâüü[âWé┼ÆΦï`
  19. hl_flag    = 0
  20.         irpc    chr, <$_msg>
  21.             $_ms2vr1    <chr>
  22.         endm
  23.         endm
  24.  
  25. $_ms2vr1 macro $_chr
  26.         ife hl_flag
  27.             if (('&$_chr' GE 20h) and ('&$_chr' LE 7eh)) or (('&$_chr' GE 0a0h) and ('&$_chr' LE 0dfh))
  28.                 DB    '&$_chr', 0
  29.             else
  30. hl_flag            = hl_flag xor 1
  31. chr_h            = '&$_chr' shl 1
  32.             endif
  33.         else
  34. hl_flag        = hl_flag xor 1
  35. chr_l        = '&$_chr' - 1fh
  36.             ife chr_l and  80h
  37.                 if chr_l LT 061h
  38. chr_l                = chr_l - 33
  39.                 else
  40. chr_l                = chr_l - 34
  41.                 endif
  42.             endif
  43. jis_code    = (chr_h * 256) + chr_l + 1fa1h and 07f7fh
  44. vram_code    = (jis_code and 0ffh) * 256 + (jis_code shr 8)
  45. vram_code    = vram_code - 20h
  46.             DW    vram_code
  47.             DW    vram_code or 8000h
  48.         endif
  49.         endm
  50. ;---------------------------------------------------------------
  51. CR        equ    13            ;é▒éñéóéñé╞é▒éδé╔ò¬é⌐éΦé½é┴é╜âRâüâôâgé≡Åæé¡é╠é═
  52. LF        equ    10            ;â_âTâCé⌐üH
  53. EOS        equ    '$'
  54. ON        equ    0
  55. OFF        equ    -1
  56. ;---------------------------------------------------------------
  57. code        SEGMENT WORD PUBLIC            ;é▒é▒é⌐éτâvâìâOâëâÇé¬Äné▄éΘ
  58.         ORG    100H
  59.         ASSUME    cs:code, ds:code, es:code
  60. main        PROC    NEAR
  61.         PUBLIC    main
  62.  
  63.         mov    ax, 0a000h                    ;éuéqé`élé╠âAâhâîâX
  64.         mov    es, ax
  65.  
  66.         $_for <mov BX, 0>, <<cmp BX, displeng+30>, L>, <add BX, 10>
  67.             call worm01                    ;jubaîNé≡Åæé¡
  68.         $_enddo                            ;âüâbâZü[âWé╠Æ╖é│é╔ë₧é╢é─îJéΦò╘é╡é─
  69.                                         ;éóéΘéφé»é┼é╖üD
  70.         mov    ax,4c00H
  71.         int    21H                            ;éαé┴é╞ÉFïCé╠éáéΘÅIéΦò√é═
  72. main    ENDP                            ;é┼é½é╚éóé╠é⌐üH
  73.  
  74. ;---------------------------------------------------------------
  75.         assume    ds:code                    ;jubaîNé╠éPâTâCâNâïüi16âJâbâgüjé≡
  76. worm01    proc                            ;Åæé¡
  77.         mov    si, offset wormfig            ;jubaîNé╠âfü[â^âIâtâZâbâg
  78.         mov    di, 0                        ;
  79.         mov    cx, 16                        ;
  80.         $_do                            ;16âJâbâgë±éΘ
  81.             $_push    <cx, di>, 02
  82.             lodsw
  83.             $_while <cmp ah, 0>, G        ;jubaîNé╠âfü[â^é≡ô¬é⌐éτÅæéóé─éóé¡
  84.                 mov    cx, speedfact        ;âfâBâîâCé≡æ¥î╕é╖éΘ
  85.                 $_if <cmp speed_dir, 0>, E
  86.                     sub cx, WALKWAVE
  87.                     $_if <cmp cx, SPEEDLAW>, L
  88.                         mov    speed_dir, 1
  89.                     $_endif
  90.                 $_else
  91.                     add cx, WALKWAVE
  92.                     $_if <cmp cx, SPEEDHIGH>, G
  93.                         mov    speed_dir, 0
  94.                     $_endif
  95.                 $_endif
  96.                 mov    speedfact, cx
  97.                 $_do                    ;âfâBâîâCé≡é⌐é»éΘ
  98.                 $_until <LOOP>
  99.  
  100.                 xor    cx, cx
  101.                 $_for <mov cl, ah>, <<cmp cx, 0>, NE>, <dec cx>
  102.                     call    draw1cut    ;éPò╢ÄÜé╛é»jubaîNé≡Åæé¡
  103.                     add    di, 2
  104.                 $_enddo
  105.                 lodsw
  106.             $_enddo
  107.             call    draw1cut
  108.             $_pop    02
  109.         $_until <LOOP>
  110.         ret
  111. worm01        endp
  112. ;---------------------------------------------------------------
  113. draw1cut    proc    near                    ;jubaîNé╠êΩòöüiéPò╢ÄÜüjé≡
  114.         $_push    <ax, cx>, 04                ;Åæé¡
  115.         and    ah, 0
  116.         mov    cx, bx
  117.         add    cx, di
  118.         mov    dx, cx
  119.         call    drawchk                        ;ëµû╩é⌐éτé═é▌Åoé╡é─éóé╚éóé⌐
  120.  
  121.         $_if <cmp al, '#'>, NE                ;Åæé½Åoé╖ôαùeé╔éµéΘÅêù¥
  122.             $_if <cmp al, 'O'>, E, OR
  123.             $_c <cmp al, 'Q'>, E
  124.                 $_if <cmp word ptr es:[bx + di ], 0020h>, NE, AND
  125.                 $_c <cmp word ptr es:[bx + di ], 004Fh>, NE, AND
  126.                 $_c <cmp word ptr es:[bx + di ], 0051h>, NE
  127.                     mov beepflag, 1            ;ò╢ÄÜé≡ÉHé╫é╜éτë╣é≡Åoé╖éµéñé╔
  128.                 $_else                        ;âtâëâOé≡É▌ÆΦé╖éΘ
  129.                     mov beepflag, 0
  130.                 $_endif
  131.             $_endif
  132.  
  133.             $_if <cmp al, ' '>, E            ;âüâbâZü[âWé≡éPbytesò¬Åoé╖
  134.                 $_push    <di>, 05
  135.                 mov    di, dispindx
  136.                 inc    dispindx
  137.                 inc    dispindx
  138.                 mov    ax, dispmsg[di]
  139.                 $_pop    05
  140.                 $_if <cmp ax, 0>, E
  141.                     mov    ax, '  '
  142.                     mov    dispindx, 0
  143.                 $_endif
  144.                 call    beep
  145.                 mov    es:[bx + di    ], ax
  146.                 mov    ax, ATTRIBUTE0
  147.                 mov    es:[bx + di + 02000h], ax
  148.             $_else
  149.                 mov    cx, es:[bx + di + 31]    ;jubaîNé╠û{æ╠é╔é═üCÉFé≡òté»
  150.                 mov    es:[bx + di    ], ax    ;é─ò\Īé╖éΘ
  151.                 shr    cx, 1
  152.                 shr    cx, 1
  153.                 shr    cx, 1
  154.                 and    cx, ATTRIBUTE1
  155.                 or    cx, 01h
  156.                 $_if <cmp cx, 01h>, E
  157.                     mov    cx, ATTRIBUTE2
  158.                 $_endif
  159.                 mov    es:[bx + di + 02000h], cx
  160.             $_endif
  161.  
  162.             $_if <cmp beepflag, 1>, E        ;ò╢ÄÜé≡ÉHé╫é─éóéΘé╞é½ë╣é≡Åoé╖
  163.                 call    Beep
  164.             $_endif
  165.         $_endif
  166.  
  167.         $_pop 04
  168.         ret
  169. draw1cut    endp
  170. ;---------------------------------------------------------------
  171. drawchk        proc    near
  172.             $_if <cmp dx, displeng>, GE
  173.                 mov    al, '#'
  174.             $_endif
  175.         ret
  176. drawchk        endp
  177. ;---------------------------------------------------------------
  178. Beep        proc    near
  179.             $_push    <cx,ax>, 06
  180.             mov    al,6
  181.             out    37h,al
  182.             mov    cx, BEEPTIME
  183.             loop    $
  184.             mov    al,7
  185.             out    37h,al
  186.             $_pop    06
  187.         ret
  188. Beep        endp    
  189. ;---------------------------------------------------------------
  190.  
  191. wormfig    label    byte                    ;jubaîNé╠âfü[â^
  192.         db    'n',1,'m',5,'n',5,'Q',0
  193.         db    'n',2,'m',5,'n',4,'Q',0
  194.         db    'n',3,'m',5,'n',3,'Q',0
  195.         db    'n',4,'m',5,'n',2,'Q',0
  196.         db    'n',5,'m',5,'n',1,'Q',0
  197.         db    'n',6,'m',5,'O',0
  198.         db    'n',8,'m',4,'O',0
  199.         db    'n',10,'m',3,'O',0
  200.         db    'n',12,'m',2,'O',0
  201.         db    'n',14,'m',1,'Q',0
  202.         db    'n',16,'Q',0
  203.         db    ' ',1,'m',1,'n',14,'Q',0
  204.         db    '#',1,' ',1,'m',2,'n',12,'O',0
  205.         db    '#',2,' ',1,'m',3,'n',10,'O',0
  206.         db    '#',3,' ',1,'m',4,'n',8,'O',0
  207.         db    '#',4,' ',1,'m',5,'n',6,'O',0
  208.  
  209.         even
  210. beepflag    dw    0
  211. speedfact    dw    SLOWWALK
  212. speed_dir    dw    0
  213. startmsg    db    CR, LF
  214.         db    "Juba (C) 1991 by Hortense Endoh (Baka-papa-ware)", CR, LF, EOS
  215.  
  216. dispindx    dw    0
  217.  
  218. dispmsg    label    word
  219.         $_ms2vram  <                                                                                >
  220.         $_ms2vram  <                  üyì\æóë╗âAâZâôâuâëélé`ébéqénérü^AMSCLSüz                      >
  221.         $_ms2vram  <ü@ü@ AMSCLS.INC Ver.2.10 / Copyright (C) Hortense S. Endoh 1986, 1987, 1991     >
  222.         $_ms2vram  <                           âTâôâvâïâvâìâOâëâÇÄ└ìsÆå                             >
  223.         $_ms2vram  <é▒é╠âvâìâOâëâÇé╠â\ü[âXâRü[âhé╠û`ô¬é╔éáéΘÆlüCSLOWWALKüCWALKWAVEüCATTRIBUTE0üCATTR>
  224.         $_ms2vram  <IBUTE1üCBEEPTIMEé╠Ælé≡ò╧ìXé╖éΘé╞üCjubaîNé╠ô«é½é¬ò╧éφéΘüDâüâbâZü[âWé≡Åæé½è╖éªéΘé╞>
  225.         $_ms2vram  <ò\Īé│éΩéΘâüâbâZü[âWéαò╧éφéΘüDî╗ì▌é╠Å≤æ╘é┼é═üCéPôxïNô«é╡é╜éτì┼îπé▄é┼âüâbâZü[âWé≡>
  226.         $_ms2vram  <ô╟é▄é│éΩé─é╡é▄éóé▄é╖üDé╚é¿üCé▒é╠â\ü[âXé╠ë≡ò·âRü[âhé╔Åæé⌐éΩé─éóéΘâ}âNâì$_ms2vram >
  227.         $_ms2vram  <é═üCè┐ÄÜé▄é╢éΦé╠âüâbâZü[âWé≡98é╠éuéqé`élâCâüü[âWé┼ÆΦï`é╖éΘéαé╠é┼é╖üDé▒éΩé≡éuéqé`>
  228.         $_ms2vram  <élé╠âAâhâîâXé╔æùé┴é─âAâgâèârâàü[âgé≡âZâbâgé╖éΘé╛é»é┼éuéqé`élé╠Æ╝Åæé½é┼é½éΘéµé±üD>
  229.         $_ms2vram  <                         13/Feb/1991 âoâJâpâpâEâFâA                             >
  230.         dw    0
  231. displeng    equ    ($ - offset dispmsg - 1) - 2
  232.  
  233. ;---------------------------------------------------------------
  234. code        ENDS
  235. END        main
  236.