在MIPS汇编中创建菜单的最佳方法是什么?

时间:2016-11-16 22:24:51

标签: loops assembly mips

将这段代码简化为一个.asciiz是一个好主意(甚至可能),所以我不需要li $v0, 4 / la $a0, option1_p / syscall七次不同的时间?这个菜单是循环的,所以我相信这只会减慢程序的速度。

###########################################################
    .data
welcome_p:  .asciiz "Find how many people can legally shoot animals!\n"
menu_p:     .asciiz "Choose from the following options:\n"
option1_p:  .asciiz "1) Update the count\n"
option2_p:  .asciiz "2) Display number of licenses for particular county\n"
option3_p:  .asciiz "3) Display the county number and the number of licenses already issued to a range of counties\n"
option4_p:  .asciiz "4) Display the county number and the number of licenses already issued for all 72 counties as well as total licenses issued in the state\n"
option5_p:  .asciiz "5) Quit\n"
###########################################################

此外,我什么时候会遇到一段文字太长而无法处理的问题?

0 个答案:

没有答案