Micro 133 Prelim Lecture 4 - Microprocessor - S Addressing Modes
Micro 133 Prelim Lecture 4 - Microprocessor - S Addressing Modes
Micro 133 Prelim Lecture 4 - Microprocessor - S Addressing Modes
ADDRESSING MODES
Micro 133: Microprocessor Systems
Prelim Lecture 4
by: Engr. Ricrey E. Marquez, CpE, MSCS
INTRODUCTION TO ADDRESSING
MODES
MICROPROCESSORS ADDRESSING MODES
Addressing Modes
INTRODUCTION TO ADDRESSING
MODES
MICROPROCESSORS ADDRESSING MODES
C = A + B
MOV
MOV
ADD
MOV
Choice of addressing mode used depends upon the type of data being
accessed.
A constant,
A variable piece of information or
An item within an array of data.
Lines
of code
Label: Instruction
Instruction
Opcode
Mnemonic
;Comment/s
Operands
These
data.
TYPES OF PS ADDRESSING
MODES
MICROPROCESSORS ADDRESSING MODES
Note: EQU directive assigns names to constant numbers and does not save memory space
JMP LOOPHERE
CON1 EQU
0ABCDH
MOV AX,CON1
VAR1 DW
0ABCDH
MOV AX,VAR1
MOV VAR1,BX
VAR1 DW ?
VAR2 DB 0FFH
MOV VAR1,1234H ;MOVE NUMBER 1234H TO
;VARIABLE VAR1
MOV [VAR1],AX
MOV VAR1+1,1234H
MOV WORD PTR [VAR1+1],1234H
MOV BYTE PTR [VAR1],12H
MOV VAR2,1234H
MOV AH,VAR2
VAR1 DD
12345678H
VAR2 DD
9ABCDEF0H
SUM DD
Base-plus-Index
(Complex Array)
Addressing
Transfer
Mode
MOV [BX+SI],AX
MOV DX,[BX+DI]
Register
Relative Addressing
Mode (Complex Array)
Move
Base-Relative-plus-Index
Addressing
Mode (More Complex Array)
Transfer
CALLING SUBROUTINES
MICROPROCESSORS ADDRESSING MODES
executed it pushes IP and the return segment (for FAR calls) onto the stack, then
executes a jump to the call address
When
to a NEAR address Only Offset (IP) specified, segment assumed to be the same
CALL to a FAR address New Segment and Offset (IP) specified
(RETurn) instruction causes the CPU to pop the RETURN address off the stack (IP
or Segment and IP) and execute a jump back to it
CALL 0200
CALL 1029:0200