tailieunhanh - Lecture Computer organization and assembly language: Chapter 9 - Dr. Safdar Hussain Bouk

Lecture 09 - Data Transfer, Add & SUB (Flags). In this chapter, the following content will be discussed: Stack data structure, interrupt I/O (again!), arithmetic using a stack. | CSC 221 Computer Organization and Assembly Language Lecture 09: Data Transfer, Add & SUB (Flags) Lecture 08: Review Basic Elements of Assembly Language Integer constants Integer expressions Character and string constants Reserved words and identifiers Directives and instructions Labels Mnemonics and Operands Comments Lecture 08: Review Microsoft Visual C++ Configuration for Assembly Programming Example: Adding and Subtracting Integers Lecture 08: Review (cont.) .386 INCLUDE INCLUDE INCLUDELIB INCLUDE XXXXXX .data ; (insert variables here) .code XXXYYY: ; (insert executable instructions here) invoke ExitProcess, NULL END XXXYYY Lecture Outline Data Transfer Instructions Operand Types Instruction Operand Notation Direct Memory Operands MOV Instruction Zero & Sign Extension XCHG Instruction Direct-Offset Instructions Addition and Subtraction Which Flags are affected? Data Transfer Instructions Operand Types Instruction Operand Notation Direct Memory Operands MOV Instruction Zero & Sign Extension XCHG Instruction Direct-Offset Instructions Operand Types Three basic types of operands: Immediate – a constant integer (8, 16, or 32 bits) value is encoded within the instruction Register – the name of a register register name is converted to a number and encoded within the instruction Memory – reference to a location in memory memory address is encoded within the instruction, or a register holds the address of a memory location Instruction Operand Notation Direct Memory Operands A direct memory operand is a named reference to storage in memory The named reference (label) is automatically dereferenced by the assembler .data var1 BYTE 10h .code mov al,var1 ; AL = 10h mov al,[var1] ; AL = 10h alternate format MOV Instruction .data count BYTE 100 wVal WORD 2 .code mov bl,count mov ax,wVal mov count,al mov al,wVal ; error mov ax,count ; error mov eax,count ; error Move from source to destination. Syntax: MOV destination,source No more than . | CSC 221 Computer Organization and Assembly Language Lecture 09: Data Transfer, Add & SUB (Flags) Lecture 08: Review Basic Elements of Assembly Language Integer constants Integer expressions Character and string constants Reserved words and identifiers Directives and instructions Labels Mnemonics and Operands Comments Lecture 08: Review Microsoft Visual C++ Configuration for Assembly Programming Example: Adding and Subtracting Integers Lecture 08: Review (cont.) .386 INCLUDE INCLUDE INCLUDELIB INCLUDE XXXXXX .data ; (insert variables here) .code XXXYYY: ; (insert executable instructions here) invoke ExitProcess, NULL END XXXYYY Lecture Outline Data Transfer Instructions Operand Types Instruction Operand Notation Direct Memory Operands MOV Instruction Zero & Sign Extension XCHG Instruction Direct-Offset Instructions Addition and Subtraction Which Flags are affected? Data Transfer Instructions Operand Types Instruction Operand Notation Direct Memory

TÀI LIỆU LIÊN QUAN