Question: Take the code from part 2 and modify it so that for this part, your display should only output light if the digit is being

Take the code from part 2 and modify it so that for this part, your display should
only output light if the digit is being used. This means you will have to have
some sort of check to see when you read a 0000 for a hex digit, if there are any
digits to the left of those four 0s, if there is display a hex 0, if not, turn off all the
LEDs for that display. For example, if the generated answer is supposed to be
F80B, it should display only those four digits, it should show neither 00F80B,
nor F8 B, just F80B This is part 2 "SEGMENT2: .byte 0,0
SEVEN: .byte 63,6,91,79,102,109,125,7,127,111,119,124,57,94,121,113
.text
.global _start
_start:
LDR R2,=0xff200050//pushbutton
LDR R6,=0xff200040//switches
LDR R3,=SEVEN //LUT
LDR R12,=SEGMENT
LOOP: LDRB R10,=0x000F
LDR R1,=0xff200020//seven segment 0 through 3
LDR R7,=0
LDR R11,=0
LDRB R0,[R2]//LOADING VALUE OF PUSH BUTTONS
LDRB R5,[R6]//LOADING VALUE OF SWITCHES
B MASK
MASK:
LSL R7, R5, R0
AND R8, R7, R10
LDRB R11,[R3, R8]
STRB R11,[R12]
MASK2: LSR R7, #4
AND R8, R7, R10
// LSL R7, #8
LDRB R11,[R3, R8]
STRB R11,[R12, #1]
MASK3: LSR R7, #4
AND R8, R7, R10
// LSL R7, #8
LDRB R11,[R3, R8]
STRB R11,[R12, #2]
MASK4: LSR R7, #4
AND R8, R7, R10
LDRB R11,[R3, R8]
STRB R11,[R12, #3]
MASK5: LDR R9,=SEGMENT2
LSR R7, #4
AND R8, R7, R10
LDRB R11,[R3, R8]
STRB R11,[R9]
MASK6:
LSR R7, #4
AND R8, R7, R10
LDRB R11,[R3, R8]
STRB R11,[R9, #1]
B DISPLAY
DISPLAY: LDR R4,[R12]
STR R4,[R1]
LDR R5,=0xff200030//second set of segments 4 and 5
LDR R4,[R9]
STR R4,[R5]
B LOOP
DEAD: B DEAD
.end"

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!