ece109_InClass12

ece109_InClass12 - LD R1, MASK AND R3, R3, #0 ; counter = 0...

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

View Full Document Right Arrow Icon
ECE 109 Spring 2010 Name:__________________________________________ March 4, 2010 Class Assignment 12 In the figure, show the contents of memory after the following LC-3 assembly language program is assembled and loaded. ; This program counts the number of ones ; in the value in R0. .ORIG x3000
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: LD R1, MASK AND R3, R3, #0 ; counter = 0 LOOP AND R3, R0, R1 ; test bit BRz SHIFT ADD R3, R3, #1 ; incr counter ; shift mask to the left SHIFT ADD R1, R1, R1 BRnp LOOP ; if zero, all done HALT MASK .FILL #1 .END Memory x0000 x3000 x3001 x3002 x3003 x3004 x3005 x3006 x3007 x3008 x3009 xFFFF...
View Full Document

This note was uploaded on 04/18/2010 for the course ECE 109 taught by Professor Bradley during the Spring '08 term at N.C. State.

Ask a homework question - tutors are online