Provide the missing lines to implement a Jump Table in the Assembly Code below: (Note: no default case is required for e
Posted: Sun May 15, 2022 12:40 pm
Provide the missing lines to implement a Jump Table in the
Assembly Code below:
(Note: no default case is required for entries other than the three
shown)
BR main
odd: .equate 0
main: SUBSP 2,i
STRO msgIn,d ; cout << "Enter 1,3 or 5” << endl;
DECI odd,s
{your lines will be inserted here}
case1: STRO msg1,d
BR endCase
case3: STRO msg3,d
BR endCase
case5: STRO msg5,d
endCase: CHARO '\n',i
ADDSP 2,i
STOP
msgIn: .ASCII "Enter 1, 3 or 5 \x00"
msg1: .ASCII " One \x00"
msg3: .ASCII " Three \x00"
msg5: .ASCII " Five \x00"
.END
Assembly Code below:
(Note: no default case is required for entries other than the three
shown)
BR main
odd: .equate 0
main: SUBSP 2,i
STRO msgIn,d ; cout << "Enter 1,3 or 5” << endl;
DECI odd,s
{your lines will be inserted here}
case1: STRO msg1,d
BR endCase
case3: STRO msg3,d
BR endCase
case5: STRO msg5,d
endCase: CHARO '\n',i
ADDSP 2,i
STOP
msgIn: .ASCII "Enter 1, 3 or 5 \x00"
msg1: .ASCII " One \x00"
msg3: .ASCII " Three \x00"
msg5: .ASCII " Five \x00"
.END