Question: Write a program in 68K assembly code that satisfies the following specifications: Your program should start at the memory location $1000 (hint: use the ORG
Write a program in 68K assembly code that satisfies the following specifications:
- Your program should start at the memory location $1000 (hint: use the ORG directive).
- Take a one byte hexadecimal value from user input and save the value at address $A000 (hint: you can consider this input a target value). You should not hardcode the inputs. You may ignore sanity check on corner cases, but assume user inputs are always in an expected format.
- Read each byte data stored in memory between the addresses $6000 and $8000 and compare it to the (byte) data at address $A000 (hint: you can consider the memory between $6000 and $8000 an array).
- Please define a LONGWORD variable called address Addr1. In the specified memory range, if the data at address $A000 is found, the longword address of the data in memory is saved into variable Addr1. If it fails to find the data within the specified memory range ($6000 and $8000), then put Addr1 = $6000, which is similar to the idea of "error code" or "invalid index" in your C++ code.
- Please define a WORD variable called address Addsum. Add a series of bytes stored in the 512 consecutive memory locations beginning at address Addr1, no matter you find the target data or not. Save the sum value into Addsum.
- There is a chance that the sum might exceed $FFFF, (exceeding the range of word value), so you will also need to store the carry bit if an overflow occurs. Store the carry bit as a BYTE variable called CarryBit.
- Print the Addr1, Addsum and CarryBit in the output window.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
