News for hackers. Stuff that matters.
Re:SVC16: Simplest Virtual Computer by d3VwsX on Sunday December 15, 2024 @01:39PM (#42425084)
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).

Re:SVC16: Simplest Virtual Computer by RaftPeople on Sunday December 15, 2024 @08:06PM (#42427127)
> 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).

Re:SVC16: Simplest Virtual Computer by d3VwsX on Monday December 16, 2024 @12:56PM (#42433451)
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.
Re:SVC16: Simplest Virtual Computer by jasomill on Monday December 16, 2024 @04:12PM (#42435483)
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.