13
Assembly Language – Lab 1 Introduction, Program structure, comments, define variables 1

Assembly Language – Lab 1

  • 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

Page 1: Assembly Language  –  Lab  1

1

Assembly Language – Lab 1Introduction, Program structure, comments, define variables

Page 2: Assembly Language  –  Lab  1

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.

Page 3: Assembly Language  –  Lab  1

3

Program Structure

Page 4: Assembly Language  –  Lab  1

4

Comments

• Anything after a semicolon is a comment.

Comment

Page 5: Assembly Language  –  Lab  1

5

Defining Variables

• Defining variables goes under the .DATA segment

Page 6: Assembly Language  –  Lab  1

6

Defining Variables

Name Type Value

Declaration syntax:

Page 7: Assembly Language  –  Lab  1

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.

Page 8: Assembly Language  –  Lab  1

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

Page 9: Assembly Language  –  Lab  1

9

EMU8086How to use the required software

Page 10: Assembly Language  –  Lab  1

10

EMU8086 – How to use it

Page 11: Assembly Language  –  Lab  1

11

EMU8086 – Open empty workspace

Page 12: Assembly Language  –  Lab  1

12

EMU8086 – Press emulate, after coding

Page 13: Assembly Language  –  Lab  1

13

EMU8086 – Press run to execute the code