Computer Science — Assembly

Jake Cutter
Technology Hits
Published in
3 min readJun 21, 2022

Within a computing system, there are different levels of structure in computer organization. Assembly is below the languages we know today such as C++, Python, and Java. In assembly, it is the instruction-level computing. More on this below. If you enjoy the article please consider the following and like the page.

Photo by Clément Hélardot on Unsplash

What is Assembly:

Assembly is the code that is below the main language. The libraries consisting of the languages in common practice today are compiled via instructions. Instruction is one line such that the machine level is readable to a human observer.

College Studies Example

The picture above is an example of a conditional if statement. The condition above the next_op_2 is a branch instruction.

Instruction Level Meaning:

What does it mean to be at the instruction level? The instructions are held within an ISA, or Instruction Set Architecture.(Connatser) The most common are RISC-V, ARM, and x86.(Connatser)Let’s take basic addition as an example. At the instruction level you may see something like:

The li, load instruction, loads the register x7 with the value of x3. Then the next instruction loads the register x7 with the addition of x3 and x7. However, in the actual coding language it is ____. Lets take C++ for example. In C++ all you need to do is run one line.

The C code does the execution as the assembly. Where var is x3, var_2 is x7.

Types of Instructions:

Branch/Jump:

The branch and jump instructions are used for loop and conditional statements. The branch instruction carries different conditions such as equal to, less than, and greater than. The jump instruction just jumps to the given label.

Arithmetic:

Arithmetic instructions such as add, subtract, multiply, and divide are all done similarly. The instruction given is held within registers. The register value is started by a system call.

load/store:

The load and store instructions are used to give values to a given register. The load instructions give a register of the current value. Store instructions store the current value to another register.

Citations:

Cao, Qing. Professor. University of Tennessee. Knoxville, Tennessee. 2021

Connatser, M. (2022, May 31). ARM vs. RISC-V: Is one better than the other? Digital Trends. Retrieved June 21, 2022, from https://www.digitaltrends.com/computing/arm-vs-risc-v/

--

--