Question: Please note that this is all in assembley language, please answer all parts of the question with detailed answers so I can understand. 5. [8

Please note that this is all in assembley language, please answer all parts of the question with detailed answers so I can understand.

Please note that this is all in assembley language, please answer all

5. [8 points] Fill in the following assembly language program to find how many "1" in four 16- bit number which is located starting at the memory address 0x1234. The program should start at 0x10000 and the result (the number of"") should store in data register D3 ORG 0x10000 //Initialized 0 into D3 (the result) //set up the counter to count the 16-bit number //Pointing A0 to the initial data location //Initialized 0 into DO //Load the 16-bit number into DO and increment //A0 points to the next data location //shift 1 bit Right in DO //If the carry bit=0, branch to COUNT //otherwise, add 1 into the result //Decrement the Counter NEXT CLR . L %D0 LOOP ASR.L COUNT #1,8D3 ADD 1, L COUNT SUBI #1,8D5 BNE LOOP //compare memory location to check if all //data have been read already //YES, done //set up the counter again //NO, next data //END the program BEQ EXIT MOVE , L #16,%D 5 BRA NEXT EXIT TRAP #15 5. [8 points] Fill in the following assembly language program to find how many "1" in four 16- bit number which is located starting at the memory address 0x1234. The program should start at 0x10000 and the result (the number of"") should store in data register D3 ORG 0x10000 //Initialized 0 into D3 (the result) //set up the counter to count the 16-bit number //Pointing A0 to the initial data location //Initialized 0 into DO //Load the 16-bit number into DO and increment //A0 points to the next data location //shift 1 bit Right in DO //If the carry bit=0, branch to COUNT //otherwise, add 1 into the result //Decrement the Counter NEXT CLR . L %D0 LOOP ASR.L COUNT #1,8D3 ADD 1, L COUNT SUBI #1,8D5 BNE LOOP //compare memory location to check if all //data have been read already //YES, done //set up the counter again //NO, next data //END the program BEQ EXIT MOVE , L #16,%D 5 BRA NEXT EXIT TRAP #15

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!