Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- IDEAL
- MODEL small
- STACK 100h
- DATASEG
- line dw 360
- halfline dw 0
- row dw 200
- halfrow dw 0
- helper dw 0
- randomchiter db 0
- cunter db 0
- less db 0
- more db 0
- x dw 0
- y dw 0
- ;------green
- green_brhight_color db 10
- green_color db 2
- green_width_place dw 160
- green_Length_place dw 100
- ;------yello
- ylow_brhight_color db 15
- ylow_color db 14
- ylow_width_place dw 0
- ylow_Length_place dw 100
- ;-----blue
- blue_brhight_color db 9
- blue_color db 1
- blue_width_place dw 160
- blue_Length_place dw 0
- ;---------red
- red_brhight_color db 12
- red_color db 4
- red_width_place dw 0
- red_Length_place dw 0
- array db 500 dup(8)
- scoremessage db 'your game was like --$'
- playagain db 'do you want to play again: press green$'
- Erormessage db 'that note is not possible in this game... but he probbly exsit in maincrft. do what do you want, I dont care.... $'
- score db ''
- ; --------------------------
- ; Your variables here
- ; --------------------------
- CODESEG
- Startcode:
- ; ---------- שולח נתונים לפונקציית יוצר הריבועים, (ירוק) שולח נתונים לביפר
- proc green
- push bx
- mov al, [byte ptr green_brhight_color]
- mov bl, 0
- mov cx, [green_width_place]
- mov dx, [green_Length_place]
- call Square
- mov [less], 05ah ;ערכי הסאונד הפחות חשובים של הריבוע הירוק
- mov [more], 0Dh ;ערכי הסאונד היותר חשובים של הריבוע הירוק
- call Beep
- call regular_green
- pop bx
- RET
- endp green
- proc regular_green
- push bx
- mov al, [byte ptr green_color]
- mov bl, 0
- mov cx, [green_width_place]
- mov dx, [green_Length_place]
- call Square
- pop bx
- RET
- endp regular_green
- ;---------------------------------------------------------
- proc yello
- push bx
- mov al, [byte ptr ylow_brhight_color]
- mov bl, 0
- mov cx, [ylow_width_place]
- mov dx, [ylow_Length_place]
- call Square
- mov [less], 20h ;ערכי הסאונד הפחות חשובים של צהוב
- mov [more], 0eh ;ערכי הסאונוד היותר חשובים של צהוב
- call Beep
- call regular_yello
- pop bx
- RET
- endp yello
- proc regular_yello
- push bx
- mov al, [byte ptr ylow_color]
- mov bl, 0
- mov cx, [ylow_width_place]
- mov dx, [ylow_Length_place]
- call Square
- pop bx
- RET
- endp regular_yello
- ;-----------------------------------------------------
- proc blue
- push bx
- mov al, [byte ptr blue_brhight_color]
- mov bl, 0
- mov cx, [blue_width_place]
- mov dx, [blue_Length_place]
- call Square
- mov [less], 0d9h ;ער הסאונוד הפחות חשובים של חכול
- mov [more], 0fh ; ערכי הסאונוד היותר חשובים של כחול
- call Beep
- call regular_blue
- pop bx
- RET
- endp blue
- proc regular_blue
- push bx
- mov al, [byte ptr blue_color]
- mov bl, 0
- mov cx, [blue_width_place]
- mov dx, [blue_Length_place]
- call Square
- pop bx
- RET
- endp regular_blue
- ;---------------------------------------------------------
- proc red
- push bx
- mov al, [byte ptr red_brhight_color]
- mov bl, 0
- mov cx, [red_width_place]
- mov dx, [red_Length_place]
- call Square
- mov [less], 0D1h ;ערכי הסונד הפחות חשובים של אדום
- mov [more], 11h ; ערכי הסאונד היותר חשובים של אדום
- call Beep
- call regular_red
- pop bx
- RET
- endp red
- proc regular_red
- push bx
- mov al, [byte ptr red_color]
- mov bl, 0
- mov cx, [red_width_place]
- mov dx, [red_Length_place]
- call Square
- pop bx
- RET
- endp regular_red
- ;-------------------------------------------------------------
- proc Beep
- in al, 61h
- or al, 00000011b
- out 61h, al
- mov al, 0B6h
- out 43h, al
- mov al, [less]
- out 42h, al
- mov al, [more]
- out 42h, al
- call dilay
- in al, 61h
- and al, 11111100b
- out 61h, al
- RET
- endp Beep
- ;-----------------------------------------------------------------------
- proc Square
- mov [x], cx
- mov [y], dx
- add [x], 158
- add [y], 98
- mov ah, 0ch
- Squarelop:
- Squareinloop:
- int 10h
- inc cx
- cmp cx, [x]
- jne Squareinloop
- inc dx
- sub cx, 158
- cmp dx, [y]
- jne Squarelop
- call Dilay
- ret
- endp Square
- ;---------------
- proc Dilay
- push cx
- mov cx, 3000
- dilayloop:
- push cx
- mov cx, 100
- dilayloop2:
- loop dilayloop2
- pop cx
- loop dilayloop
- pop cx
- RET
- endp Dilay
- ;--------------------
- proc random
- mov ax, 40h
- mov es, ax
- mov al, [byte ptr es:06Ch]
- and al, 0011b
- call saver
- RET
- endp random
- ;----------------------------
- proc whcing
- push bx
- mov bx, offset array
- whcingonly:
- cmp [byte ptr ds:bx], 0
- je gcall
- cmp [byte ptr ds:bx], 1
- je ycall
- cmp [byte ptr ds:bx], 2
- je bcall
- cmp [byte ptr ds:bx], 3
- je rcall
- cmp [byte ptr ds:bx], 8
- je exitwhcingonly
- rcall:
- call red
- jmp goon3
- bcall:
- call blue
- jmp goon3
- ycall:
- call yello
- jmp goon3
- gcall:
- call green
- jmp goon3
- goon3:
- inc bx
- jmp whcingonly
- exitwhcingonly:
- pop bx
- RET
- endp whcing
- ;--------------
- proc saver
- mov bx, offset array
- add bl, [cunter]
- mov [byte ptr bx], al
- call whcing
- ret
- endp saver
- ;-------------
- proc thestart
- xor cx, cx
- xor ax, ax
- mov cl, [cunter]
- inc cx
- mov bx, offset array
- mov al, 8
- deliting:
- mov [bx], al
- inc bx
- loop deliting
- afterloop:
- mov bx, 0
- mov cx, 0
- mov [cunter], 0
- jmp start
- RET
- endp thestart
- ;-------------------------------------------------------------------------------------------------------------------
- start:
- mov ax, @data
- mov ds, ax
- mov ax, 13h
- int 10h
- mov [cunter], 0
- call regular_red
- call regular_blue
- call regular_green
- call regular_yello
- mov [cunter], 0
- call dilay
- mainloop:
- call dilay
- call random
- mov bx, offset array
- activloop:
- cmp [byte ptr bx], 8
- je Endactiv
- mov ah,0Ch
- mov al,07h
- int 21h
- cmp al, 115
- je gtest
- cmp al, 97
- je ytest
- cmp al, 119
- je btest
- cmp al, 113
- je rtest
- cmp al, 114
- jne Erormesseg
- jmp restsrt
- Erormesseg:
- mov dx, offset Erormessage
- mov ah, 9h
- int 21h
- jmp activloop
- rtest:
- call red
- cmp [byte ptr bx], 3
- jne bay2
- jmp goon4
- btest:
- call blue
- cmp [byte ptr bx], 2
- jne bay2
- jmp goon4
- ytest:
- call yello
- cmp [byte ptr bx], 1
- jne bay2
- jmp goon4
- gtest:
- call green
- cmp [byte ptr bx], 0
- jne bay2
- goon4:
- inc bx
- jmp activloop
- Endactiv:
- call dilay
- call dilay
- inc [cunter]
- cmp al, [randomchiter]
- je dilaer
- jmp mainloop
- dilaer:
- call dilay
- call dilay
- call dilay
- jmp mainloop
- bay2:
- mov [less], 0f9h
- mov [more], 0fh
- call Beep
- call Beep
- call Beep
- call Beep
- mov dx, offset scoremessage
- mov ah, 9h
- int 21h
- call dilay
- call dilay
- call dilay
- call dilay
- call dilay
- call dilay
- call dilay
- call dilay
- call whcing
- call dilay
- mov dx, offset playagain
- mov ah, 9h
- int 21h
- mov ah,0Ch
- mov al,07h
- int 21h
- cmp al, 115
- je restsrt
- jmp exit
- restsrt:
- call thestart
- exit:
- mov ah,0
- mov al,2
- int 10h
- mov ax, 4c00h
- int 21h
- END start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement