1 / 8

Lab 1

Lab 1. Program structure, comments, define variables. Program Structure. Comments. Anything after a semicolon is a comment. Comment. Defining Variables. Defining variables goes under the .DATA segment. Defining Variables. Name Type Value. Exercise 1.

clove
Télécharger la présentation

Lab 1

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lab 1 Program structure, comments, define variables

  2. Program Structure

  3. Comments • Anything after a semicolon is a comment. Comment

  4. Defining Variables • Defining variables goes under the .DATA segment

  5. Defining Variables • NameType Value

  6. Exercise 1 • Can we use the following names as identifiers in assembly language: • NUM.4 • #LET • _ROUND • QUS%%$ • Def* • No • No • Yes • Yes • No

  7. Exercise 2 • Define a variable in assembly language: • 1. A variable called RED of the type word, uninitialized. • RED DW ? • 2. A byte variable named HexNum of value 73 in Hex. • HexNum DB 73H • 3. An array called Array1 of type byte, contains ‘HELLO’ value, it needs to be in HEX. • ARRAY1 DB 48h,45h,4Ch,4Ch,4Fh • 4. 70 byte elements in an array AA, which they have the same value of 14, it needs to be in binary. • AA DB 70 DUP (00001110b) • 5. A constant RRR has a value of 90. • RRR EQU 90

  8. Exercise 3 • In each of the following definitions, give us the type, name and value, if it is an array give us the number of elements: • 1. NOW DB ‘N’, ‘O’, ‘W’ • Type: Byte name: NOW value: NOW elements: 3 • 2. NUMBER DB 100 DUP(?) • Type: byte name: NUMBER value: uninitialized elements: 100 • 3. LETTERS DQ ‘ABCDEFG’ • Type: Quad word name: LETTERS value: ABCDEFG • 4. ASM DW 10101010B • Type: word name: ASM value: 10101010 • 5. Bin DD12.5 • Type: double word name: Bin value: 12.5 • 6. TIA EQU3 • Type: Constant name:TIA VALUE: 3

More Related