19
Judul Pokok Bahasan 1/total Judul Mata Kuliah Data Movement Instructions

Judul Mata Kuliah Judul Pokok Bahasan 1/total Data Movement Instructions

Embed Size (px)

Citation preview

Page 1: Judul Mata Kuliah Judul Pokok Bahasan 1/total Data Movement Instructions

Judul Pokok Bahasan

1/total

Judul Mata Kuliah

Data Movement Instructions

Page 2: Judul Mata Kuliah Judul Pokok Bahasan 1/total Data Movement Instructions

Judul Pokok Bahasan

2/total

Judul Mata Kuliah

Load-Effective Address• There are several LEA instructions in p

– Table 4.9 lists the LEA instructions• LEA

– The LEA instruction loads a 16- or 32- bit register with the offset address of the data specified by the operand

– E.g., LEA AX,NUMB– Compare: LEA BX,[DI] & MOV BX,[DI]– Understand Example 4.3

Page 3: Judul Mata Kuliah Judul Pokok Bahasan 1/total Data Movement Instructions

Judul Pokok Bahasan

3/total

Judul Mata Kuliah

Load-Effective Address (cont’d)

• LDS, LES, LFS, LGS, LSS– The LDS, LES, LFS, LGS, LSS

instructions load any 16- or 32-bit register with an offset address and load the DS, ES, FS, GS, or SS segment register with a segment address

– Fig. 4.15 illustrates an example LDS, BX,[DI] instruction

• this instruction transfers the 32-bit number, address-ed by DI in the data segment, into the BX and DS registers

• Study Example 4.4

Page 4: Judul Mata Kuliah Judul Pokok Bahasan 1/total Data Movement Instructions

Judul Pokok Bahasan

4/total

Judul Mata Kuliah

String Data Transfers

• There are 5 string data transfer instructions: LODS, STOS, MOVS, INS, and OUTS

• The Direction Flag– The direction flag (D) -located in

the flag register- selects the auto-increment (D=O) or the auto-decrement (D=1) operation for the DI and SI registers during string operations

– The CLD instruction clears the D flag (D=0), and the STD instruction sets it (D=1)

Page 5: Judul Mata Kuliah Judul Pokok Bahasan 1/total Data Movement Instructions

Judul Pokok Bahasan

5/total

Judul Mata Kuliah

String Data Transfers (cont’d)

• DI and SI– The DI offset address accesses

data in the extra segment for all string instructions that use it

– The SI offset address accesses data, by default, in the data segment

• LODS– The LODS instruction loads AL,

AX, or EAX with data stored at the data segment offset address indexed by the SI register (Table 4.10)

Page 6: Judul Mata Kuliah Judul Pokok Bahasan 1/total Data Movement Instructions

Judul Pokok Bahasan

6/total

Judul Mata Kuliah

String Data Transfers (cont’d)

– Fig.4.16 shows the effect of executing the LODSW instruction if the D flag=0, SI=1000H, and DS=1000H

• STOS– The STOS instruction stores AL, AX,

or EAX at the extra segment memory location addressed by the DI register

– Table 4.11 lists all forms of STOS instructions

– The STOSB (stores a byte), STOSW (stores a word) and STOSD (stores a doubleword)

Page 7: Judul Mata Kuliah Judul Pokok Bahasan 1/total Data Movement Instructions

Judul Pokok Bahasan

7/total

Judul Mata Kuliah

String Data Transfers (cont’d)

– In example 4.5 STOSW instruction is used to clear the video text display

• MOVS– MOVS instruction transfers data

(either byte, word or doubleword) from one memory loca-tion to another (Table 4.13)

– MOVS transfers data from the data segment location addressed by SI to the extra segment location addressed by DI

– Example 4.6 lists a short program that uses MOVS

Page 8: Judul Mata Kuliah Judul Pokok Bahasan 1/total Data Movement Instructions

Judul Pokok Bahasan

8/total

Judul Mata Kuliah

String Data Transfers (cont’d)

• INS– The INS (input string) instruction

transfers data from an I/O device into extra segment memory location addressed by the DI register

– The I/O address is contained in the DX register

– See Table 4.14 and Study example 4.7

• OUTS– The OUTS (output string) transfers

data from the data segment location addressed by SI to an I/O device (addressed by DX) -- Table 4.15 & Example 4.8

Page 9: Judul Mata Kuliah Judul Pokok Bahasan 1/total Data Movement Instructions

Judul Pokok Bahasan

9/total

Judul Mata Kuliah

Page 10: Judul Mata Kuliah Judul Pokok Bahasan 1/total Data Movement Instructions

Judul Pokok Bahasan

10/total

Judul Mata Kuliah

Page 11: Judul Mata Kuliah Judul Pokok Bahasan 1/total Data Movement Instructions

Judul Pokok Bahasan

11/total

Judul Mata Kuliah

Page 12: Judul Mata Kuliah Judul Pokok Bahasan 1/total Data Movement Instructions

Judul Pokok Bahasan

12/total

Judul Mata Kuliah

Page 13: Judul Mata Kuliah Judul Pokok Bahasan 1/total Data Movement Instructions

Judul Pokok Bahasan

13/total

Judul Mata Kuliah

Page 14: Judul Mata Kuliah Judul Pokok Bahasan 1/total Data Movement Instructions

Judul Pokok Bahasan

14/total

Judul Mata Kuliah

Page 15: Judul Mata Kuliah Judul Pokok Bahasan 1/total Data Movement Instructions

Judul Pokok Bahasan

15/total

Judul Mata Kuliah

Page 16: Judul Mata Kuliah Judul Pokok Bahasan 1/total Data Movement Instructions

Judul Pokok Bahasan

16/total

Judul Mata Kuliah

Page 17: Judul Mata Kuliah Judul Pokok Bahasan 1/total Data Movement Instructions

Judul Pokok Bahasan

17/total

Judul Mata Kuliah

Page 18: Judul Mata Kuliah Judul Pokok Bahasan 1/total Data Movement Instructions

Judul Pokok Bahasan

18/total

Judul Mata Kuliah

Page 19: Judul Mata Kuliah Judul Pokok Bahasan 1/total Data Movement Instructions

Judul Pokok Bahasan

19/total

Judul Mata Kuliah

Referensi

• Brey, Barry, B., The Intel Microprocessors 8086/8088, 80186/80188, 80286, 80386, 80486, Pentium, and Pentium ProProcessor Architecture, Programming, and Interfacing, Fourth Edition, PHI Inc, USA, 1997. and Five Edition, 2003

• Brey, Barry, B., 8086/8088, 80286, 80386, and 80486 Assembly Language, Programming, Macmillan Publising Company, USA, 1994.

• Leventhal L.A., Introduction to Microprocessor : Software, Hardware, Programming, Phi Inc., 1978.

• Hall D.V., Microprocessor Interfacing : Programming and Hardware, McGraw-Hill, Singapore, 1986.

• Ananta, C., William JB., Frank Fox, Design of High-performance microprocessor circuit, IEEE Press, 2001

• Douglas V. Hall, Microprocessor and Interfacing: Programming and Hardware, McGraw-Hill, edition 2, 1991

• James A., Kenneth CM, Microcomputer Hardware, Software, and Troubleshooting for Engineering and Technology, Prentice Hall, 2000

• http://www.intel.com/• http://www.hardwarebible.com/Microprocessors/

8086.htm