Debug: A--Notes
Using mnemonics
The segment-override mnemonics are cs:, ds:, es:, and ss:. The mnemonic for the far return is retf. String-manipulation mnemonics must explicitly state the string size. For
example, use movsw to move word strings (16 bits), and use movsb to move byte strings (8 bits).
Assembling jumps and calls
The assembler automatically assembles a short, near, or far jump or call,
depending on byte displacement, to the destination address. You can override such a
jump or call by using a near or far prefix, as the following example shows:
-a0100:0500
0100:0500 jmp 502 ; a 2-byte short jump
0100:0502 jmp near 505 ; a 3-byte near jump
0100:0505 jmp far 50a ; a 5-byte far jump
You can abbreviate the near prefix to ne.
Distinguishing word and byte memory locations
When an operand can refer to either a word memory location or a byte memory
location, you must specify the data type with the prefix word ptr or the prefix byte ptr. Acceptable abbreviations are wo and by, respectively. The following example shows the two formats:
dec wo [si]
neg byte ptr [128]
Specifying operands
Debug uses the common convention that an operand enclosed in brackets ([ ])
refers to a memory location. This is because Debug cannot otherwise differentiate
between an immediate operand and an operand that is a memory location. The
following example shows the two formats:
mov ax,21 ; load AX with 21h
mov ax,[21] ; load AX with the
; contents of
; memory location 21h
Using pseudoinstructions
Two popular pseudoinstructions are available with the a command: the db opcode, which assembles byte values directly into memory, and the dw opcode, which assembles word values directly into memory. Following are
examples of both pseudoinstructions:
db 1,2,3,4,"THIS IS AN EXAMPLE"
db 'THIS IS A QUOTATION MARK: "'
db "THIS IS A QUOTATION MARK: '"
dw 1000,2000,3000,"BACH"
More Information About Debug: A
Debug: A--Examples
Debug: A