Assembly: The Language Programming of Machines

viewgreenStarred Page By viewgreen, 7th Feb 2015 | Follow this author | RSS Feed | Short URL http://nut.bz/1r6-z2gm/
Posted in Wikinut>Guides>Technology>Computer Software

The second-generation programming language is assembly language. Assembly language is a low-level computer programming language. Assembly language is a notation for machine language that can be read by humans and vary depending on computer architecture used.

What is Assembly Language

A programming language that is once removed from a computer's machine language. Machine languages consist entirely of numbers and are almost impossible for humans to read and write. Assembly languages have the same structure and set of commands as machine languages, but they enable a programmer to use names instead of numbers. Each type of CPU has its own machine language and assembly language, so an assembly language program written for one type of CPU won't run on another. In the early days of programming, all programs were written in assembly language. Now, most programs are written in a high-level language such as FORTRAN or C. Programmers still use assembly language when speed is essential or when they need to perform an operation that isn't possible in a high-level language.
In contrast to high-level programming language, assembly language or assembly usually has a 1-1 relationship with machine language instructions. For example, each title (mnemonic) written in assembly language program will be translated into exactly one operation code that can be understood directly by the computer. At a high-level language, a command can be translated into a number of operations in machine language code. The process of converting assembly language into machine language is done by the assembler, and the process is carried out by a disassembler it back.
Intermediate-level programming language which is higher (is easier to use but runs slower) than machine language and lower (is more difficult to use but runs faster) than a high-level language such as Basic, FORTRAN, or Java. Programs written in assembly language are converted into machine language by specialized programs called assemblers or compilers for their execution by the machine (computer).

Assembly Language & The Application Software

  1. The Assembly Language MCS-51
  2. The each of computer architecture has a language different machine so that the language was different assemblies (DNA). Assembly language programming AT89S51 Assembly language is a low-level programming language. In computer programming languages there are two types of levels, the first type is a high-level programming language (high level language) and the second type is a low-level programming language (low level language).
    High-level programming language oriented to humans is to have the statements in the program easily written and understood by humans. While low-level language is more oriented to the machine, is to have a computer can directly interpret the claims program.

    a) Excess Assembly Language:

    • When compiled smaller size
    • More efficient / saving memory
    • Faster executed


    b) Assembly language difficulties:

    • In doing a job, the program line is relatively longer than the high-level language
    • Relatively more difficult to understand, especially if the number of lines have been too much
    • It is more difficult to perform complex jobs such as mathematical operations.

  3. The Application Software
  4. All of the files that comprise an application, including the resource, security management, version, sharing and deployment information. An assembly may appear as a single DLL or EXE file, or as multiple files, and is roughly the equivalent of a COM module.
    An application is a program, or group of programs, that is designed for the end user. Application software can be divided into two general classes: systems software and applications software. Applications software (also called end-user programs) include such things as database programs, word processors, Web browsers and spreadsheets. Figuratively speaking, applications software sits on top of systems software because it is unable to run without the operating system and system utilities.

The Two Types of Assembly Program

In assembly language programs there are two types that we wrote in the program are:

  1. Assembly Directive (ie the code into the direction of the assembler / compiler to organize the program)
  2. Instruction (ie; code that must be executed by the micro-controller CPU)

