Wednesday, September 28, 2011

maze in assembly language


.model small
.code
org 100h
jmp main
rfood db 05, 08, 15, 19, 12, 15, 20, 23
cfood db 09, 06, 10, 16, 18, 27, 36, 25
place db 00
row db 00
row1 db 100 dup(' ')
col db 00
col1 db 100 dup(' ')
score db 30h, '$'
score1 db 'YOUR SCORE:','$'
count db 00h
count1 db 00h
count2 db 00h
temp db ?
temp1 db ?
zero db 'w', '$'
life db 'YOUR LIFE: ','$'



start  db 'ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ',0ah,0dh
       db 'ÛÛ                                                                           ÛÛ',0ah,0dh
       db 'ÛÛ  ÛßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßÛ  ÛÛ',0ah,0dh
       db 'ÛÛ  Û  ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»  Û  ÛÛ',0ah,0dh
       db 'ÛÛ  Û  º                                                               º  Û  ÛÛ',0ah,0dh
       db 'ÛÛ  Û  º                                                               º  Û  ÛÛ',0ah,0dh
       db 'ÛÛ  Û  º  °°  °°      °°           °°       °°°°°°°°°°°°°   °°°°°°°°°  º  Û  ÛÛ',0ah,0dh
       db 'ÛÛ  Û  º  °° °  °    °  °         °  °                 °    °°         º  Û  ÛÛ',0ah,0dh
       db 'ÛÛ  Û  º  °°°    °  °    °       °    °               °     °°         º  Û  ÛÛ',0ah,0dh
       db 'ÛÛ  Û  º  °°      °°      °°   °°      °°            °      °°         º  Û  ÛÛ',0ah,0dh
       db 'ÛÛ  Û  º  °°      °°      °°   °°      °°           °       °°°°°°°°°  º  Û  ÛÛ',0ah,0dh
       db 'ÛÛ  Û  º  °°      °°      °°   °°      °°          °        °°         º  Û  ÛÛ',0ah,0dh
       db 'ÛÛ  Û  º  °°      °°      °°   °°      °°         °         °°         º  Û  ÛÛ',0ah,0dh
       db 'ÛÛ  Û  º  °°      °°      °°   °°      °°        °          °°         º  Û  ÛÛ',0ah,0dh
       db 'ÛÛ  Û  º  °°      °°      °°   °°      °°       °           °°         º  Û  ÛÛ',0ah,0dh
       db 'ÛÛ  Û  º  °°      °°      °°   °°      °°      °            °°         º  Û  ÛÛ',0ah,0dh
       db 'ÛÛ  Û  º  °°      °°      °°   °°°°°°°°°°     °             °°         º  Û  ÛÛ',0ah,0dh
       db 'ÛÛ  Û  º  °°      °°      °°   °°      °°    °              °°         º  Û  ÛÛ',0ah,0dh
       db 'ÛÛ  Û  º  °°      °°      °°   °°      °°   °°°°°°°°°°°°°   °°°°°°°°°  º  Û  ÛÛ',0ah,0dh
       db 'ÛÛ  Û  º                                                               º  Û  ÛÛ',0ah,0dh
       db 'ÛÛ  Û  º                       PRESS ANY KEY.......                    º  Û  ÛÛ',0ah,0dh
       db 'ÛÛ  Û  ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ  Û  ÛÛ',0ah,0dh
       db 'ÛÛ  ÛÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ  ÛÛ',0ah,0dh
       db 'ÛÛ                                                                           ÛÛ',0ah,0dh
       db 'ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ$'



