1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

assembly language

Discussion in '8051/8951' started by Parth86, Aug 22, 2014.

  1. Parth86

    Parth86 Member

    Joined:
    Dec 25, 2011
    Messages:
    513
    Likes:
    5
    suppose we want to add two 8 bit number
    we have to implement 8 bit adder

    example 6+ 2 =8
    00000110
    +00000010
    ------------
    00001000

    suppose we have binary sequence
    Mov (1000)
    Add (0100)
    6(00000110)
    2(00000010)
    8(00001000)

    machine language
    1000 0110
    1000 0010
    0100 0110 0010

    assembly language
    mov A, #6
    mov R1,#2
    add A,R1

    I know assembly code convert into machine code but for low level understanding how we developed assembly language to understand machine language
     
  2. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,160
    Likes:
    909
    Location:
    Rochdale UK
    ONLINE
    Assembly is the simplest symbolic languge there is....It's virtually impossile to work in binary so grouping the binary into a nmemonic helps remember the code....
     
  3. Parth86

    Parth86 Member

    Joined:
    Dec 25, 2011
    Messages:
    513
    Likes:
    5
    how we access memory and which instruction we use that determine weather we are accessing Internal rom , Internal Ram ?

    how to access rom

    example
    Mov R0, #55H ; load R0 with 55H
    Mov R1, #85H ; load R1 with 85H


    how to access ram memory
    Mov 00, #55H ; ram location 00 has 55H data
    Mov 01 , #85H : ram location 01 has 85H data
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. Ian Rogers

    Ian Rogers Super Moderator Most Helpful Member

    Joined:
    Mar 28, 2011
    Messages:
    9,160
    Likes:
    909
    Location:
    Rochdale UK
    ONLINE

    Code (asm):

    example
    Mov R0, #55H ; load R0 with 55H
    Mov R1, #85H ; load R1 with 85H

    how to access ram memory
    Mov 00, #55H ; ram location 00 has 55H data
    Mov 01 , #85H ; ram location 01 has 85H data
     
    These two examples are the same... R0 and R1 are in position 0 and 1 in internal ram..

    Movc is for rom and movx is for external ram...
     

Share This Page