Hacker News new | ask | show | jobs
by marcosdumay 4536 days ago
Honestly, with so few bits, I was expecting it to be a lookup table. (Yep, I've never wrote ARM assembly.)

But then, this way you have a nice set of imediates (as you said), and can set any value at all with at most 3 instructions at the rare case you need something different.

1 comments

> I was expecting it to be a lookup table.

There's one ISA I've worked with before that does have -2, -1, 0, 1, 2, and some other "commonly used constants" like powers of 2 encoded specially in the immediate. I think it was an 8-bit, but I can't remember exactly which one. Anyone know what I'm referring to?

Similar, but not what you're thinking of: the x87 instruction set has instructions to push the values 1.0, lb(10), lb(e), pi, lg(2), ln(2), and 0.0.
The MSP430 has a constant generator register, which depending on the access mode used will generate offsets and zero. I'm sure there are a few others.
That's the scheme. Although probably MSP430 took its inspiration from the one I had in mind since I was thinking of an 8-bit MCU from the early 80s - might've been Motorola.
MSP430?
If the reply link is missing on a comment (it does that after the comments get to a certain depth of nesting) then click on the comment's "link" and you'll get a text box you can reply into.
Not sure why you're telling me this, I suggested MSP430 to the parent post as an answer for the ISA he was looking for.
Ah ok, theatrus2 was the only mention of MSP430 in the discussion under userbinator and in the absence of a "How about " in front of "MSP430?" I assumed you meant "What's a MSP 430?" in reply to theatrus2....but then I should've checked the comment times :)