{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}


homework1_fall2009_key - chip Problem 3 Given the following...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
ECE 383 - Microcomputers Fall 2009 – Homework 1 Solution Problem 1: The microcomputer is a combination of hardware and software that can perform specific tasks according to inputs, occupying a tiny space compared to minicomputer and mainframe computer. The microprocessor is the hardware that can convert the program into specific calculations and actions. The microcontroller is a microprocessor incorporated with memories and peripherals internally, i.e. computer-on-a-
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: chip. Problem 3: Given the following C code, what is the corresponding Assembly code? ORG $1000 MAX DS.B 1 MIN DS.B 1 SUM DS.B 1 AVE DS.B 1 REM DS.B 1 STR DC.B 5, 0, 6, 1, 3 ORG $2000 MOVB STR, MIN MOVB STR, MAX MOVB STR, SUM LDX #1 FOR1: LDAA STR, X CMPA MIN BGE NEXT1 STAA MIN NEXT1: CMPA MAX BLE NEXT2 STAA MAX NEXT2: ADDA SUM STAA SUM INX CPX #5 BLT FOR1 END_FOR1: LDAA SUM TFR A, D LDX #5 IDIV TFR X, A STAA AVE TFR D, A STAA REM RTS END...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online