Monday, August 20, 2012

Multiplying by adding


 When running the test script I was clearing all the locations but the test script would put in the data first before I cleared then all the results would be wrong. I just had to make the result 0 every go around but since the other two memory locations were going to be over written any way I just left them alone.
            After doing this project I realized that if one plans out there project and Knows that the variable is going to be 0ver written then one does not need to clear it each time but always zero out variables that are not going to be over written but just read then written to.
The key to the multiply project is to know that when your multiplying you are adding itself to itself as many times as the multiplier says to. Also using a loops and jump statements are good.

Here was my laid out plan

//Start at fisrt memory location
//then stick that in to be computed
//then add it to itself as many times as it is supose to be multiplyed by
//use the multiplyer to controll the loop or counter

Part of the code that add'ed the data

@R1 
D=M
@R2
M=D+M
@LOOP
0;JMP


No comments:

Post a Comment

Search Engine Submission - AddMe