Hacker News new | ask | show | jobs
by d3VwsX 548 days ago
A bit confused by the goto and skip instructions. Why multiply by 4 in one, but not the other? Sounds reasonable that both keep the target address a valid instruction pointer (aligned to 4 words)?

Adding two words to create an address is a fun variation of segment pointers, but even more wasteful than x86 16-bit segment+offset pointers (not a complaint, just an observation).

1 comments

> Adding two words to create an address is a fun variation of segment pointers, but even more wasteful than x86 16-bit segment+offset pointers (not a complaint, just an observation)

I'm curious why you think it's wasteful?

It seems similar to the 6809 indexed addressing modes which I liked (a long time ago).

Two 16-bit numbers could be combined to form a 32-bit pointer. Used as segment<<4+offset they just form a 20-bit pointer. Feels like wasting 12 bits to me.
You can also look at 8086 segment/offset addressing as an attempt to avoid wasting 12 bits when using pairs of 16 bit registers to represent a 20 bit address, by allowing implicitly-sized <=64k byte segments to align on arbitrary 16 byte boundaries vs. the 64k byte alignment implied by segment<<16 + offset.