
Instruction Set
4-131
LDS
Load DS with Segment and Register with Offset LDS
What It Does
LDS copies the segment portion of a full address stored in a doubleword to DS, and copies
the offset portion of the full address to another register.
Syntax
Description
LDS reads a full pointer from memory and stores it in a register pair consisting of the DS
register and a second operand-specified register. The first 16 bits are in DS and the
remaining 16 bits are placed into the register specified by
offset.
Operation It Performs
Flag Settings After Instruction
Examples
This example calls a procedure whose address is stored in a doubleword in memory.
Form
Opcode
Description
Clocks
Am186 Am188
LDS
r16,m16:16
C5
/r
Load DS:r16 with segment:offset from memory
18
26
LDS
offset,pointer
/* copy offset portion of pointer */
offset = pointer;
/* copy segment portion of pointer */
DS =
p 2;
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
Processor Status
Flags Register
reserved
OF DF
IF TF SF ZF
AF
PF
CF
? = undefined; – = unchanged
–
–
–
–
–
– res – res – res –
PROC_ADDR
DD
?
; full address of current procedure
; store address of current procedure in PROC_ADDR
...
LDS
SI,PROC_ADDR ; load segment of procedure into DS
; and offset of procedure into SI
; call procedure at address stored in doubleword in memory
CALL
DWORD PTR [SI]
Summary of Contents for Am186 Series
Page 1: ...Am186 and Am188 Family Instruction Set Manual February 1997...
Page 10: ...Table of Contents x...
Page 18: ...Programming 1 8...
Page 40: ...Instruction Set Listing 3 14...