Menu

[Solved]Q1 1 15 Marks Write Following Code Segment Assembly Language Instruction Set Shown Table 1 Q37037876

Q1) 1 15 marks] a) Write the following code segment in assembly language. The instruction set is shown in table 1. I) F(x) 3x

Q1) 1 15 marks] a) Write the following code segment in assembly language. The instruction set is shown in table 1. I) F(x) 3x+1 Instruction Description Load X Load contents of address X into II) if X> 1 then AC. Store X Store contents of AC at address X Add X Add contents of address X to AC X := 0; endif and store the result in AC Subtract contents of address X from AC and store the result in AC Input a value from the keyboard Subt X Input Output b) Describe in words what the following progranm does into AC LOAD X Output the value in AC to the display L, SUBt 2 STORE X LOAD Y ADD X STORE Y LOAD X SKIPCOND 400 JUMP L Halt Skipcond 400 Skip the next instruction if AC0 Skipcond 800 Skip the next instruction if AC> 0 Jump X Go to instruction at address X Halt Terminate the program. x, dec 6 Y, dec 0 z, dec 1 Show transcribed image text Q1) 1 15 marks] a) Write the following code segment in assembly language. The instruction set is shown in table 1. I) F(x) 3x+1 Instruction Description Load X Load contents of address X into II) if X> 1 then AC. Store X Store contents of AC at address X Add X Add contents of address X to AC X := 0; endif and store the result in AC Subtract contents of address X from AC and store the result in AC Input a value from the keyboard Subt X Input Output b) Describe in words what the following progranm does into AC LOAD X Output the value in AC to the display L, SUBt 2 STORE X LOAD Y ADD X STORE Y LOAD X SKIPCOND 400 JUMP L Halt Skipcond 400 Skip the next instruction if AC0 Skipcond 800 Skip the next instruction if AC> 0 Jump X Go to instruction at address X Halt Terminate the program. x, dec 6 Y, dec 0 z, dec 1

Expert Answer


Answer to Q1) 1 15 marks] a) Write the following code segment in assembly language. The instruction set is shown in table 1. I) F(… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *