1. 4

  2. 2

    On a CPU designed with OOP in mind, the CPU could have registers designed to function as the THIS and CLASS pointers, and methods and properties could be looked up by indexing off these registers.

    So, like IX and IY registers on Z80?

    Offset addressing is also needed for regular non-OO structs and even for local variables on stack. For example, sdcc uses IX as stack frame pointer (docs, section 4.3), however, sometimes it can omit it. As IX and IY operations are relatively slow on Z80, C code for it is usually slow.