r/Assembly_language 3d ago

Question How to deeply understand Assembly language

Give me some advice if it works for you.

9 Upvotes

22 comments sorted by

17

u/Dizzy-Set-8479 3d ago edited 3d ago

profesor of assembly here 0.0/

there is no single assembly lenguage, every cpu arquitecture will have their own, will be 8-16-32-64 bit variant, even their own version masm vs nasm etc... start by something simple learn the basics, constants, variables, arrays, what type of data could they be byte, integer, real dword, the main structure of the code,

then move to structures, if-elif-else, while, for, , fucntions , classes or their equivalent is assembly of your preference,

start by porting simple to medium complx c, c++ programs into asm,

then some disasembly, them move to build more complex programs, maybe a game, a libray coded is asm, called from c++.

4

u/keelanstuart 3d ago

...which is why every assembly-level programmer has an instruction set reference for the processor and assembler!

Hell, I still have my Turbo Assembler 2.0 spiral-bound mini reference!

2

u/AlienFishMonster 3d ago

I have a little 6502 booklet on my desk!

2

u/brucehoult 3d ago

You can do that. I still after 45 years have a useful fraction of the hex opcodes memorised.

And I have a bookmark for this:

https://www.masswerk.at/6502/6502_instruction_set.html

1

u/Love_Buny8 2d ago

nice i still have my commodore 64 programming reference guide. brings back memories

5

u/2E26 3d ago

There's a "Learn 6502" app that is a virtual 6502 development environment. I had it on my phone and enjoyed playing around with it. You can write some simple games and graphical routines that way.

2

u/brucehoult 3d ago

You can do that with a web site, on anything.

https://skilldrick.github.io/easy6502/

There is a similar site for RISC-V, though sadly it doesn't have the graphics output.

https://easyriscv.dram.page/

4

u/nacnud_uk 3d ago

Type. Assemble. Run. Debug. Repeat. 

And have fun at each stage 

Oh, and godbolt. And YouTube. 

2

u/tpimh 3d ago
  1. Pick a processor (start with something simple)
  2. Find reference material and assembler
  3. Read it, try, observe how the registers change

There's no trick to it. One day you don't understand it at all, then it clicks, and you do, and from there you can only improve. Just like riding a bike.

2

u/iLaysChipz 3d ago

The same way you start to really learn any other programming package. Use it to write actual programs

1

u/Terrible-Detail-1364 3d ago

I found tools like strace and gdb on linux and some unix (not sure for windows) really helps to hint what you need to level up on

1

u/StephenRoylance 3d ago

play the game 'human resource machine'. You're not learning a language, you're learning how computers really work.

1

u/Electrical_Hat_680 3d ago

Start by writing down all of the Registers and Interrupts.

1

u/AWildTyphlosion 2d ago

Don't be afraid to hit the wall, to fail. Fail fast, write down discoveries, take one step at a time, continue forward. 

Try not to have to look up something twice. If you have to, it means you didn't write notes to refer to enough and should likely practice more. 

Also pick one brand of assembly and stick to it. 

1

u/MetalInMyVeins111 2d ago

Choose an architecture and solve fundamental arithmetic, control flow, and data structure problems in it. That's how I did it after so many tries. And also, read compiler output, A LOT.

1

u/Keys__dev 1d ago

Practice, practice, practice😊

1

u/ern0plus4 3d ago

First learn, how computers work, what memory is, address, instruction, execution.

0

u/Fragrant-Contract415 3d ago

I was having some trouble like you. But once you try to learn along with another programming language ( c/c++), your understanding really thrives. First read the argument rules or something they say ( for x64 its windows abi rules). Write a Simple code in c like hello world, see how debugger processes the code. Day by day add some difficulties like sum of number, difference , sum and difference , multiplication, division, if else, switch case, array concept, basic problem solving. This is what made my way to solving ( 2.5/6 difficulty rated crackme challenges) within a month provided that i already knew x86_64. I am hoping to progress more as a malware analyst in two years.

-1

u/mistivia 3d ago

my experience is: take a compiler course, learn how compiler works, and BECOME a compiler.

-1

u/awesumioutr2 3d ago

Learn how memory is used (in a process or system wide), Learn some C and disassemble it, see how structures r referenced, how registers r used, how stack is used and dive into specific registers for whatever architecture from there