Instruction Set
4-232
STD
STD
Examples
This example fills a workspace in memory with multiple copies of a string of ASCII characters
(a pattern) in the same segment. The characters are copied, one by one, from last to first.
; defined in SEG_T segment
WORKSPACE
DB
100h DUP (?)
; the following code requires FILLER to be
; reserved immediately following WORKSPACE
FILLER
DB
”Am186EM-”
; notify assembler: DS and ES specify the
; same segment of memory
ASSUME DS:SEG_T, ES:SEG_T
; set up segment registers with same segment
MOV
AX,SEG_T
; load segment into DS and ES
MOV
DS,AX
; DS points to SEG_T
MOV
ES,AX
; ES points to SEG_T
; fill workspace with pattern
; load source offset (segment = DS)
LEA
SI, SIZE FILLER - TYPE FILLER
; load destination offset (segment = ES)
LEA
DI,FILLER - TYPE FILLER
MOV
CX,LENGTH WORKSPACE
; set up counter
STD
; process string high to low
; fill destination string with pattern
REP
MOVSB
Содержание Am186 Series
Страница 1: ...Am186 and Am188 Family Instruction Set Manual February 1997...
Страница 10: ...Table of Contents x...
Страница 18: ...Programming 1 8...
Страница 40: ...Instruction Set Listing 3 14...