Use the software to help program the micro-controller MCS-51 is already widely available. To simplify this software can be selected which is an "Integrated Development Environment" (IDE) is software that is editor and compiler. Even there the same time debugger and simulator. One of them is used to training in PRASIMAX is Read51. Here following the List of Assembly Directive (Assembly Directive Description):

    EQU Defining constants
    Defining DB data unit size of 1 byte
    DW Defining data unit size 1 word
    Defining DBIT data unit size 1 bit
    Booking DS storage of data in RAM
    Initialization ORG program start address
    END Bookmarks end of the program
    CSEG marker placement in the code segment
    XSEG marker placement in external data segment
    DSEG Bookmarks internal direct placement in the data segment
    ISEG internal indirect marker placement in the data segment
    BSEG marker placement in bits of data segment
    CODE Bookmarks begin defining program
    Defining xdata external data
    DATA direct internal Defining Data
    IData internal indirect Defining Data
    Defining BIT data bits
    #INCLUDE Involve other program files
    Instruction List
    Instructions Remarks Abbreviations
    Call Absolute ACALL
    ADD Add
    ADDC Add with Carry
    Jump Absolute AJMP
    ANL AND Logic
    CJNE Compare and Jump if Not Equal
    CLR Clear
    CPL Complement
    Decimal Adjust DA
    DEC Decrement
    DIV Divide
    DJNZ Decrement and Jump if Not Zero
    INC Increment
    JB Jump if Bit Set
    JBC Jump if Bit Set and Clear Bit
    JC Jump if Carry Set
    JMP Jump to Address
    JNB Jump if Not Bit Set
    Jump if Carry JNC Not Set
    JNZ Jump if Not Zero Accumulator
    JZ Jump if Accumulator Zero
    LCALL Long Call
    LJMP Long Jump
    MOV Move from Memory
    MOVC Move from Code Memory
    MOVX Move from Extended Memory
    MUL Multiply
    NOP No Operation
    ORL OR Logic
    POP Pop Value From Stack
    PUSH Push Value Onto the Stack
    RET Return From subroutine
    RETI Return From Interrupt
    RL Rotate Left
    RLC Rotate Left through Carry
    RR Rotate Right
    PRC Rotate Right through Carry
    Setb Bit Set
    SJMP Short Jump
    SubB Subtract With Borrow
    SWAP Swap Nibbles
    XCH Exchange Bytes
    XCHD Exchange Digits
    XRL Exclusive OR Logic

The Source of Assembly Program

Program-source assembly (assembly source program) is a collection of command lines written by the editor-text (text editor) is simple, for example EDIT.COM program in DOS, or Windows Notepad program or Mide-51. The set of line-command usually saved into a file with the extension *.ASM name and so forth, depending on the assembler program that will be used to process the program-source assembly.
The each line-command is a command that is intact, meaning that a command may not be broken up into more than one line. One could command line consists of four parts, the first part is recognized as a label or often also referred to as a symbol, the second part is recognized as an operation code, operand and the third part is the last part is the comments. Between these parts separated by a space or tabulator.

  1. Part label
  2. Labels are used to give a name to a command-line, in order to easily editing it in the writing program. Labels can be written anything as long as it begins with the letter, usually no longer than 16 characters. Subsequent letters may be a number or a period and an underscore. If a command-line does not have a label section, this section shall not be written but space or tabulator as a separator between the label and the next part is absolutely still to be written.
    In a program source there can be a lot of labels, but there should be no label twins.
    Often a command-line only consists of the label alone, the line so it can not be said to be a real command-line, but just give the name on the line in question.
    Part labels are often referred to as part of the symbol, this is the case if the label is not used to mark the program, but rather is used to mark the data.

  3. Operation code section
  4. Operation code (operation code or often abbreviated as op-code) is part of the command that should be done. In this case there are two kinds of operation codes, the first is the code-operating to regulate the work of the microprocessor / micro-controller. The second type is used to set the assembler program of work, often referred to as assembler directive. Code-written operation in mnemonic form, namely form abbreviations that are relatively easy to remember, for example, is MOV, ACALL, RET, and so forth. Code-operation is determined by the manufacturer of microprocessor / micro-controller, thus each processor has a different code-operation.
    Code-shaped mnemonic operation is not known microprocessor / micro-controller, so that programs written with the mnemonic code can be used to control the processor, such a program is translated into a program that is formed from code-operation-binary code, which is recognized by the microprocessor / micro-controller. Translation task is performed by a program called Assembler Program. Beyond the code-specified manufacturer's operating microprocessor / micro-controller, there is also a code-operating to regulate the work of the assembler program, for example, be used to determine the location of the program in memory (ORG), is used to form the variable (DS), forming table and constant data (DB, DW) and so forth.

  5. The Operand part
  6. Operand is a complementary part of the operation code, but not all operations require operand code, thus can happen a command line consisting only of the operation code without operand. Instead there is also an operation code that needs more than one operand, in this case between the operand to one another, separated by commas.
    Operand is very varied shapes, can be used codes to declare registers in the processor, could be a number-memory (memory address) that is expressed by the number or the name of the label, can be data that is prepared in-operation-right. Everything is tailored to the needs of code-operation. To distinguish the operand in the form of numbers or memory operand is data that is prepared in operation, used special signs or different ways of writing.
    In addition, the operand can be a simple mathematical equation or Boolean equations, in this sort of thing Assembler program will calculate the value of the equations in the operand, then change the calculation results to binary code understood by the processor. So the calculation in the operand done by an assembler program not by the processor!

  7. Comment Part
  8. The comments section is the author of the program notes, this section although not absolutely necessary but it helps the problem of documentation. Read the comments on any command-line, can easily understand the purpose concerned line, it is very helpful people who read the program.
    Separator comments section with the previous section is a space or tabulator, though the first letter of comment frequently in the form of a semicolon, a special separator for comment.
    For documentation purposes intensive, often a line that is a comment course, in this case the first letter of the line in question is a semi-colon. AT89S51 has a very complete set of instructions. MOV instruction for bytes are grouped according to the addressing mode (addressing modes). Explain how the operand addressing modes operated. Here's an explanation of the various addressing modes. Common form of assembly programs are as follows:

      Labels / Symbols
      opcode
      operands
      comment
      org 0H
      Start:

      left:
      delay:
      Del1:
      del2:

      mov
      mov
      mov
      Call
      RL
      DEC
      CJNE
      SJMP
      mov
      mov
      DJNZ
      DJNZ
      diamond
      end

      A, # 11111110b
      R0, # 7
      P0, A
      delay
      A
      R0
      R0, # 0, Left

      start
      R1, # 255
      R2, # 255
      R2, del2
      R1, del1

      ; Fill accumulators
      ; Contents of R0 to 7
      ; Copy A to P0
      ; Call Delay


      Memory content is hexadecimal known by our micro-controller, which is a representation of an assembly language that we have made. Mnemonic or op-code is the code that will take action against the operand. Operand is the data that is processed by the op-code. An op-code may require 1, 2 or more operands, sometimes also do not need operands. While we can give comments by using a semicolon (;). Here's an example of the number of operands that is different in an assembly.

      CJNE R5, # 22h, action; it takes 3 operand
      MOVXDPTR, A; it takes 2 pieces of operand
      RL A; 1 operand
      NOP; does not require an operand

