Assembly Language Programming - PowerPoint PPT Presentation

1 / 8
About This Presentation
Title:

Assembly Language Programming

Description:

... to make programs easier ... to set the start address of the program, but can also set the ... In this example, the END directive also specifies that the ... – PowerPoint PPT presentation

Number of Views:55
Avg rating:3.0/5.0
Slides: 9
Provided by: xavi61
Category:

less

Transcript and Presenter's Notes

Title: Assembly Language Programming


1
Assembly Language Programming
  • By Maria Ramila I. Jimenez
  • Faculty ICS33

2
Assembler Directives
  • Assembler directives are instructions to the
    assembler, and are not translated into machine
    instructions. The use of directives gives the
    programmer some control over the operation of the
    assembler, increasing flexibility in the way
    programs are written. The following is a list of
    the common pseudo-ops.

3
Assembler Directives
  • EQUATEis used to make programs easier to write.
    The EQU directive creates absolute symbols and
    aliases by assigning an expression or value to
    the declared variable name. Its format is,
  • name EQU expression
  • Consider the following statement.
  • NUMBER1 EQU 36H
  • The assembler will replace every occurrence of
    the label NUMBER1 with the value its been equated
    to, ie, 36 hexadecimal.

4
Assembler Directives
The statement LDAA NUMBER1 will be interpreted
by the assembler as LDAA 36H An absolute symbol
represents a 16bit value an alias is a name that
represents another symbol. The declared name must
be unique, one that has not been previously
declared. The redefining of a previous symbol is
normally not allowed. NUM1 EQU 20H... ...NUM1
EQU 30H error
5
Assembler Directives
  • ORIGINThis specifies the address to be used for
    the generation of code. Subsequent instructions
    and data address's begin at the new value.
    Normally, it is used to set the start address of
    the program, but can also set the location
    counter to the value specified.
  • ORG 120HLDAA FFH

6
Assembler Directives
  • ORIGINThe statement LDAA FFH begins at byte
    120h.
  • ORG 2start LDAA 34H
  • The instruction associated with the label start
    is declared to start at the address 2bytes beyond
    the current value of the location counter
    (specified by ).

7
Assembler Directives
  • END and Optional Start AddressThe END directive
    specifies the end of the assembly language source
    listing. It may be followed by an optional entry
    address. The optional entry address is used by
    LOADERS to initialize the Program Counter before
    running the program. If no entry address is
    specified, execution will start at the first
    location allocated by the assembler.
  • END

8
Assembler Directives
  • In this example, the END directive informs the
    assembler that there is no more source
    statements.
  • ORG 0100Hstart LDAA 3FHJMP startEND start
  • In this example, the END directive also specifies
    that the entry point to the program is the label
    start, whose address is 0100H.
Write a Comment
User Comments (0)
About PowerShow.com