menu  db 'ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ',0ah,0dh
      db 'ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ',0ah,0dh
      db '                                                                               ',0ah,0dh
      db '     ÛÛ                 ÛÛ   ÛÛÛÛÛÛÛÛÛÛÛ   ÛÛÛ         ÛÛ   ÛÛ         ÛÛ      ',0ah,0dh
      db '     ÛÛÛ               ÛÛÛ   ÛÛ            ÛÛ Û        ÛÛ   ÛÛ         ÛÛ      ',0ah,0dh
      db '     ÛÛ Û             Û ÛÛ   ÛÛ            ÛÛ  Û       ÛÛ   ÛÛ         ÛÛ      ',0ah,0dh
      db '     ÛÛ  Û           Û  ÛÛ   ÛÛÛÛÛÛÛÛÛÛÛ   ÛÛ   Û      ÛÛ   ÛÛ         ÛÛ      ',0ah,0dh
      db '     ÛÛ   Û         Û   ÛÛ   ÛÛ            ÛÛ    Û     ÛÛ   ÛÛ         ÛÛ      ',0ah,0dh
      db '     ÛÛ    Û       Û    ÛÛ   ÛÛ            ÛÛ     Û    ÛÛ   ÛÛ         ÛÛ      ',0ah,0dh
      db '     ÛÛ     Û     Û     ÛÛ   ÛÛ            ÛÛ      Û   ÛÛ   ÛÛ         ÛÛ      ',0ah,0dh
      db '     ÛÛ      Û   Û      ÛÛ   ÛÛ            ÛÛ       Û  ÛÛ   ÛÛ         ÛÛ      ',0ah,0dh
      db '     ÛÛ       Û Û       ÛÛ   ÛÛ            ÛÛ        Û ÛÛ   ÛÛ         ÛÛ      ',0ah,0dh
      db '     ÛÛ        Û        ÛÛ   ÛÛÛÛÛÛÛÛÛÛÛ   ÛÛ         ÛÛÛ   ÛÛÛÛÛÛÛÛÛÛÛÛÛ      ',0ah,0dh
      db '                                                                               ',0ah,0dh
      db 'ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ',0ah,0dh
      db 'ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ',0ah,0dh
      db '                                                                               ',0ah,0dh
      db '                                 [P] PLAY                                      ',0ah,0dh
      db '                                                                               ',0ah,0dh
      db '                                 [I] INSTRUCTION                               ',0ah,0dh
      db '                                                                               ',0ah,0dh
      db '                                 [E] EXIT                                      ',0ah,0dh
      db '                                                                               ','$'



                                                                                        

maze  db ' ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ                    ',0ah,0dh
      db '   Û        Û  Û  Û    Û   Û    Û Û  Û Û                    ',0ah,0dh
      db 'Û  ÛÛÛÛ     Û  Û  Û    ÛÛÛ Û  Û Û ÛÛÛÛ Û                    ',0ah,0dh
      db 'Û     Û  ÛÛÛÛ  Û  ÛÛÛÛ  Û  ÛÛÛÛ   Û Û  Û                    ',0ah,0dh
      db 'Û     Û       ÛÛ     ÛÛÛ        ÛÛÛ ÛÛÛÛ                    ',0ah,0dh
      db 'ÛÛÛÛ  Û  ÛÛÛ         Û          Û   Û  Û                    ',0ah,0dh
      db 'Û  Û     Û Û  ÛÛÛÛÛ ÛÛ ÛÛÛÛÛÛÛÛ Û      Û                    ',0ah,0dh
      db 'Û ÛÛ ÛÛÛÛÛ Û      ÛÛÛ  Û    Û ÛÛÛ  ÛÛÛÛÛ                    ',0ah,0dh
      db 'Û Û  Û     ÛÛ         ÛÛ    Û      Û Û Û                    ',0ah,0dh
      db 'Û    ÛÛÛÛÛ  ÛÛÛ ÛÛÛÛ     Û        ÛÛ   Û                    ',0ah,0dh
      db 'ÛÛÛ             Û  ÛÛÛÛ ÛÛ ÛÛ ÛÛ       Û                    ',0ah,0dh
      db 'Û ÛÛÛÛÛ   ÛÛÛÛÛÛÛ     ÛÛÛ  Û  Û   Û  ÛÛÛ                    ',0ah,0dh
      db 'Û   Û    ÛÛ                Û  ÛÛÛÛÛ  Û Û                    ',0ah,0dh
      db 'ÛÛÛ Û Û  Û   ÛÛÛÛ  ÛÛÛÛÛ   Û        ÛÛ Û                    ',0ah,0dh
      db 'Û Û   Û  ÛÛÛ    ÛÛÛÛ Û ÛÛÛÛÛ   ÛÛÛÛ    Û                    ',0ah,0dh
      db 'Û ÛÛÛÛÛ              Û         Û       Û                    ',0ah,0dh
      db 'Û       ÛÛÛ ÛÛÛÛÛÛÛ  Û  ÛÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛ                    ',0ah,0dh
      db 'Û ÛÛÛÛÛÛÛ         ÛÛÛÛ  Û        Û     Û                    ',0ah,0dh
      db 'Û Û    Û  Û  ÛÛÛÛÛÛ     ÛÛ  ÛÛÛÛ ÛÛÛ   Û                    ',0ah,0dh
      db 'Û Û    ÛÛÛÛ              Û  Û  ÛÛÛ Û   Û ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ   ',0ah,0dh
      db 'Û ÛÛÛÛ      ÛÛÛÛÛ  ÛÛÛÛ  Û      Û  ÛÛ  Û Û              Û   ',0ah,0dh
      db 'Û        Û      Û  Û     Û ÛÛÛ  Û      Û Û              Û   ',0ah,0dh
      db 'Û ÛÛ Û ÛÛÛ ÛÛÛÛ Û  ÛÛÛ     Û Û  ÛÛÛÛÛ  Û Û              Û   ',0ah,0dh
      db 'Û Û  Û  Û  Û    Û    Û ÛÛ  Û           E Û              Û   ',0ah,0dh
      db 'ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ   ','$'













