La primera rectora al frente del colegio Carlos Pellegrini habilita a los profesores a usar el lenguaje inclusivo en sus clases

Apenas sube las escalinatas de ingreso al edificio, sobre Marcelo T. de Alvear y Riobamba, Ana Barral (55) saluda a casi todos los que se le cruzan en el camino. No es una figura desconocida en la…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Commands And Directives of Assembly Programming Language

The Assembly programming language has been around longer than most people reading this were born. This long history allowed for the development of many instructions and directives unique to the Assembly programming language. Today we will explore some basic instructions pertaining to data transfers and addressing.

Figure 1: Some Assembly Code!🔥

Variables in Assembly have different data types than those in high level programming languages. These data types are more formerly known as directives. The data type must be specified in accord with its corresponding bit value. For example, defining an 8-bit variable called hello containing the value 10 would look like this:hello BYTE 10h. This first operand is the variable name, second is the directive and third is the value. Note: the h suffix denotes the value is in hexadecimal form.

Here is a brief table illustrating variable type names and their corresponding values in Assembly:

DirectiveUsed ForBYTE8-bit unsigned integersSBYTE8-bit signed integersWORD16-bit unsigned integersSWORD16-bit signed integersDWORD32-bit unsigned integersSDWORD32-bit signed integersFWORD48-bit integersQWORD64-bit integersTBYTE80-bit integers

When it comes to data transfer instructions the one that immediately comes to mind is the MOV instruction so let’s go through what it does.

MOV instruction copies data from a source to a destination, or in other words, it moves data from one location to another. Note: this instruction cannot be used to directly move data from one memory address to another. You must go through a register in order accomplish this.

The MOVZX instruction is similar is MOV with the addition of zero-extending unused bit values. This means that the a value such as 10h will be 00000010h after data transfer with MOVZX.

The MOVSX instruction is also a very useful instruction in that it can be though of as the opposite of MOVZX. This is because it adds 1’s to any a value that has its highest bit set to greater than 7. For example, F056h would become 1111F056h under data transfer of the MOVSX instruction.

So let’s see the MOV instruction in action! In order to move the variable hello in the EAX register to the EBX register we would run:mov ebx eax. Simple, right?

There are some other data transfer instructions we have not covered in this post such as the LAHF and SAHF, but these require knowledge of status flags, what they are and how they work. Therefore, aforementioned topics will covered in the next post along with other useful Assembly instructions.

Add a comment

Related posts:

Graham Linehan and his Defense of Paedophiles

The Trump Administration gets criticized a lot. There’s no doubt it deserves it. It is a dreadful era in America’s Political History matched and overshadowed only by every single era before it…

A Quick Guide to the Microsoft Power Platform

Increased data and a rapidly changing global economy mean businesses have to act quickly to meet customer expectations. The need to innovate is often reined by budgets and IT resources. Sometimes…

Big Raffle Night to gather founds for Australian fires.

Since September 2019 Australia has been struggling with enormous fires fuelled by never seen before temperatures and many months of severe drought. It was a summer of breathing masks and keeping…