Exercise_4_Answers-F09

Exercise_4_Answers-F09 - CE-320 Microcomputers I Fall B...

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

View Full Document Right Arrow Icon

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

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

Unformatted text preview: CE-320 Microcomputers I Fall B 2009 Exercise 4 Page 1 Exercise 4 Answers 1.The answers below are not unique. E2.6 ORG $1000 N1 DC.B 3 N2 DC.B 3 ORG $1100 SUM DC.B 3 LDAA N1+2 or LDD N1+1 ADDA N2+2 ADDD N2+1 STAA SUM+2 STD SUM+1 LDAA N1+1 LDAA N1 ADCA N2+1 ADCA N2 STAA SUM+1 STAA SUM LDAA N1 ADCA N2 STAA SUM E2.7 ORG $1000 N1 DC.B 6 ORG $1010 N2 DC.B 6 ORG $1020 SUM DC.B 3 LDAA N1+5 SUBA N2+5 STAA SUM+5 LDAA N1+4 SBCA N2+4 STAA SUM+4 LDAA N1+3 SBCA N2+3 STAA SUM+3 CE-320 Microcomputers I Fall B 2009 Exercise 4 Page 2 LDAA N1+2 SUBA N2+2 STAA SUM+2 LDAA N1+1 SBCA N2+1 STAA SUM+1 LDAA N1 SBCA N2 STAA SUM E2.9 ORG $1000 N1 DC.B 2 N2 DC.B 2 ORG $1010 SUM DC.B 2 LDAA N1+1 ADDA N2+1 DAA STAA SUM+1 LDAA N1 ADCA N2 DAA STAA SUM E2.13 N EQU 255 ; could be any value between 0 and 255 ORG $1000 Ans DC.B 1 ; make a place for the answer ORG $1010 Table DC.B N ; reserves N bytes for the table ORG $2000 LDX #Table MOVB #0, Ans LDAB #N Loop BEQ Done LDAA 0,X LSRA ; All odd binary numbers have a 1 in the LSB, shift...
View Full Document

Page1 / 6

Exercise_4_Answers-F09 - CE-320 Microcomputers I Fall B...

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

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