Assembly Language For x86 Processors
Assembly Language For x86 Processors
6th Edition
Kip Irvine
(c) Pearson Education, 2010. All rights reserved. You may modify and copy this slide show for your personal use, or
for use in the classroom, as long as this copyright statement, the author's name, and the title are not changed.
Chapter Overview
• Integer constants
• Integer expressions
• Character and string constants
• Reserved words and identifiers
• Directives and instructions
• Labels
• Mnemonics and Operands
• Comments
• Examples
• Examples:
• Code label
• target of jump and loop instructions
• example: L1: (followed by colon)
• Instruction Mnemonics
• examples: MOV, ADD, SUB, MUL, INC, DEC
• Operands
• constant
• constant expression
• register
• memory (data label)
INCLUDE Irvine32.inc
.code
main PROC
mov eax,10000h ; EAX = 10000h
add eax,40000h ; EAX = 50000h
sub eax,20000h ; EAX = 30000h
call DumpRegs ; display registers
exit ;to end the process of
.Code segment
main ENDP
; write user defined functions here
END main
.code
main PROC
mov eax,10000h ; EAX = 10000h
add eax,40000h ; EAX = 50000h
sub eax,20000h ; EAX = 30000h
call DumpRegs
INVOKE ExitProcess,0
main ENDP
END main
; Program Description:
; Author:
; Creation Date:
; Revisions:
; Date: Modified by:
INCLUDE Irvine32.inc
.data
; (insert variables here)
.code
main PROC
; (insert executable instructions here)
exit
main ENDP
; (insert additional procedures here)
END main
• Assemble-Link-Execute Cycle
• Listing File
• Map File
• BYTE, SBYTE
• 8-bit unsigned integer; 8-bit signed integer
• WORD, SWORD
• 16-bit unsigned & signed integer
• DWORD, SDWORD
• 32-bit unsigned & signed integer
• QWORD
• 64-bit integer
• TBYTE
• 80-bit integer
• REAL4
• 4-byte IEEE short real
• REAL8
• 8-byte IEEE long real
• REAL10
• 10-byte IEEE extended real
value1 BYTE 10
• Example:
val1 DWORD 12345678h
PI EQU <3.1416>
pressKey EQU <"Press any key to continue...",0>
.data
prompt BYTE pressKey
.code
setupAL ; generates: "mov al,10"