DEV Community

Cover image for Adventures in learning x86 Assembly part 1
Paul D. Paradis
Paul D. Paradis

Posted on

Adventures in learning x86 Assembly part 1

I have decided to teach myself Assembly language programming. To help myself ingrain what I am learning (and to hopefully benefit anyone who may be interested), I am going to blog about my experience. Let's begin.

A. What is assembly language?:

Assembly language is the lowest level programming language there is. Every other language utilizes built-in layers of abstraction to simplify the process of programming in order to make it easier for the developer to interact with the machine.

Conversely, when programming in Assembly, there is no layer of abstraction between the machine and the programmer. A programmer coding in assembly is working directly with ram and cpu, with no buffer. This can make the process of writing code much more tedious, but the reward is much deeper insight into how the cpu and ram interact. Taken to its logical extreme, an expert assembly language programmer can be considered a true master of computing, one who thoroughly understands computing processes at the deepest level.

The basic idea here is that what programmers write as code (Java, Python, C, Lisp, etc...) is transformed into something known as machine code, and this machine code is what the computer uses to run programs. What machine code is in essence is a string of electrical patterns.

B. These patterns of electrical currents are represented to our human minds as binary

When a program is running on a pc, program code is placed into ram and then moved to the cpu, the cpu reads these instructions and this causes the computer to perform some action. The instructions are presented to the cpu as patterns of electrical currents.

This is the reason for the 'memory' part of ram- memory modules contained in a stick of ram are basically sets of containers for electrical currents.

Because the instructions the cpu reads are patterns of electrical currents, the patterns will display various arrangements of on and off currents within the memory cells in ram. Because of this fact, the counting system known as binary has been utilized to help us (human programmers) work with these patterns of electrical currents. Essentially, a 1 is used to represent that particular memory address as being charged (current is on) while a 0 represents a memory address as being off (no charge is present at that particular memory address).

Assembly language is a type of shorthand notation that simplifies the way binary is represented, using another counting system known as hexadecimal.

Next article: binary, octal, and hexadecimal.

Top comments (1)

Collapse
 
pauldparadis profile image
Paul D. Paradis

I am going to edit this at some point. I wanted to get this out there in order to make some progress, but I will revisit at some point in time to improve upon it.