The program that has been completed we make can be saved with the extension.asm. Then we can create an object with the extension program by using compiler Mide HEX-51, which is described above.

The Assembly Listing

Program-source assembly above, after you have finished writing submitted to the Assembler program to be translated. Each processor has its own assembler program, even one kind of processor can have some sort of manufactured Assembler programs of different software.
The main result of processing Assembler program is a program-object. Program-This object can be a separate file, containing the code that is ready to be sent to a memory-program microprocessor / micro-controller, but there is also a program-object inserted in the program-source assembly as shown in Listing Assembly below.
A program-source Assembly original works of the author of the program, as translated by the assembler program code that is generated along with the numbers of memory storage area code is the same, inserted on the left side of each line command, so that the form of the program is not longer be regarded as a program-source assembly but said as assembly Listing.
To read the Assembly Listing could provide a clearer picture for the program written, for beginners Assembly Listing gives a deeper understanding of the contents of program memory, so it can be imagined how the work of a program. Following an example of the Source Code Line Addresses:

  • : Org 0H
  • : 0000 74 FE Start: MOV A, # 11111110b
  • : 0002 78 07 MOV R0, # 7
  • : 0004 F5 80 Left: MOV P0, A
  • : 0006 12 00 1C Call Delay
  • : 0009 23 RL
  • : 000A 18 DEC R0
  • : 00 F6 CJNE B8 000B R0, # 0, Left
  • : 000E 78 07 MOV R0, # 7
  • : 0010 F5 80 Right: MOV P0, A
  • : 0012 12 00 1C Call Delay
  • : 0015 03 RR A
  • : 18 DEC 0016 R0
  • : 0017 B8 00 F6 CJNE R0, # 0, Right
  • : 001A 80 E4 SJMP Start
  • :;
  • : 001C 79 FF Delay: MOV R1, # 255
  • : 001E 7A FF Del1: mov R2, # 255
  • : 0020 DA FE del2: DJNZ R2, del2
  • : 0022 D9 FA DJNZ R1, del1
  • : 0024 22 ret
  • : end

Following is a Video lectures on "Microprocessors and Micro-controllers" by
Professor Ajit Pal, Dept of Computer Science & Engg., IIT KGP. Please enjoy the video here:

And for more information to learn Assembly Language through Tutorial videos can be found here!.

Conclusions & The Data Credits

