SIZ EDUCATION - MACHINE LANGUAGE

in Steem Infinity Zone3 years ago

Machine language is a computer's native way of speaking to itself, as opposed to the various programming languages which must be translated into machine language before they can run on a computer. Machine language instructions consist of exactly what you might expect: machine words. Every instruction consists of an operation code (in assembly language these are called mnemonics ) and the argument , which is typically a number. The operation code determines what operation to perform on the argument, e.g. add, subtract, load memory from register , move data between registers or other computer hardware, branch depending on some condition etc.. There are several different types of instructions. Instructions can have one or two argument words, depending on what the instruction does.

The highest level language used to create programs for a computer is called a " high-level programming language ." Programming languages are translated into machine language by a special program called a compiler. A compiler is much like an interpreter, except that it can't execute source code directly (only machine language). (The term "interpreted" when talking about programming languages sometimes means the same thing as "translated", but when talking about high-level languages, interpreted usually implies that human readable source code is fed into the program line by line and the program itself executes the code.)

Here is an example of a machine language instruction to load data from memory into register A . The number put in memory is 100 decimal (40 hexadecimal), and it's located at address #8000 decimal (2000 hex). This machine language instruction consists of two words, one operation word followed by an argument word. The first 0 is the operation code, telling the computer to load A with data from memory . The second 0 is the argument, authorizing this instruction to read data at address #8000 decimal (2000 hex).

6E 83 88 3F 5A 80 00 EA F8 E8

This could also be written as

0646.0100.80 000 2000

In hexadecimal, "6E" would be written as "0646", so the machine language instruction is really just a pattern of 16 digits: 0x646F8000002000. In binary it's even simpler: 01100110 01100001 00010000 00000000 00000000 (note that some of the bits in this number are turned off, i.e. 0, because I took advantage of a quirk of the structure in that memory location in my machine language program).

That's all from today's post. Hope you have read something interesting!

Sort:  
 3 years ago 

Good post dear friend keep it up dear friend and keep learn with our steem fellows and friends.

Regards, Faran Nabeel

 3 years ago 

Thank you so much

Coin Marketplace

STEEM 0.18
TRX 0.13
JST 0.030
BTC 57951.98
ETH 3051.79
USDT 1.00
SBD 2.26