Use the course slides and the HC12 Instruction Table to determine solutions to e
ID: 3745584 • Letter: U
Question
Use the course slides and the HC12 Instruction Table to determine solutions to each of the following. 1. Write a code segment that adds the immediate values $29 and $42, with the final result located in register A. Determine the value of the result. 2. Write a code segment that uses one instruction to add 1 to register B. 3. Write a code segment that uses one instruction to subtract 1 from register X. 4. Write a code segment that loads the value $1234 into register D 5. Write a code segment that loads $54 into B, then stores the value in register B to address SA100. Show the bracket notation used to indicate the contents and address, assuming the code has executed. Go 6. Write a code segment that loads $5678 into X, then stores the value in register X to address SD020. Show the bracket notation used to indicate the contents and addresses, assuming the code has executed.Explanation / Answer
MVI B, 29;copy 29 to register B MOV A, B;move contents of B to Accumulator MVI B, 42;copy 42 to B ADD B;Add contents of accumulator and contents of B HLT;exit program INR B; Increments the contents of B by 1 DCX X;Decrements the contents of register pair X by 1 MVI D, 1234; copying the immediate value 1234 to D MVI B, 54;copying the immediate value 54 to register B LXI H, A100H;Making H point to memory location A100 MOV H, B;copy contents of B to the memory location pointed by H
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.