Question: I need help to get the input from the keypad using the in built MARS ( MIPS ) tool Digital lab sim. I cannot get
I need help to get the input from the keypad using the in built MARS MIPS tool Digital lab sim. I cannot get my scan function working. Here is the skeleton code so far: text # Start generating instructions
globl start # This label should be globally known
start:
li $txFFFF # Load location of number pad scan register aligned to word boundary
li $txFFFF # Load location of number pad value register
li $tx # Load base memory address of input values array
li $txFFFF # Load location of seven seg display aligned to word boundary
li $tx # Load base memory address of seg values array
li $axa # Initialise value to write to display
jal drawnum # Call the drawnum function using 'jump and link'
scan:
# Load the value of the number pad scan register into $t
lw $t$t
decodeinput:
drawnum:
add $t $t $a # Calculate address of element in array to access
lbu $t$t # Load decoder value byte from memory into $t
sb $t$t # Write decoder value to seven segment display
jr $ra # Return from function using 'jump register' and $ra
end:
b end # End at infinite loop
data # Items below this line will be stored in the
# data section of memory
# Store the listed values as bit values at the next available locations
byte xxxxxxxxxxxxxxxx
byte xFxxBxFxxDxDxxFxFxxCxxExx
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
