I want to learn assembler. Do I? If so x86 or arm?

Learning ASM is more about getting the hang of what CPUs actually do, it’s much less about the details of the instruction set you choose to target. It isn’t that they’re all the same, but then again, they kind of are: there are a surprising number of ‘exotic’ chips out there, but if you restrict yourself to “CPUs for which I can buy a devboard which will run Unix”, it’s not that many, and they aren’t that different.

Since you use an M1, just learn aarch64. That way you can run your binaries directly on your computer, which is more fun.

I suggest you don’t start with WASM though. Two reasons: main one is that the WASM VM is a stack machine, which leads to very different assembly. The other is that the WASM instruction set is very simple and easy, and you’ll have no problems writing .wat programs targeting WASM once you get the hang of assembly in general. Go in the other direction, and you’ll have to learn register allocation and calling conventions, which is at least half of the learning process over in register land. Learning RISCV/amd64/aarch64/etc. assembler after learning WASM would be more like starting over than an extension of what you learned.

3 Likes

A bit of off-topic, but…

This video-game, shown to me by my 14-years old son just a couple of hours ago,
impressed me quite well.

After I tuned up, I understood that

  • the virtual machine used in this game is probably modeled after Harvard architecture
  • instruction set is very limited, but some instructions are “high level” and some are just “jumps/branches”
  • it visually demonstrates “spaghetti code” (I mean jumping too far forth or back along a visible part of a code - just look at it!!!)

Anyway, I think the overall environment (graphics and whatnot) of this very amazing game might be a very attractive for chldren who are “IT apptitude” :slight_smile:

waiting the day we have multicore thermometers and scales. (guessing it will be right around the time they figure out how to put ads on them — stepping on your scale with the slick full screen LED screen only to have it serve you weightloss ads – can’t wait for it).

1 Like

This is how I learned to program: Robot Odyssey: The hardest computer game of all time.

I did that in 6th grade, but never actually coded until I was 20 years old in college. But that game and scheme (my first language) taught me everything.

3 Likes

Oh no that game looks tempting and like a dangerous time sink.

2 Likes

Coincidentally, I actually asked some guys who work on thermometers just the other day what ISA their machines were. They weren’t 100% sure :man_facepalming:, but guessed ARM. I’ve never done embedded programming but my understanding was that you really need to know the hardware? Probably one of the low-end ARM chips from the Cortex M series, if it’s not a Z80.

1 Like