How did you learn assembly [solved]

djsfantasi

Joined Apr 11, 2010
9,160
I had a college course that taught assembler in a unique way. You started by implementing your own by coding a processor simulator. Your choice of languages. Your grade was based on how well the simulator worked running the instructors code.
 

MaxHeadRoom

Joined Jul 18, 2013
28,681
In my case, I had to learn it the hard way, quickly, I was brought in to look after a couple of early CNC machines running PDP-8 processors. one was to convert the teletype input to RS32 etc.
 

geekoftheweek

Joined Oct 6, 2013
1,214
I tried learning from a book back in the day of the IBM PC on a "clone" using DOS debug. Long story short I didn't get far and being in a farming area there was really no one I knew to go to and learn anything (if only the internet was around then... or I wouldn't have quit after one semester of school). Sometime around 2000 I decided to give it another try and found by then it really wasn't worth the effort anymore. I did learn a great deal of how a PC works internally though and so it was worth it in that respect.

I have been playing with PICs for the last 10 years here and there and have done everything is assembly with them. The only exception was the first 18F2550 USB program that I downloaded to learn how it worked. It didn't take long before I translated it to assembly.

With a little thought and planning you can create enough macros in assembly to make your program almost look like a C program. I have a few that are close other than a few lines in between to take care of things better left outside of macros. It's things like nested loops, "if / else if / else", and "case" type stuff that C really helps with. Not having to keep track of what memory bank you are in is nice too, but with the PIC18 and 24 (never tried a 32 or DSP yet) there is enough "access" memory and "FSRs" to work with to not have to worry too much about bank selection until you get into peripherals that aren't common to the family or a few other odd situations.
 

dcbingaman

Joined Jun 30, 2021
1,065
1980's when I was a teenager in high school. Had a Commodore 64/128 computer. Started with Basic and moved on to assembly language, that was with a 6502 processor. Built accounting software to handle my fathers construction company accounting. Later in life wrote assembly for the Intel '486 processor running DOS. Setup data acquisition software that collected rotary encoder data along with a laser interferometer data and correlated this data on a graphic display using VGA. Load of fun!

If you want to learn assembly, first decide which processor you want to learn it for. You will want to stick with that one for a while. Recommend starting with a simple 8bit processor. Because assembly is processor specific, recommend you actually learn C in the longer term. Then the code is more portable.
 

GetDeviceInfo

Joined Jun 7, 2009
2,195
I'm curious to know how you started learning assembly language.

Have you started writing assembly code for microcontrollers directly?

Did you learn by writing assembly code for PC?

What is the best way to learn assembly language?
I started with the 6502. Not quite comprehending the concept of digital, I wired the mcu to reboot, hooked the scope up and viewed it fetching it's boot vector. From there it was hand coding uveproms to execute basic instructions. A year later I was using MASM on 8086 PCs. As time went by, I moved further away from assembly.
 

nsaspook

Joined Aug 27, 2009
13,261
Most of us are embedded programmers here so the usual application programmer idioms for HLL usage are not quite on point.

Learning at least one processor specific assembly language is pretty much the norm when you debug the program using this instead of a file of results data.
 

jiggermole

Joined Jul 29, 2016
161
I learned on the Zilog Z80 for my TI-86 graphing calculator. Programming a very basic pong game. My level was really really low but I learned a boat load about how computers worked internally because of it. And a creepy ability to be able to do math in base 16. I was only able to do that stuff in my head for a little while before I lost that over time.
There were some real masters on the z80s around that time. Found and installed a port of Doom on the calc. Played extremely poorly but did run.
 

nsaspook

Joined Aug 27, 2009
13,261
I learned on the Zilog Z80 for my TI-86 graphing calculator. Programming a very basic pong game. My level was really really low but I learned a boat load about how computers worked internally because of it. And a creepy ability to be able to do math in base 16. I was only able to do that stuff in my head for a little while before I lost that over time.
There were some real masters on the z80s around that time. Found and installed a port of Doom on the calc. Played extremely poorly but did run.
It's seems we were all Z80 lovers.
https://forum.allaboutcircuits.com/threads/memio-emulator-for-z80.117003/post-916798

C for the Z80 using the SDCC compiler.
 

jiggermole

Joined Jul 29, 2016
161
cause that chip was in damn near everything. TI-8x calculators, the sound chip for the sega genesis, and a number of home computers used it for the brain. The Z80 was everywhere. It was the z80 and the m6800 from motorolla that i remember growing up. I had the TI-86 so it was the z80 I cut my teeth on, but a buddy of mine cut his on the m6800.
And doing it the hardest way possible too. Did anyone else write it out in human readable, convert to hex, then type the hex in line by line on the device to run it?
 
Last edited:

Dave Lowther

Joined Sep 8, 2016
224
@Pushkar1 you may find this book helpful if you want to do AVR asm. The version of Avr tools used are out of date but I used the book to get started with ATtiny asm and Atmel studio a couple of years ago.

I first learnt assembly language by first learning how to program the Z80 in machine code. I built myself a Z80 board with switches to input binary code into RAM one byte at a time. I suppose the 'assembly language' part of this learning was from the Z80 instruction reference that I used to obtain the binary code from the 'assembly language' instructions. I was the assembler :)
 
Top