woodpecker 0 #1 December 26, 2007 Here is what I have so far. I just cant figure out the LMC code for the gaps I have. I'm trying to input information and have it stored in consecutive mailboxes every input, when 999 is input the program runs. (Basically writing a program loader) 88 INP 901 ; input a value 89 SUB 97 297 ; subtract 999 90 BRZ 01 701 ; done loading, jump to 01 for execution 91 ADD 97 197 ; Restored the instruction by adding 999 back to the calculator 92 STO 01 301 ; store to 01, 02, 03, and so on 93 LDA 92 592 ; load the store instruction’s current value to calculator 94 … ; increment value in calculator by 1 95 … ; modify the store instruction in 92 96 … ; jump back to get another instruction from in basket 97 DAT 999 999 ; value 999 for testing 98 DAT 001 001 ; value 1 for incrementing store indexSONIC WOODY #146 There is a fine line between cockiness and confidence -- which side of the line are you on? Quote Share this post Link to post Share on other sites
shropshire 0 #2 December 26, 2007 LOOP : INPUT // input into acc STORE temp // Save to temp location SUB sentinel // check to see if 999 BZ start // YES so goto START LOAD temp // get the number back from temp STORE *location // save to mailbox saved in location ADD one // increment the location pointer STORE location // save the location pointer BR loop // get the next input HALT // end of program //DATA one DAT 01 //constant 1 sentinel DAT 999 //constant 999 //VARIBLES temp DAT //temprary store location DAT 01 // location pointer, starts as 1 Actually, you should also put a check into ensure that you dont input too many values or you will walk all over your original code and data.. (.)Y(.) Chivalry is not dead; it only sleeps for want of work to do. - Jerome K Jerome Quote Share this post Link to post Share on other sites
wildcard451 0 #3 December 26, 2007 I hate you both for giving me flashbacks to college. Quote Share this post Link to post Share on other sites
woodpecker 0 #4 December 26, 2007 You know you love me still. When is the next boogie?SONIC WOODY #146 There is a fine line between cockiness and confidence -- which side of the line are you on? Quote Share this post Link to post Share on other sites
shropshire 0 #5 December 26, 2007 I can understand your hatred of Billy, but moi? surely not (.)Y(.) Chivalry is not dead; it only sleeps for want of work to do. - Jerome K Jerome Quote Share this post Link to post Share on other sites