Assembly MIPS程序集中的确认对话框
我无法使用MIPS中确认对话框的代码: .data Welcome1:.asciiz "\n Hello! you are about to play the mastermind guessing and logic game,Bulls & Cows!\n The Computer will generate a secret numbermade of 4 unique integer number.You have to guess the number!\n Using the number of Bulls and Cows you get to find out what the secret number is!\n" Welcome2: .asciiz "\nEvery digit you enter that is both correct and in the right location is a BULL. When you get 4 BULLS, YOU WIN!\n\nEvery digit you enter that is correct, but not in the right location is a COW!\n" confirm: .asciiz "\n Select \nYES - if you are ready to guess \n NO - to see the rules again \n Cancel - to exit the Game\n" .text main:jal welcome welcome: la $a0,Welcome1 li $a1,1 li $v0, 55 syscall la,$a0,Welcome2 li $v0,55 syscall la $a0,confirm li $v0,50 syscall Exit: li $v0,10 syscall .数据 欢迎1:.asciiz“\n您好!您将要玩智囊团猜谜和逻辑游戏,公牛和奶牛!\n计算机将生成一个由4个唯一整数组成的秘密数字模型。您必须猜数字!\n使用公牛和奶牛的数量,您可以找到秘密数字!\n” 欢迎2:.asciiz“\n您输入的任何正确且位于正确位置的数字都是一头公牛。当您获得4头公牛时,您将获胜!\n\n您输入的任何正确但不位于正确位置的数字都是一头奶牛!\n” 确认:.asciiz“\n选择\n是-如果您准备猜测\n否-再次查看规则\n取消-退出游戏\n” .文本 主:欢迎日本航空公司 欢迎: 洛杉矶$a0,欢迎光临1 李$1,1 李$v0,55 系统调用 洛杉矶,a0美元,欢迎2 李$v0,55 系统调用 la$a0,确认 李$v0,50 系统调用 出口: 李$v0,10 系统调用Assembly MIPS程序集中的确认对话框,assembly,mips,Assembly,Mips,我无法使用MIPS中确认对话框的代码: .data Welcome1:.asciiz "\n Hello! you are about to play the mastermind guessing and logic game,Bulls & Cows!\n The Computer will generate a secret numbermade of 4 unique integer number.You have to guess the number!\n Using the nu
显然,为了让游戏正常运行,您还需要做更多的工作,但我已经能够启动一个框架框架[请原谅这种免费的风格清理]:
.data
Welcome1:
.ascii "\n Hello! you are about to play the mastermind"
.ascii " guessing and logic game,Bulls & Cows!\n"
.ascii "The Computer will generate a secret number made of 4 unique"
.ascii " integer numbers. You have to guess the number!\n"
.ascii "Using the number of Bulls and Cows you get to find out what"
.asciiz " the secret number is!\n"
Welcome2:
.ascii "\nEvery digit you enter that is both correct and in the right"
.ascii " location is a BULL. When you get 4 BULLS, YOU WIN!\n\n"
.ascii "Every digit you enter that is correct, but not in the right"
.asciiz " location is a COW!\n"
confirm:
.ascii "\n Select \n"
.ascii "YES - if you are ready to guess\n"
.ascii "NO - to see the rules again\n"
.asciiz "Cancel - to exit the Game\n"
msg_asknum:
.asciiz "\nEnter your game choice\n"
.text
main:
# show intro and rules
main_welcome:
la $a0,Welcome1
li $a1,1
li $v0,55
syscall
la $a0,Welcome2
li $v0,55
syscall
# ask user to select an action (i.e. enter data, reread rules, exit program)
main_confirm:
la $a0,confirm
li $v0,50
syscall
# the return is in a0: 0=yes, 1=no, 2=cancel
beq $a0,0,main_asknum
beq $a0,2,main_exit
b main_welcome
# ask user for the next game input
# NOTE: this is a prompt for an integer number
main_asknum:
li $v0,51
la $a0,msg_asknum
syscall
beq $a1,-1,main_asknum # syntax error
beq $a1,-2,main_confirm # cancel
beq $a1,-3,main_asknum # ok, but no data
jal do_something # do something with the number in a0 ...
j main_asknum
main_exit:
li $v0,10
syscall
# do_something -- process user's input
#
# arguments:
# a0 -- number the user entered
do_something:
jr $ra # return
大家好@user3341473,欢迎来到Stack Overflow。你能提供更多关于你的代码问题的细节吗?你期望它做什么,以及发生了什么?我正在寻找一个确认对话框,其中有选项“是”或“否”,以进一步与程序