pouët.net

Teaching assembly

category: code [glöplog]
If you were to teach someone assembly what architecture would you teach first? I would do 68000 assembly
added on the 2021-11-23 00:02:19 by sigflup sigflup
Ben Eater does a fantastic job teaching 6502 on his YT channel.
added on the 2021-11-23 00:24:02 by Gargaj Gargaj
Yeah, I think 6502 would be better then 68000.
added on the 2021-11-23 00:45:30 by sigflup sigflup
I have only ever written one assembly program on my Atari 800XL back in the day, a simple digital clock. But it was simple as I addressed the video area of memory directly with the ASCII codes for 0..9 and a delay for the seconds. In any case, I'm not quite sure I understood what I was doing, it was likely a fluke that it worked.

I've always preferred interpreted/compilable languages like BASIC and Pascal.
added on the 2021-11-23 00:48:14 by Foebane72 Foebane72
On the other end of the spectrum would be just straight up x86 ASM in Visual Studio, inlined in C so that whoever is learning gets the advantages of being able to step through the Assembly and view register states.
added on the 2021-11-23 00:55:45 by Gargaj Gargaj
When I was in college (back in the early 70s) we started with 68000 assembly 'cause it was more readable' and then went to x86. I always found it weird, cause you had to kinda swap your whole mindset. Then again, I can't code for shit.

Also bummed out on not buying all the Atari Falcons they sold off for 25 guilders a pop (~12 euro) when they retired the 68k asm courses.

Sorry this post is super unhelpful.
added on the 2021-11-23 11:08:47 by okkie okkie
I totally recommend the book "Programming the Z80" by Rodnay Zaks. I honestly think that it's the best book for learning to code in machine code (and to understand how computers really work).

Anyways, after you learn Z80, go for 68000 / 020. :]
added on the 2021-11-23 13:56:29 by ham ham
Who would that "someone" be and what do they want to do?
added on the 2021-11-23 13:58:07 by noname noname
I'd be torn between x64 and z80, honestly.
added on the 2021-11-23 14:19:49 by sol_hsa sol_hsa
I am obviously biased, but I'd definitely go for Z80. Because it is as non-orthogonal as it gets, and with this kind of assembly it feels like a wonderland, where nothing is what it seems.
added on the 2021-11-23 19:07:21 by introspec introspec
why not ARM? Played sometime ago with GBA (Arm7) and it's pure fun (okay, I'm used to x86 and I guess everything is more fun than that ;)
added on the 2021-11-23 19:27:27 by Asato Asato
Yes. ARM has an excellent assembly language. Very orthogonal and with many powerful instructions.
added on the 2021-11-24 00:05:58 by ham ham
Yeah, ARM seems like a good one. For me i'd teach the way I learned, first assembly and then C. My friend sabrina wants to learn.
added on the 2021-11-24 01:15:56 by sigflup sigflup
Highly recommend Ben Eater's 6502 series then.
added on the 2021-11-24 01:54:21 by Gargaj Gargaj
TIS 100

It's a video game with an imaginary computer platform. The assembly is extremely limited, only 15 instructions if I recall correct, making it super easy and quick to grasp.
added on the 2021-11-24 02:07:45 by Zavie Zavie
If we're going games, I'd pick human resource machine over TIS100 for beginners.
added on the 2021-11-24 09:11:07 by sol_hsa sol_hsa
I can't code (much) but ARM seems to have more wind than x86 these days if future proofing is a concern.
added on the 2021-11-24 09:46:33 by El Topo El Topo
I learned MIPS32 assembly first (which I found conveniently easy at the time), and much later x86. 6502 sounds like a really good place to start imo though :) a shame that I only stumbled on it now
added on the 2021-11-24 10:22:10 by NR4 NR4
Quote:
If we're going games, I'd pick human resource machine over TIS100 for beginners.

Agreed, it's a very visual fun form of Assembly.
added on the 2021-11-24 13:17:53 by Gargaj Gargaj
Not demoscene orientend, but the Atmel MegaAVR is a nice and modern/compact ISA and there are plenty of tools and hardware (Arduino Uno https://gist.github.com/mhitza/8a4608f4dfdec20d3879 https://medium.com/jungletronics/meeting-assembly-hello-world-arduino-blinking-code-330386652309) to get something interesting working in a limited amount of time.

One you get that, something bigger like ARM is easier to grasp.
added on the 2021-11-26 13:41:39 by trc_wm trc_wm
I'd go with 68k, preferably 68020 or higher for the flexible addressing modes

Ben Eater's videos are great and all but with a 6502, Z80 or even modern 8-bit processors I think that you might spend too much time trying to work around limitations of the processor rather than learning how to think assembly.
Save those videos for people who want to learn more about hardware.

ARM might be more relatable to people since they have it in their phones and whatnot so if motivation is an issue and you expect "what is this good for?" then it could be worth going with that.
added on the 2021-11-26 22:37:42 by bore bore
In the few occassions where i needed to give new colleagues a brief introduction into assembly (usually PowerPC), i always ended up referring to 68000 because
a.) fundamental operations are very easy to understand and complete (move, add, sub, mul, div, cmp),
b.) two explicit operands make it easy to understand what goes where,
c.) explicit separation into data and address registers - after all, explicit effective adddress calculation is essential in assembly while it's usually implicit in high level languages and
d.) flat memory model (!)

6502 might look simpler at first, but is way more restricted, instructions implicitely target registers and indirect addressing over the zero page is hard to grasp for a beginner. I've been into ARM and PowerPC projects and they're easy to read but not that easy to write as far as i can tell.

Just my two pence.
added on the 2021-11-28 15:31:19 by Paranoid Paranoid
@sigflup

Systems like 68000 or x86 are still a good gym.

But I guess it depends what the goal is.
added on the 2021-11-28 16:35:11 by AlienTech AlienTech

login