DEV Community

Cover image for Let's Assembly !
Bek Brace
Bek Brace

Posted on

Let's Assembly !

Hey my DEV friends 🙋‍♂️ - Hope you're doing well and staying safe.

Assembly language is a low-level programming language designed to simplify the instructions fed into a computer's Central Processing Unit - for short CPU - We can say now that it's a human-readable
abstraction on top of machine code so you as a programmer don't have to count the ones and zeroes.

On my channel, I have a quick tutorial that shows you how to write a "Hello World" program - you can check it out.
I am also planning to create a series of assembly language tutorials that explains everything in assembly like memory segments, registers, etc..

You have to know that the first assembly language was created by Kathleen Booth, she also designed the assembler and autocode for the first computer systems at Birkbeck College at the London University.

Image description

Assembly language was used in 1947 for the all-purpose electronic computer, and over the next decade it evolved into many different formats to power the super computers of the day like the IBM 7090 which had a 20 million dollar price tag in today's dollars writing code. What's interesting here is that Assembly was standard until the emergence of high level languages like fortran a few years later however Assembly is still used today for direct
access to the bare metal hardware and to address low-level performance issues on device drivers and embedded systems.
Assembly also is used to run native software in a web browser via
WebAssembly.
You have to be aware of one important thing and that is: each assembly language only works on a specific SCPU Architecture like ARM for apple silicon and Raspberry pi or x86 for intel chips.

You can check out my video 🙂, but just to tell how you can write a simple assembly program, you will need:

1- An assembler : i.e The net wide assembler for X86 chips.
2- An assembly program, which is divided into three sections:
a- |the text section| Contains the actual logic for the
program, it contains an entry point called start which is
where the code will start executing.
b- |the block starting symbol section| Contains variables
that might change throughout the lifecycle of the app.
c- |the data section| This is where we can initialize
constants or data that does not change to declare a constant
like a string.

we start with a label then use DB for Defined Byte to place the hello world string into memory by itself it doesn't do anything and to print it to the standard output we will also need it to length we can use equate to convert a symbol into a constant. The $ dollar sign will subtract the current position from the hello label providing the length of the string and now these constants can be referenced from the start label in the main program.

Image description

Each line of code contains an instruction along with one or more operands and there are hundreds of instructions built into the language.

Thank you for reading - maybe and watching - and I will see you in the next blog post.✌️🙂
Over and Out 👊- Bek.

Top comments (1)

Collapse
 
artydev profile image
artydev

Thanks you🙂