!Write a program that evaluates one of the following equations depending on !the value of Z. ! ! If Z is 1 ! X = A + B ! Else if Z is 2 ! X = A*B ! Else ! X = A*B + A + B ! !Try your program with the following values: ! ! A = 0x0010 ! B = 0x0022 ! Z = 0x0002 ! !Also try your program with Z = 0x0001 and Z = 0x0003. ! org: 0x0030 X: 0x0000 ! Result X. A: 0x0010 ! A B: 0x0022 ! B Z: 0x0002 ! Z zero: 0x0000 temp: 0x0000 org: 0x0000 load RI=[zero] ! set index register to zero load RA=[Z+RI] ! load Z dec ! Try Z = 1 load [temp+RI]=RC ! save Z - 1 load RI=[temp] ! load Z - 1 in RI to check for zero jz ifOne ! if Z = 1 jump to A + B evaluation load RI=[zero] ! Reset RI to zero load RA=[temp+RI] ! load Z - 1 dec ! Try Z = 2 load [temp+RI]=RC ! save Z - 2 load RI=[temp] ! load Z - 2 in RI to check for zero jz elseIfTwo ! else if Z = 2 jump to A*B evaluation jmp else ! else jump to A*B + A + B ifOne: load RI=[zero] ! set index register to zero load RA=[A+RI] ! Begin A + B. Load A into RA load RB=[B+RI] ! load B into RB add ! add A and B load [X+RI]=RC ! save results jmp endIf ! jump to end elseIfTwo: load RI=[zero] ! set index register to zero load RA=[A+RI] ! Begin A*B. Load A into RA load RB=[B+RI] ! load B into RB mult ! multiply A and B load [X+RI]=RC ! save results jmp endIf ! jump to end else: load RI=[zero] ! set index register to zero load RA=[A+RI] ! Begin A*B + A + B. Load A into RA load RB=[B+RI] ! load B into RB mult ! multiply A and B mov RB=RC ! move A*B into RB add ! add A*B with A mov RB=RC ! move A*B + A into RB load RA=[B+RI] ! load B into RA add ! add A*B + A with B load [X+RI]=RC ! save results endIf: halt ! stop program