An assembly language is a low-level programming language for a computer, or other programmable device, in which there is a very strong (generally one-to-one) correspondence between the language and the architecture's machine code instructions. Each assembly language is specific to a particular computer architecture, in contrast to most high-level programming languages, which are generally portable across multiple architectures, but require interpreting or compiling. Some of the more well-known assembly languages are x86 Assembly Languages.
Physically, the work of a micro-controller can be described as a cycle of reading instructions stored in memory. The micro-controller determines the address of the program memory to be read, and the process of reading the data in memory. The data is read interpreted as instructions. Instruction address in the register kept by the micro-controller, which is known as the program counter.
These instructions eg; arithmetic program involving two registers. The ingredients present in the assembly program was minimal, unlike in the top-level programming language (high-level programming language) everything is ready. Writer assembly program must determine everything; determine the location of a program written in-program memory, making constant data and table constant in-memory program, create a variable that is used in the working-memory data and so forth.
Finally, the Assembly language is a low-level programming language for a computer or other programmable device specific to particular computer architecture in contrast to most high-level programming languages, which are generally portable across multiple systems. Assembly language is converted into executable machine code by a utility program referred to as an assembler like NASM, MASM, etc.

    section .text
    global _start ;must be declared for linker (ld)
    _start: ;tells linker entry point
    mov edx,len ;message length
    mov ecx,msg ;message to write
    mov ebx,1 ;file descriptor (stdout)
    mov eax,4 ;system call number (sys_write)
    int 0x80 ;call kernel

    mov eax,1 ;system call number (sys_exit)
    int 0x80 ;call kernel

    section .data
    msg db 'Hello, world!', 0xa ;our dear string
    len equ $ - msg ;length of our dear string

For most of the examples given in this tutorial, you will find Try it option, so just make use of it and enjoy your learning here!.

Thank you very much for the stopping by to read this page.:)

~ "Assembly Programme Language" - ©2015| viewgreen for the Wikinut - Unique Contents.

References*:

All Images are taking from^:

Become a WIKINUT - it's free to JOIN Here!!!
WRITE, SHARE & EARN!!!

Tags

Assembly Language, Computer Guide, Computer Tips, Computers Software, Computing Devices, Fortran, Java, Java Application Developer, Java Application Development, Java Programming, Java Script, Java Web Development, Javascript, Micro-Controller, Processors, Programmers, Programming In C, Programming Software, Programs Information

Meet the author

author avatar viewgreen
A CS engineer who loves to write about TI (Innovations), Socials, Cultures & Heritage (Local Wisdom), Humors and others that I am eager and interested to. Thank you! :D

Share this page

moderator Steve Kinsman moderated this page.
If you have any complaints about this content, please let us know

Comments

author avatar Carol Roach
7th Feb 2015 (#)

wow a lot of info here, now if only I could understand most of it

Reply to this comment

author avatar viewgreen
7th Feb 2015 (#)

Dear sir, Thank you very much for the approval this page. Have great days to you. :) cc: ~ (Steve Kinsman).


===============================

Sure, that's Machine language and every times when we are using our mobile phone, iPad, iPhone, Laptop and other devices are basically producing from this programming language and all of us still do not know about. Thank you very much to have a great comment from you madam. :)

Reply to this comment

author avatar Shamarie
8th Feb 2015 (#)

Thanks for sharing another great article on technology, Viewgreen! I learn something new from you every time. Congrats on the star page!!!

Reply to this comment

author avatar viewgreen
8th Feb 2015 (#)

Thank you very much for your stopping here to read this page. Absolutely, I also learning something new from you and all of awesome person here in Wikinut. I appreciate it my friend Shamarie. :)

Reply to this comment

author avatar Utah Jay
8th Feb 2015 (#)

Man..I have alI I can handle with wikinut...You are a genious

Reply to this comment

author avatar viewgreen
8th Feb 2015 (#)

Of course, everyone is genius, probably because of hobbies and areas of interest in each of us are different. It's amazingly I'm also pleasure to interact with those geniuses like you and all the great people here in Wikinut. I really appreciate with your incredible comments above. Thank you sir and have great days. :)

Reply to this comment

author avatar M G Singh
8th Feb 2015 (#)

Great post and info on programming

Reply to this comment

author avatar viewgreen
8th Feb 2015 (#)

Thank you very much for stopping by to read this page sir. :)

Reply to this comment

author avatar Gclick
12th Feb 2015 (#)

Well done and great job my friend. Congrat on the star page. thanks.

Reply to this comment

Add a comment
Username
Can't login?
Password