This preview shows page 1. Sign up to view the full content.
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
This note was uploaded on 11/22/2011 for the course ECE 350 taught by Professor Staff during the Spring '08 term at Alabama.
- Spring '08