1 / 13

Introduction to Computer Organization and Assembly Language

Introduction to Computer Organization and Assembly Language . Sheet 1. Program Comment . A semicolon marks the beginning of this field, and the assembler ignores anything typed after the semicolon . Example: MOV CX, 0 ; CX counts terms, initially 0. Identifiers.

onan
Download Presentation

Introduction to Computer Organization and Assembly Language

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. Introduction to Computer Organization and Assembly Language Sheet 1

  2. Program Comment • A semicolon marks the beginning of this field, and the assembler ignores anything typed after the semicolon. • Example: • MOV CX, 0 ; CX counts terms, initially 0

  3. Identifiers • Can be from 1 to 31 characters long (not case sensitive). • 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.

  4. Defining Types of data • Syntax: • name Dninitial_value

  5. Defining Types of data Cont. • Dn (Directive):

  6. Question1 Q1: Tell whether each of the following identifiers is Valid or Invalid.

  7. Question2 Q2: Give data definition pseudo-ops to define each of the following: a) A word variable X initialized to 41. X DW 41

  8. Question2 Cont. Q2: Give data definition pseudo-ops to define each of the following: b) A word variable WORD1, uninitialized. WORD1DW ?

  9. Question2 Cont. Q2: Give data definition pseudo-ops to define each of the following: c) A byte variable Y initialized to 32h. Y DB 32H

  10. Question2 Cont. Q2: Give data definition pseudo-ops to define each of the following: d) A byte variable ITEM containing the hex equivalent to decimal 71. ITEM DB 47H

  11. Question2 Cont. Q2: Give data definition pseudo-ops to define each of the following: e) A word array ARRAY1, initialized to the first 5 positive integers (i.e. 1-5). ARRAY1 DW 1,2,3,4,5

  12. Question2 Cont. Q2: Give data definition pseudo-ops to define each of the following: f) A 30 bytes array ARR, with each entry initialized to 10H. ARR DB 30 DUP (10H)

  13. Question2 Cont. Q2: Give data definition pseudo-ops to define each of the following: g) A constant LENGTH with value 20, another constant WIDTH with value 10, and constant AREA using LENGTH and WIDTH that you just defined (Note: area = length * width). LENGTH EQU 20 WIDTH  EQU 10 AREA   EQU length * width

More Related