instruct  db 'ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ',0ah,0dh
          db 'ÛÛ                                                                           ÛÛ',0ah,0dh
          db 'ÛÛ                                                                           ÛÛ',0ah,0dh
          db 'ÛÛ                                                                           ÛÛ',0ah,0dh
          db 'ÛÛ                           I N S T R U C T I O N                           ÛÛ',0ah,0dh
          db 'ÛÛ                                                                           ÛÛ',0ah,0dh
          db 'ÛÛ                                                                           ÛÛ',0ah,0dh
          db 'ÛÛ                                                                           ÛÛ',0ah,0dh
          db 'ÛÛ                                                                           ÛÛ',0ah,0dh
          db 'ÛÛ                                                                           ÛÛ',0ah,0dh
          db 'ÛÛ                                                                           ÛÛ',0ah,0dh
          db 'ÛÛ           Use the arrow keys to move the SMILEY up, down, left ,          ÛÛ',0ah,0dh
          db 'ÛÛ                                                                           ÛÛ',0ah,0dh
          db 'ÛÛ                                and right.                                 ÛÛ',0ah,0dh
          db 'ÛÛ                                                                           ÛÛ',0ah,0dh
          db 'ÛÛ                                                                           ÛÛ',0ah,0dh
          db 'ÛÛ                                                                           ÛÛ',0ah,0dh
          db 'ÛÛ                                                                           ÛÛ',0ah,0dh
          db 'ÛÛ                                                                           ÛÛ',0ah,0dh
          db 'ÛÛ                                                                           ÛÛ',0ah,0dh
          db 'ÛÛ                                                                           ÛÛ',0ah,0dh
          db 'ÛÛ                                 [b] BACK                                  ÛÛ',0ah,0dh
          db 'ÛÛ                                                                           ÛÛ',0ah,0dh
          db 'ÛÛ                                                                           ÛÛ',0ah,0dh
          db 'ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ','$'







gameover  db '                                                                        ',0ah,0dh
          db '                                                                        ',0ah,0dh
          db '                                                                        ',0ah,0dh
          db '                                                                        ',0ah,0dh
          db '                                                                        ',0ah,0dh
          db '      -------------------- G A M E    O V E R  ! ! ! -----------------  ',0ah,0dh
          db '                                                                        ',0ah,0dh
          db '                                                                        ',0ah,0dh
          db '                                                                        ',0ah,0dh
          db '                                                                        ','$'                                                                      





win db '                                                              ',0ah,0dh
    db '                                                              ',0ah,0dh
    db '                    ÛÛ    ÛÛ    ÛÛÛÛ    ÛÛ    ÛÛ              ',0ah,0dh
    db '                     ÛÛ  ÛÛ    ÛÛ  ÛÛ   ÛÛ    ÛÛ              ',0ah,0dh
    db '                      ÛÛÛÛ    ÛÛ    ÛÛ  ÛÛ    ÛÛ              ',0ah,0dh
    db '                       ÛÛ      ÛÛ  ÛÛ   ÛÛ    ÛÛ              ',0ah,0dh
    db '                       ÛÛ       ÛÛÛÛ    ÛÛÛÛÛÛÛÛ              ',0ah,0dh
    db '                                                              ',0ah,0dh
    db '                  ÛÛ      ÛÛ      ÛÛ  ÛÛ  ÛÛÛÛ    ÛÛ          ',0ah,0dh
    db '                   ÛÛ    ÛÛÛÛ    ÛÛ   ÛÛ  ÛÛ ÛÛ   ÛÛ          ',0ah,0dh
    db '                    ÛÛ  ÛÛ  ÛÛ  ÛÛ    ÛÛ  ÛÛ  ÛÛ  ÛÛ          ',0ah,0dh
    db '                     ÛÛÛÛ    ÛÛÛÛ     ÛÛ  ÛÛ   ÛÛ ÛÛ          ',0ah,0dh
    db '                      ÛÛ      ÛÛ      ÛÛ  ÛÛ    ÛÛÛÛ          ','$'





