That is a good start, but I was hoping for a sample program, because I'm just not getting it. The simulator that I am using is called "Little Man Computer" and has 10 instructions. Read (reads the value input) , Print (sends the value in the register to the output tray) , Load (brings a number from memory storage back to the register) , Store (stores a number in the register to a designated memory location) , Stop, Add (adds the number in the register to a number from a given memory address) , Subtract (subtracts the number in the register from a number in a given memory address), Branch (jump to the designated address), BranchZ (If the value is zero, jump to the designated address), BranchP (If the value is positive, jump to the designated address). It only allows integers in the input tray, it has a maximum input of the value 499, and it has mailbox address locations 00 through 99. Thank You, Scott
Main Topics
Browse All Topics





by: warrenbucklesPosted on 2007-09-18 at 09:59:46ID: 19914638
Multiplication is a form of addition: build a loop with one of the numbers as the index and add the other number to an accumulator the required number of times - make sure you get the index correct depending on how you initialize the accumulator (to zero or the number you are multiplying).
wb