.data msg1: .asciiz "\n____________ Welcome_______________\n ----------- Assembley Cricket Legue -----------\n\t === === \n\t|| || ||\n\t|| || || *\n\t|| || || * *\n\t|| || || * *\n\t|| || || * A C L *\n\t|| || || * *\n\t|| || || * *\n * *\n *\n ******* Game Instructions Are******* \n The Keys you can use in this game are only numeric Keys \n The Match will be of Two Overs\n \nThere will be two Players" selectplayer: .asciiz " Press 1 to Choose Player '1' and Press 2 to Choose Player '2'\n " play1: .asciiz "\nPlayer1 turn\n" play2: .asciiz "\nPlayer2 turn\n" ballmsg: .asciiz " Star Balling now...\nEnter any key For balling\n" play_again: .asciiz "\nPress Y to Play again and Press Enter to Quit the Game" player2turn:.asciiz "\n Player 2 Turn" Win1:.asciiz "\nPlayer 1 Wins" Win2: .asciiz "\nPlayer 2 Wins" errormsg: "\n Wrong Choice Restarting the Game " ball_no: .asciiz " Ball no. :" scoremsg: .asciiz "\nScore is:" total: .asciiz "\nTotal Scores:" ballend: .asciiz "\nBalls Are Ended\n\n " new: .asciiz "\n" ####################### Main Program ################################## .text .globl main main: li $k1,1 #########################MESSAGES############## la $a0,msg1 li $v0,4 syscall la $a0,selectplayer li $v0,4 syscall li $v0,5 syscall move $t2,$v0 beq $v0,1,player1 beq $v0,2,player2 la $a0,errormsg li $v0,4 syscall j main player1: beq $k1,3,compare li $t2,1 la $a0,play1 li $v0,4 syscall li $k0,0 j ball player2: beq $k1,3,compare li $t2,2 la $a0,play2 li $v0,4 syscall li $k0,0 j ball ball: li $t1,1 la $a0,ballmsg li $v0,4 syscall balling: beq $t1,13,continue1 li $v0,12 syscall la $a0,new li $v0,4 syscall la $a0,ball_no li $v0,4 syscall move $a0,$t1 li $v0,1 syscall la $a0,scoremsg li $v0,4 syscall la $a0,1 la $a1,7 li $v0,42 syscall move $s0,$a0 add $k0,$s0,$k0 li $v0,1 syscall addi $t1,$t1,1 j balling continue1: la $a0,ballend li $v0,4 syscall la $a0,total li $v0,4 syscall move $a0,$k0 li $v0,1 syscall beq $t2,2,lab move $s1,$k0 lab: beq $t2,1,lab2 move $s2,$k0 lab2: addi $k1,$k1,1 beq $t2,1,player2 beq $t2,2,player1 compare: compare1: bgt $s1,$s2,compare2 la $a0,Win2 li $v0,4 syscall j exit compare2: la $a0,Win1 la $v0,4 syscall exit: la $a0,play_again li $v0,4 syscall li $v0,12 syscall beq $v0,'y',main li $v0,10 syscall
Cricket Game In Assembly Language
Post A Comment:
0 comments: