5 ms·
That's C with pointers. Assembly without registers is absolutely pointless since the only thing that matters in any flavor of assembly is how to get data into
by konjin 6y ago
That's C with pointers.
Assembly without registers is absolutely pointless since the only thing that matters in any flavor of assembly is how to get data into registers when you need it and then remove it before you override it.
- koolba 6y agoThe point isn’t to learn assembly, it’s to learn that all programs are just a series of instructions, operating in order, transforming memory. The loading and storing of registers is an implementation detail that’s not relevant in this context. The advantage over C is having an even more limited instruction set and using descriptive names for each instruction.
- konjin 6y agoThey don't transform memory, they load memory into registers, transform the registers and (maybe) store the registers values back into the memory. The difference is profound and until you code in assembly you have no idea why (or that) string operations are so expensive.
- koolba 6y agoAgain, the point is not to have an real language for any efficient real world usage. The point is to have a simplified language that represents a series of commands operating on a bank of memory. Like this: SET 1 100 # Set memory[1] = 100 SET 2 500 # Set memory[2] = 500 ADD 3 1 2 # Set memory[3] = memory[1] + memory[2] It's easy to explain what each individual step is meant to do and you can build up to more complicated instructions. It allows children to see the persistent effects of running the program, mutating the state of the memory, eventually introducing the instruction counter itself as a state variable.
- konjin 6y ago>eventually introducing the instruction counter itself as a state variable. If you're going to be talking about the IP register than you need to talk about the IR register. So we should avoid talking about registers by talking about registers? You're not selling this registerless assembly very well.
- koolba 6y agoIt doesn't have to be a register. Just a labeled piece of memory. It works great with children and you don't even need a computer. You can do it all on a pen and paper.