main proc near
        mov row, 00h
        mov col, 00h
        call setcur

   print1:
        call clear
        mov dx, 0000h
        call setcur

        mov ah, 06h
        mov al, 00
        mov bh, 04h
        mov cx, 0000h
        mov dx, 184fh
        int 10h                                  

        mov ah, 09h
        lea dx, start
        int 21h

        mov ah, 07h
        int 21h
        jmp pamenu


    pamenu:
        call clear
        mov dx, 0000h
        call setcur

        mov ah, 06h
        mov al, 00
        mov bh, 7eh
        mov cx, 0000h
        mov dx, 184fh
        int 10h                                  

        mov ah, 09h
        lea dx, menu
        int 21h

        mov ah, 07h
        int 21h

        cmp al, 'p'
        if e jmp print2
        cmp al, 'i'
        if e jmp painstruct
        cmp al, 'e'
        jmp terminate
  painstruct:
        call clear
        mov dx, 0000h
        call setcur

        mov ah, 06h
        mov al, 00
        mov bh, 0eh
        mov cx, 0000h
        mov dx, 184fh
        int 10h                                  

        mov ah, 09h
        lea dx, instruct
        int 21h

        mov ah, 07h
        int 21h

        cmp al, 'b'
        if e jmp pamenu

   print2:
        mov ah, 02h
        mov bh, 00
        mov dh, 00
        mov dl, 00
        int 10h

        mov ah, 06h
        mov al, 00
        mov bh, 03
        mov cx, 0000h
        mov dx, 184fh
        int 10h

        mov ah, 09h
        lea dx, maze
        int 21h


        mov dh, 00
        mov dl, 00
        call setcur

        call smiley          
        call initial
        mov dh, 00
        mov dl, 00
        call setcur
        call nextmove

    print3:
        inc count2

        cmp count2, 04h
        if e jmp print4
        cmp count2, 04h
        if ne jmp resetbyte

    print4:
        call clear
        mov dx, 0000h
        call setcur

        mov ah, 06h
        mov al, 00
        mov bh, 04h
        mov cx, 0000h
        mov dx, 184fh
        int 10h                                  

        mov ah, 09h
        lea dx, gameover
        int 21h

        mov ah, 07h
        int 21h

        jmp terminate

terminate:
        int 20h
        main endp
        end main

clear proc near
        mov ah, 06h
        mov al, 00
        mov bh, 07h
        mov cx, 0000h
        mov dx, 184fh
      
        int 10h
        ret
clear endp

smiley proc near
        mov ah, 09h
        mov bh, 00h
        mov bl, 0Eh
        mov cx, 01h
        mov al, ' '
        int 10h
        ret
smiley endp

delete proc near
       mov dh, temp1
       mov dl, temp
       call setcur
       call space

       mov ah, 03h
       mov bh, 00h
       int 10h

       inc temp

       ret
delete endp

delete1 proc near
        mov dh, temp1
        mov dl, temp
        call setcur
        call space

        mov ah, 03h
        mov bh, 00h
        int 10h

        mov ah, 02h
        dec dl
        int 10h

        dec temp

        ret
delete1 endp

delete2 proc near
        mov dh, temp1
        mov dl, temp
        call setcur
        call space

        mov ah, 03h
        mov bh, 00h
        int 10h

        mov ah, 02h
        inc dh
        int 10h

        inc temp1

        ret
delete2 endp

delete3 proc near
        mov dh, temp1
        mov dl, temp
        call setcur
        call space

        mov ah, 03h
        mov bh, 00h
        int 10h

        dec temp1

        ret
delete3 endp

fpow proc near
        mov ah, 09h
        mov bh, 00h
        mov bl, 74h
        mov cx, 01h
        mov al, 03h
        int 10h
        ret
fpow endp

initial proc near
        mov dx, 0104h
        call setcur
        call fpow
        ret
initial endp

movchar proc near
        call smiley
        call delete
        call nextmove
movchar endp

movchar1 proc near
        call smiley
        call delete1
        call nextmove
movchar1 endp

movchar2 proc near
        call smiley
        call delete2
        call nextmove
movchar2 endp

movchar3 proc near
        call smiley
        call delete3
        call nextmove
movchar3 endp

nextmove proc near
   next:
        mov ah, 0bh
        int 21h

        mov ah, 00h
        int 16h

        cmp ah, 4dh
        if e jmp right
        cmp ah, 4bh
        if e jmp left
        cmp ah, 48h
        if e jmp up
        cmp ah, 50h
        if e jmp down
        jmp next
