Mnemonic FIELDS RTL Increment A by 1 3-bit D 110010 110111 3-bit SA 111001 3-bit
ID: 3860222 • Letter: M
Question
Mnemonic FIELDS RTL Increment A by 1 3-bit D 110010 110111 3-bit SA 111001 3-bit SA 3-bit SA 3-bit SA hift A Left by 1 ASHR DRI arithmetic sr RISA lear A to zero 3-bit D NDA& B RIDRI RISA" RISB OR RIDRI RISAV RISB RIDR-RISAXOR RISB 101100 01010 ransfer B 3-bit SA RIDRI RISA-se-lit -bit Literal 8-bit Literal D A & Literal 3-bit Address 3-bit Address 3-bit Address 3-bit Destination 3-bit Destination 8-bit Literal 11-bit Literal 6-bit Don't Care ra gister with long 1000010 DRI lit (HARVARD ONLY) mediate literal 16-bit Literal RIDRI MIzf ADI at AD] RISA RIDR) M [RISA] LDI d data from memory at 3-bit Address mediate address 10101 1000100 1000101 e data to memory at 3-bit Address mediate address LDR PUSH all a subroutine 1001110 PUSH PC+1 PCZf AD to immediate address 9-bit Literal 3-bit Address 3-bit Address ump to address in register 1001101 3-bit SA PC+se AD ranch to address in register if Branch to address in register if lear specified bit in register f(RISA]-= 0) PC BRN 13111 if(RISA]Explanation / Answer
Code:-
LDI R0,5110
BRZ R0,SKIP_THE_BLOCK
ADI R0,10
STI R0,5110
SKIP_THE_BLOCK:
Explanation:-
LDI R0,5115 :- will copy the data stored in memory address 5110 (as per question ) into register R0
BRZ R0,SKIP_THE_BLOCK :- will check if the R0 register have value 0 or not if 0 then it will jump to SKIP_THE_BLOCK label and x=x+10 won't be done
ADI R0,10 :- will add the 10 to the value stored in the register i.e x
STI R0,5110 :- will store the resultant value in the address which is mentioned for x i.e 5110
SKIP_THE_BLOCK :- it is label i.e denotes end of the if block