Eli5: how does assembly code work?

476 views

Eli5: how does assembly code work?

In: 24

11 Answers

Anonymous 0 Comments

At the very lowest level, CPUs have instructions baked into them. Load this value into this register, add this to that place in memory, etc. Programming in machine language means telling the CPU to run a list of these instructions. Isn’t fun because you’re just stuffing memory locations with values that represent these instructions and then telling the CPU to start executing at the beginning.

Assembler makes this easier. Instead of values, we have easy to remember mnemonics like LDX for “load X register.” Going further, your assembler may help you do programming loops and other things. It also lets you do variables, like X = “Hello” so you can use it later instead of having to manually put H, e, l, l, and o in memory locations to refer to later. And they do various other things to make programming for the CPU easier.