150 likes | 235 Views
Data can be moved among all registers but data cannot be moved directly into the segment registers (CS,DS,ES,SS) To load as such, first load a value into a non-segment register and then move it to the segment register MOV AX,2345h MOV DS,AX. Based Indexed addressing mode.
E N D
Data can be moved among all registers but data cannot be moved directly into the segment registers (CS,DS,ES,SS) To load as such, first load a value into a non-segment register and then move it to the segment register MOV AX,2345h MOV DS,AX
Based Indexed addressing mode MOV AH, [BX] [SI] + 1234H 01000 8A 01000 8A μP μP IP 0000 IP 0004 A0 A0 01001 01001 01002 34 01002 34 CS 0100 CS 0100 01003 12 01003 12 0200 0200 DS DS 06234 06234 BE BE SI 2000 SI 2000 AX BEXX XXXX AX BX 1000 BX 1000
MOV AH, [BX] [SI] + 1234H Register / memory to/ from register 100010dw Displ-hi Mod reg r/m Displ-lo Assembly code 10001010 10 100 000 0011 0100 0001 0010 Machine code 8 A A 0 3 4 1 2
String Addressing Mode MOVS string operand (assembly only) move string [ES:DI] ← [DS:SI] [SI] ← [SI] ± 1 or 2 [DI] ← [DI] ± 1 or 2 ± according to [DF] 1 or 2 according to the operand MOVSB move string byte [ES:DI] ← [DS:SI] [SI] ← [SI] ± 1 [DI] ← [DI] ± 1 MOVSW Move string word the execution of MOVS, MOVSB, MOVSW [ES:DI] ← [DS:SI] does not affect any flag [ES:DI+1] ← [DS:SI+1] [SI] ← [SI] ± 2 [DI] ← [DI] ± 2
Instructions affecting the direction flag CLD Clear direction flag [DF] ← 0 effect: auto-incrementation of [SI] and [DI] STD Set direction flag [DF] ← 1 effect: auto-decrementation of [SI] and [DI]
Port addressing mode Used in conjunction with IN and OUT instructions 2 types of I/O instructions Direct or long form Indirect or short form IN Acc, DX OUT DX, Acc IN Acc, Port address OUT Port address, Acc Acc = AL or AX 1 byte is provided as the address of the I/O port in the instruction 16 bit address in [DX] as the address of the I/O port MOV DX, 0A00H IN AL,DX IN AL,0FEH The contents of the byte-wide I/O port @ address FEH of page 0 of the I/O address space AL The contents of the byte-wide input port @A000H of the I/O address space AL
IN Input from fixed port 1 1 1 0 1 0 0 W Data 8 8 bit address from page 0 of the I/O address space DIRECT ADDRESSING IN Input from variable port 1 1 1 0 No direct address is provided 1 0 1 W 16 bit address provided by [DX] from the I/O address space INDIRECT ADDRESSING
OUT Output to fixed port 1 1 1 1 1 0 0 W Data 8 8 bit address from page 0 of the I/O address space DIRECT ADDRESSING OUT Output to variable port 1 1 1 1 No direct address is provided 1 0 1 W 16 bit address provided by [DX] from the I/O address space INDIRECT ADDRESSING
2nd byte 1st byte 1 0 w 1 1 1 0 present only in long form 0 long form 1 short form Address range for the long form: 00 to FF Address form for the short form: 0000 to FFFF Assembly language format for IN instruction W=0 byte transfer W=1 word transfer
2nd byte 1st byte 1 1 w 1 1 1 0 present only in long form 0 long form 1 short form Address range for the long form: 00 to FF Address form for the short form: 0000 to FFFF Assembly language format for OUT instruction W=0 byte transfer W=1 word transfer
Microprocessor - Microcontroller 8088 16
6-byte queue • 8088 4-byte queue