Question Purpose: The purpose of this labwork is to practice arithmetic operations in M6800 assembly language programming. 1) Write an assembly language program which implements the following arithmetic operations: \[ \begin{array}{l} x=x * 3 \\ y=y / 8 \\ x=(x * 5)-(y * 7) \end{array} \] *You should store \( x \) in the address \( 50 \mathrm{H} \) and \( y \) in the address \( 60 \mathrm{H} \). 2) Run your code with the following data and write a report explaining the results. In each case, convert your results into decimal and write if it is correct or not. If it is not correct, explain the reasons. a) \( x=5, y=20 \) b) \( x=10, y=24 \) c) \( x=1, y=40 \)

2MQILN The Asker · Computer Science

Transcribed Image Text: Purpose: The purpose of this labwork is to practice arithmetic operations in M6800 assembly language programming. 1) Write an assembly language program which implements the following arithmetic operations: \[ \begin{array}{l} x=x * 3 \\ y=y / 8 \\ x=(x * 5)-(y * 7) \end{array} \] *You should store \( x \) in the address \( 50 \mathrm{H} \) and \( y \) in the address \( 60 \mathrm{H} \). 2) Run your code with the following data and write a report explaining the results. In each case, convert your results into decimal and write if it is correct or not. If it is not correct, explain the reasons. a) \( x=5, y=20 \) b) \( x=10, y=24 \) c) \( x=1, y=40 \)
More
Transcribed Image Text: Purpose: The purpose of this labwork is to practice arithmetic operations in M6800 assembly language programming. 1) Write an assembly language program which implements the following arithmetic operations: \[ \begin{array}{l} x=x * 3 \\ y=y / 8 \\ x=(x * 5)-(y * 7) \end{array} \] *You should store \( x \) in the address \( 50 \mathrm{H} \) and \( y \) in the address \( 60 \mathrm{H} \). 2) Run your code with the following data and write a report explaining the results. In each case, convert your results into decimal and write if it is correct or not. If it is not correct, explain the reasons. a) \( x=5, y=20 \) b) \( x=10, y=24 \) c) \( x=1, y=40 \)
Community Answer
FAKXZF

【General guidance】The answer provided below has been developed in a clear step by step manner.Step1/1Here is the assembly language program that implements the given arithmetic operations:ORG $1000LDAA #$03 ; load the value 3 into accumulator ALDA 50H ; load the value of x from memory into accumulator AABX ; add 50H to the index register, so it points to the address of xADDA ,X ; add the value of x to accumulator AASL A ; multiply accumulator A by 2 (shift left)ADDA ,X ; add the value of x to accumulator A againSTA 50H ; store the new value of x in memory at address 50HLDA 60H ; load the value of y from memory into accumulator AABX ; add 60H to the index register, so it points to the address of yLSR A ; divide accumulator A by 2 (shift right)LSR A ; divide accumulator A by 2 again (shift right)LSR A ; divide accumulator A by 2 again (shift right)STAA ,X ; store the new value of y in memory at address 60HLDA 50H ; load the value of x from memory into accumulator AABX ; add 50H to the index register, so it points to the address of xASL A ; multiply accumulator A by 2 (shift left)ADDA ,X ; add the value of x to accumulator AASL A ; multiply accumulator A by 2 again (shift left)ADDA ,X ; add the value of x to accumulator A againASL A ; multiply accumulat ... See the full answer