Upload
liora
View
61
Download
0
Embed Size (px)
DESCRIPTION
Assembly Language – Lab 1. Introduction, Program structure, comments, define variables. Assembly Language. Assembly language makes it possible to write Machine Language code. A program called the Assembler does the translation. Each line of a program is one of the following: - PowerPoint PPT Presentation
Citation preview
1
Assembly Language – Lab 1Introduction, Program structure, comments, define variables
2
Assembly Language• Assembly language makes it possible to write Machine Language
code.• A program called the Assembler does the translation.• Each line of a program is one of the following:
• an instruction• an assembler directive (or pseudo-op)• a comment
• Whitespace (between symbols) and case are ignored.• Comments (beginning with “;”) are also ignored.
3
Program Structure
4
Comments
• Anything after a semicolon is a comment.
Comment
5
Defining Variables
• Defining variables goes under the .DATA segment
6
Defining Variables
Name Type Value
Declaration syntax:
7
Identifiers
• May consist of letters, digits, and the special characters
• ? . @ _ $ % (Thus, embedded blanks are not allowed).
• Names may not begin with a digit.
• If a dot is used, it must be the first character.
8
Questions
• Can we use the following names as identifiers in assembly language:
#ASMadd
*NO
QUS%%$
_USE
PASS 1234%
CS221
Hi_
!Set1ONE
Learn@
Sign&
%Percent
@Data
YES
YES
YES
YES
NONO NO
NO
NO
NO
NO
YES
YES
NO
9
EMU8086How to use the required software
10
EMU8086 – How to use it
11
EMU8086 – Open empty workspace
12
EMU8086 – Press emulate, after coding
13
EMU8086 – Press run to execute the code