{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

hw12SLN

# hw12SLN - ECE 212 HW 12 SOLUTIONS p 1 of 9...

This preview shows pages 1–4. Sign up to view the full content.

ECE 212 HW 12 SOLUTIONS p 1 of 9 //home/vdimitrov/9334/395af2245a96d34bdcb495b47234ae57f9f2ab30.doc ECE 212 Homework Set 12 SOLUTIONS 1. For the given memory contents and initial register contents, determine the register contents after each instruction executes. All values are in hexadecimal. The instructions execute in sequence. Memory Location Contents 0030 AB 0031 CD 0032 EF Registers: A B X Y Initial register contents: 11 22 3344 5566 Instructions: ldaa #0x30 ldab 0x30 ldx #0x30 ldy 0x30 Solution: Registers: A B X Y Initial register contents: 11 22 3344 5566 Instructions: ldaa #0x30 30 22 3344 5566 ldab 0x30 30 AB 3344 5566 ldx #0x30 30 AB 0030 5566 ldy 0x30 30 AB 0030 ABCD Explanations: ldaa #0x30 The value 30h goes into A. ldab 0x30 The contents of memory location 0030 goes into B. ldx #0x30 The value 30 (0030) goes into X. ldy 0x30 The contents of m e mory locations 0030, 0031 go into Y.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
ECE 212 HW 12 SOLUTIONS p 2 of 9 2. Determine the contents of registers A, X, Y after each instruction executes. Instructions: Registers: A X Y ldx #0x abcd tfr X,A sex A,Y Solution: Instructions: Registers: A X Y ldx #0x abcd ?? abcd ???? tfr X,A cd abcd ???? sex A,Y cd abcd ffcd tfr X,A copies the low Byte in X into A. sex A,Y Sign Bit Extension. The value in A is sign bit extended to fill Y.
ECE 212 HW 12 SOLUTIONS p 3 of 9 In each of the remaining problems, write a 68HC12 program to perform the operations described. Include comments. 3. Read two Bytes of data from port A (read one Byte at a time – assume that a Byte is ready whenever you read it). Send their sum to port B. Neglect any overflow. Do this forever.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}