homework2_fall2009_key

homework2_fall2009_key - $3BFE $00 $3BFF $01 LDD REMAINDER...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
ECE 383 - Microcomputers Fall 2009 – Homework 2 Solution Problem 1 Given the following codes, what will the resulting values be at the break points for the memories and registers? ORG $1000 REMAINDER DS.W 1 STR DC.B ‘BEN’, NULL SUM DS.W 1 TEMP DS.W 1 $1000 $00 $1001 $03 $1002 $42 $1003 $45 $1004 $4E $1005 $00 $1006 $00 $1007 $D5 A $00 B $03 D $0003 X $0015 Y $0000 SP $3C00 PC $201E CCR 0 C 0 V 0 Z 0 N 1 I 0 H 0 X 1 S ORG $2000 MAIN: MOVW #0, SUM LDX #STR LOOP1: LDAB 1, X+ CMPB #NULL BEQ LOOP1_END TFR B, D ADDD SUM STD SUM BRA LOOP1 LOOP1_END: LDD SUM LDX #$0A IDIV STD REMAINDER [A BREAK POINT HERE, FILL IN THE VALUES FOR THE MEMORIES AND REGISTERS ON THE LEFT ] $3BF6 $00 $3BF7 $00 $3BF8 $00 $3BF9 $00 $3BFA $00 $3BFB $00 $3BFC $00 $3BFD $01
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: $3BFE $00 $3BFF $01 LDD REMAINDER LDY #0 ITOA1: LDX #2 IDIV PSHD INY TFR X, D CPD #NULL BNE ITOA1 [A BREAK POINT HERE, FILL IN THE VALUES FOR THE STACK MEMORIES ON THE LEFT ] LDX #STR ITOA2: PULD ADDB #0 STAB 1, X+ DBNE Y, ITOA2 $1000 $00 $1001 $03 $1002 $31 $1003 $31 $1004 $00 $1005 $00 $1006 $00 $1007 $D5 MOVB #0, 0, X [A BREAK POINT HERE, FILL IN THE VALUES FOR THE MEMORIES ON THE LEFT ] LDX #STR DISPL: LDAB 1, X+ CMPB #NULL BEQ END_OF_MAIN A $00 B $00 D $0000 X $1005 Y $0000 SP $3C00 SCI0DRL $0D SCI0SR1 $10 CCR C 0 V 1 Z 0 N 1 I 0 H 0 X 1 S SCI0BDH $00 SCI0BDL $9C SCI0CR1 $00 SCI0CR2 $0C BRCLR SCI0SR1, $80, * STAB SCI0DRL BRA DISPL [A BREAK POINT HERE, FILL IN THE VALUES FOR REGISTERS ON THE LEFT ] END_OF_MAIN: RTS...
View Full Document

Page1 / 2

homework2_fall2009_key - $3BFE $00 $3BFF $01 LDD REMAINDER...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online