





































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!






































A machine’s own languageA machine’s own language
What is assembly language?What is assembly language?
Essential ToolsEssential Tools (^) Assembler is a program that converts source-code programs into a machine language ( object fil e). Linker joins together two or more object files and produces a single executable file. Debugger loads an executable program, displays the source code, and lets the programmer step through the program one instruction at a time, and display and modify memory. (^) Emulator allows you to load and run assembly language programs, examine and change contents of registers. Example: EMU
Numeric Constants Numeric Constants
-23 (a negative integer, base 10 is default) 1011b (a binary number) 1011 (a decimal number) 0A7Ch (an hexadecimal number) A7Ch (this is the name of a variable, an hexadecimal number must start with a decimal digit )
Character and String Constants Character and String Constants
(^) ‘A’ ‘ABC’ “Hello World!” “123” (this is a string, not a number) (^) “This isn’t a test” ‘Say “hello” to him’
Irvine, Kip R. Assembly Language for x86 Processors 6/e, 2010. (^13) Instructions Instructions
Label (optional) Mnemonic (required) Operand (depends on the instruction) Comment (optional) The general format is: [name] mnemonic [operands] [;comment]
Names Names
a label (^) a variable a symbolic constant (name given to a constant) a keyword (assembler-reserved word).
Names (cont.) Names (cont.) A variable is a symbolic name for a location in memory that was allocated by a data allocation directive. Ex: (^) count db 50 ; allocates 1 byte to variable count A label is a name that appears in the code area. Must be followed by ‘:’
Names (cont.) Names (cont.)
subsequent characters can include digits A programmer chosen name must be different from an assembler reserved word or predefined symbol.
Reserved WordsReserved Words (^) Reserved words have special meaning in Assembler (^) There are different types of reserved words: (^) Instruction mnemonics, such as MOV, ADD, and MUL (^) Register names (^) Directives, which tell MASM how to assemble programs (^) Attributes, which provide size and usage information for variables and operands. Example are BYTE and WORD Operators, used in constant expressions Predefined symbols, such as @data, which return constant integer values at assembly time