Lecture 6 COAL
Lecture 6 COAL
Assembly Language
Week 7
Lecture 06: Assembly language fundamentals
Instructor: Engr. Iqra Saleem
Email: [email protected]
UNIVERSITY OF HARIPUR
Integer constants
Mov bl,5
Mov v4,bl
For printing strings:
//V5 db ‘hello$’
Mov dx,offset v5
Mov ah,9
OR
Lea dx,v5 (load effective address)
Symbolic constants
• Symbolic constants are named values that remain constant throughout
the program, making the code more readable and easier to maintain .
• Do not use storage
• No datatype
• Can be defined in .code and .data segment
• count=500
• +,-,/,* operators with constants
Variables
• Variables are used to store data that can be accessed and change during the
program's execution.
• Variables are typically defined in the data segment and can be of various sizes,
such as bytes, words, or double words.
• Use storage
• Equal sign is not used with variables
Equal sign directive “=”
• Assembly
Example 1:
NUM_BYTES EQU 1024
Defines symbolic constant NUM_BYTES with value 1024.
Example 2:
True EQU 1
False EQU 0
Define symbolic constants True and False with values 1 and 0 respectively