Submitted by: Submitted by toddrick123
Views: 213
Words: 2162
Pages: 9
Category: Philosophy and Psychology
Date Submitted: 11/07/2012 06:27 PM
Chapter 3: Assembly Language Fundamentals
I. Objectives
After reading this Chapter, you should be able to understand or do each of the following:
• Know how to represent integer constants, expressions, real number constants, character constants, and string constants in assembly language
• Know how to formulate assembly language instructions, using valid syntax
• Understand the difference between instructions and directives
• Be able to code, assemble, and execute a program that adds and subtracts integers
• Be able to create variables using all standard assembly language data types
• Be able to define symbolic constants
• Be able to calculate the size of arrays at assembly time
II. Lecture Notes
1. Basic Elements of Assembly Language
• Microsoft syntax notation
o Elements within square brackets [ ] are optional
o Elements within { …| …|…} requires a choice of the enclosed elements
o Elements in italics denote items which have known definitions or descriptions
o Example: [{+ | -}] digits [radix]
• Integer constants (integer literal)
o Syntax: [{+ | -}] digits [radix]
o Optional leading + or – sign
o binary, decimal, hexadecimal, or octal digits
o Common radix characters:
▪ h – hexadecimal
▪ d – decimal
▪ b – binary
▪ r – encoded real
o Examples: 30d, 6Ah, 42, 1101b
o Hexadecimal beginning with letter must have leading 0: 0A5h
o If no radix is given, the integer constant is assumed to be decimal
• Integer expressions
o A mathematical expression involving integer value and arithmetic operators
o Operators and precedence levels:
[pic]
o Examples:
12 – 1 MOD 5, -3 + 4 *6 - 1
• Real Number Constants
o Syntax: [sign] integer.[integer][exponent]
sign {+ | -}...