posted 1 year ago
Last question of a 4 question assignment. Here is the question: " Execute CMa code assuming that prior execution of the values of SP = 0. What does the given code compute when the memory allocation with address 3 is given? ". Here is Part A instructions: loadc 0, loadc 1, loadc 13, loadc 1, le, jumpzA. Here is Part B: loada 3, loada 2, geq, jumpzB, loada 3, loada 2, geq, jumpz B, loada 3, loada 2, geq, jumpz B, loada 3, loadc 2, geq, jumpz B, loada 1, loadc 1, add, storea 1, pop, loadc 2, loada 2, mul, storea 2, pop, jumpz A, halt. OK, here is my approach and it would help if someone pointed any misconception or erroneous attempts before I try this. Basically it seems like I need to translate store, load, add into a bunch of 0's and 1's using a things like Oppcode, Assembly language instruction, etc, where, store --> 0 1 1, load --> 0 1 0, and add --> 0 0 0 with mapping Mnemonic to Oppcode is also used where A is 0 0, B is 0 1, C is 1 0, and D is 1 1. Also part of the tools would be ABC, CDA, DBA, and ADC all with add the have associated different 16 two part 8 digit strings of 0's and 1's. Now, using 3 bit Oppcode allows the processer to map 2'3 Mnemonic there are 8 instructions (this I completely don't understand). However I do get if you increase the Oppcode to 2'8, you then have 256 instructions and I see the relationship of the # of bit operator to instruction. Other but of info I got was a load's source is a memory address, not a register, and the source field is uneeded and must be zeroed out. OK. I am lost in respect to where I start, how the Mnemonics work to use the store, load, etc that specify the 3 digit Oppcode and how the assembly language instruction is produced to give a ABC --> 16 digit (0, 1), and in what order to do all this. Furthermore, I am not sure how to "execute" CMa code "assuming" that prior execution of the values of SP = 0 and what the given aforementioned code (A and B) computers to when the memory location with address 3 is given as the input. Any help is greatly appreciated, John