need help on assembly language

Discussion in 'Embedded Systems and Microcontrollers' started by vead, Sep 28, 2013.

  1. vead

    Thread Starter Well-Known Member

    Nov 24, 2011
    I am new in assembly programming. I am confused where to start so before going to design i want to create basic algorithm

    how to make algorithm for 8051 in assembly language?
    how to write statement for input or output port?
    how to write statement for input or output pin?
  2. MrChips


    Oct 2, 2009
    Before you write code in assembler or any computer language for that matter,
    write out your algorithm steps in plain language. This is the difficult but essential part.
    Writing computer code is the easy part.
    Eric007 likes this.
  3. atferrari

    AAC Fanatic!

    Jan 6, 2004

    Look here. Write your own.

    Once there, code should be the easiest part.
  4. absf

    Senior Member

    Dec 29, 2010
    Sounds like you already have the 8051 hardware ready for writing programs..:rolleyes:

    I started learning 8051 using the IDE as recommended by Ian Rogers in the ETO forum. Later I ordered the at89S51 chip and made my own SBC with it. The IDE is very nice to use with lots of goodies inside. Just read the threads here:

    My 8051 thread

    Another thread by 'ikelectro'

  5. vead

    Thread Starter Well-Known Member

    Nov 24, 2011
    thanks for response its grate help for me
    I have MCU 8051 IDE assembler i am confused how to see ram location and rom address in assembler
  6. absf

    Senior Member

    Dec 29, 2010
    The 89S52 has 8K flash memory (as ROM in 8052) from 0x0000 to 0x1FFF and it has only 256 bytes of ram. The ram available for use is from 0x0030 to 0x007F. 0x0000 to 0x001F are 4 banks of R0 to R7 general registers while 0x0020-0x002F are bit addressable RAM in which you can use them to store variables like flags where they can be used with SETB, JB, JNB type instructions.

    There is an additional 128 bytes from 0x0080 to 0x00FF and I normally allocate the stacks here. If additional RAM or ROM is needed. You have to connect external RAM or ROM using ports 0 & 2 for the external address and data lines. The lower 8 but address is multiplexed with the data lines in order to save an 8-bit port.

    If you read my thread, you'll see that the 8051 SBC that I made also has 32K external RAM. The external memory is addressed using "MOVX" instructions.

  7. Arm_n_Legs

    Active Member

    Mar 7, 2007
    If you are totally new to 8051, I would suggest reading the MCS51 Microcontroller Family User's Family. This is a pretty old book but the information is still relevant. The assembly instructions are well explain in the book.
  8. Meixner


    Sep 26, 2011
    Arm & Legs has good advice, When i started using 8051's there was no internet to ask questions. I read that book cover to cover 3 times. I was then able to write 8051 code very easily.