News for hackers. Stuff that matters.
Re:Z80 arithmetic: also surprisingly terrible (2018) by ygra on Monday January 14, 2019 @03:37AM (#18901584)
No idea about the Z80, but in uni we had to write assembler for a C167 which was a fun architecture and registers basically didn't exist. They were just mappings to memory in a given location. Granted, a few things only worked on registers and not on memory directly. I think something like addressing individual bits, but just reading and writing a value was effectively the same on memory and on a register name.

I had no qualms at all to use memory as variables when convenient. I didn't have to use the stack at all in all the assignments as 16 registers and a handful DB sprinkled through the code for more locations to write to were enough – the disassembler in the debugger didn't like code interspersed with data, though.

Re:Z80 arithmetic: also surprisingly terrible (2018) by userbinator on Monday January 14, 2019 @07:25AM (#18902479)
registers basically didn't exist. They were just mappings to memory in a given location

This is how a lot of microcontroller architectures work, and indeed there are C compilers for them too.