If you want to have a useful understanding of assembly in the modern world you’ll end up learning a bit of both eventually.
That being said, learn whatever your local physical machine uses. That way you’ll get to run the assembly you write on the bare metal of your actual physical sitting-in-front-of-you processor, which is totally awesome and fun.
(Beware, this much fun might cause you to spontaneously grow a grey neckbeard.)
I find that the best way to learn assembly is by reverse engineering. This is equivalent to learning to program by reading other people’s code. It’s an incredibly useful skill to have, and literally every program is available for you to reverse engineer. There is more material on reverse engineering for x86, and also more programs. Even in Apple silicon, I believe most programs are still x86, being run by Apple’s builtin emulator. I recommend R4ndom’s tutorial, which is for x86.
As an old guy who started programming with assembly language, I always advise learning this. You will gain a better and deeper understanding of how a computer works. But which one is difficult to say. I think after a while you’ll know what interests you. To get started, I would normally recommend flat assembler. But it probably doesn’t run on the Mac so I can’t give a recommendation. Except definitely try.
Full reverse engineering is probably a better exercise, but it’s also good to just read and understand the assembly output for programs you know the source for.
I have enjoyed playing around with the QBE code generation backend recently. QBE uses a simple intermediate representation and generates very nice readable assembly in my opinion. The only downside is that for x86 output it uses AT&T syntax, but the syntax differences are easy to get used to IMO.
If you know C then cproc is a nice C11 compiler that uses QBE for code generation. A nice things about QBE and cproc is that their source code is also fairly small and readable[1].
I don’t have an Apple computer, but at first glance it seems that QBE has amd64_apple and arm64_apple targets.
Yeah, mine quickly turned from black to grey, then to white. My wife says it gives me a “distinguished” look – I guess that’s just another word for “old” .
Just do it. Why spend time debating which one to learn? It’s not like if you learn x86 it will permanently ruin your ability to learn anything else. Just start on what interests you.
RISC vs CISC is not a meaningful distinction. No ISA today is meant for a small and simple in-order machine unless it’s meant to go in your thermometer.
ARM has BSL, BIF, and BIT. These are all the same ternary conditional, but with the arguments in a different order, so that the destination register is different. I don’t know what “RISC” means to you but this definitely does not qualify.
And there is no difference in ease of understanding between ARM and x86. Actually, if I had to pick, I’d say ARM is probably more difficult. x86 is straightforward and just has a lot of facilities that make sense and there is a blessed way to accomplish most things you’d want to do. ARM is a bit more… creative.
I suggest to start with whatever your Machine uses.
It is that assembly you get to see, if you run your programs in debuggers or profilers.
I love to play with small examples on Compiler Explorer. It gives easy access to documentation of the used assembly instructions. Just remember to use zigs cross compilation capabilities and add your target, like -target arm-macos
A few weeks ago I decided to learn some x86-64 assembly just for fun, and I wanted to see if I could utilise the zig build system to make linking and testing easy. As it turns out, zig does in fact make it very easy to create a static library out of your assembly code, and write tests in zig which link to that static library!
Overall I would definitely recommend diving into assembly, it was very eye opening (and fun!) for me. Just pick a flavour that works natively on your machine and go for it
I’ll leave a link to my project here since you (and anyone else that stumbles across it) might find it helpful to see an example of invoking nasm and running tests using build.zig.