nextmove endp

right:
        inc col
        mov bh, 00h
        mov bl, count1

        mov ah, row
        mov al, col
        mov row1[bx], ah
        mov col1[bx], al
        mov dh, row1[bx]
        mov dl, col1[bx]
        call setcur

        mov ah, 08h
        int 10h

        cmp al, ' '
        if e jmp movchara
        cmp al, 03h
        if e jmp food
        cmp al, 'E'
        if e call congratz
        cmp al, ' '
        if ne jmp print3
   food:
        call smiley
        call foods
   movchara:
        call movchar

left:
        dec col
        mov bh, 00h
        mov bl, count1
      
        mov ah, row
        mov al, col
        mov row1[bx], ah
        mov col1[bx], al
        mov dh, row1[bx]
        mov dl, col1[bx]
        call setcur

        mov ah, 08h
        int 10h

        cmp al, ' '
        if e jmp movcharb
        cmp al, 03h
        if e jmp food2
        if e jmp food
        cmp al, 'E'
        if e call congratz
        cmp al, ' '
        if ne jmp print3
   food2:
        call smiley
        call foods2
   movcharb:
        call movchar1

down:
        inc row
        mov bh, 00h
        mov bl, count1

        mov ah, row
        mov al, col
        mov row1[bx], ah
        mov col1[bx], al
        mov dh, row1[bx]
        mov dl, col1[bx]
        call setcur

        mov ah, 08h
        int 10h

        cmp al, ' '
        if e jmp movcharc
        cmp al, 03h
        if e jmp food3
      
        cmp al, 'E'
        if e call congratz
        cmp al, ' '
        if ne jmp print3
     food3:
        call smiley
        call foods3
   movcharc:
        call movchar2      
      
up:
        dec row
        mov bh, 00h
        mov bl, count1

        mov ah, row
        mov al, col
        mov row1[bx], ah
        mov col1[bx], al
        mov dh, row1[bx]
        mov dl, col1[bx]
        call setcur

        mov ah, 08h
        int 10h
        cmp al, ' '
        if e jmp movchard
        cmp al, 03h
        if e jmp food4
      
        cmp al, 'E'
        if e call congratz
        cmp al, ' '
        if ne jmp print3
   food4:
        call smiley
        call foods4
   movchard:
        call movchar3      

setcur proc near
        mov ah, 02h
        mov bh, 00h
        int 10h
        ret
setcur endp

space proc near
        mov ah, 09h
        mov bh, 00h
        mov bl, 03h
        mov cx, 01h
        mov al, ' '
        int 10h
        ret
space endp

foods proc near
       call foodloc
       inc score
       call scoring
       call smiley
       call delete
       call nextmove

       ret
foods endp

foods2 proc near
       call foodloc
       inc score
       call scoring
       call smiley
       call delete1
       call nextmove

       ret
foods2 endp

foods3 proc near

       call foodloc
       inc score
       call scoring
       call smiley
       call delete2
       call nextmove
       ret
foods3 endp

foods4 proc near
       call foodloc
       inc score
       call scoring
       call smiley
       call delete3
       call nextmove

       ret
foods4 endp

foodloc proc near
        call pinc
        mov bh, 00h
        mov bl, place
        mov dh, rfood[bx]
        mov dl, cfood[bx]
        call setcur
        call fpow
        ret
foodloc endp

congratz proc near
        call clear

        mov ah, 06h
        mov al, 00
        mov bh, 7Dh
        mov cx, 0000h
        mov dx, 184fh
        int 10h

        mov dh, 00h
        mov dl, 00h
        call setcur

        mov ah, 09h
        lea dx, win
        int 21h

        mov ah, 07h
        int 21h

        mov dh, 00h
        mov dl, 00h
        call setcur

        mov row, 00h
        mov col, 00h
        jmp resetbyte
        ret
congratz endp

scoring proc near
        mov dh, 20              
        mov dl, 44              
        call setcur

        mov ah, 09h
        lea dx, score1
        int 21h

        mov dh, 22
        mov dl, 48
        call setcur

        mov ah, 09h
        lea dx, score
        int 21h

        ret
scoring endp

pinc proc near
        inc place
        ret
pinc endp


resetbyte:
        mov row, 00h
        mov col, 00h
        mov temp, 00h
        mov temp1, 00h
        mov count, 00h
        mov count1, 00h
        mov score, 30h
        jmp print2

About marycris trajano

I am Marycris Trajano, I do blogging and exploring the net while studying, from Philippines
marycris trajanohttp://yield2me.com/-42587.htm