We are doing machine-level programming in my intro to computing class. On our fictional computer, there are sixteen opcodes, of which seven are data storage/retrieval (load effective address, load/store direct, load/store indirect, load/store base+offset). Three instructions are operators (NOT, AND, and ADD), and the remaining six are various forms of branching, of which the only two we've used are conditional branching and trap vectors.
Our assignment is to create divide and modulus functions.
To multiply, we kept a pointer, and a running total, and added until the register that kept track of the number of times we had to add reached zero. But how would that work for divide?
Our assignment is to create divide and modulus functions.
To multiply, we kept a pointer, and a running total, and added until the register that kept track of the number of times we had to add reached zero. But how would that work for divide?
