Assemble command
Purpose: To assemble IBM Personal Computer Macro Assembler language
statements directly into memory.
Format: A [address]
Remarks: All numeric input to the Assemble command is in hexadecimal.
The assembly statements you enter are assembled into memory
at successive locations, starting with the address specified
in address. If no address is specified, the statements are
assembled into the area at CS:0100h, if no previous Assemble
command was issued, or into the location following the last
instruction assembled by a previous Assemble command. When
all desired statements have been entered, press Enter when
you are prompted for the next statement, to return to the
DEBUG prompt.
DEBUG responds to invalid statements by displaying:
^error
and redisplaying the current assemble address.
DEBUG supports standard 8088/8086 assembly language syntax
(and the 8087) instruction set), with the following rules:
■ All numeric values entered are hexadecimal and can be
entered as 1-4 characters.
■ Prefix mnemonics must be entered in front of the opcode
to which they refer. They can also be entered on a sepa-
rate line.
■ The segment override mnemonics are CS:, DS:, ES:, and
SS:.
■ String manipulation mnemonics must explicitly state the
string size. For example, MOVSW must be used to move word
strings and MOVSB must be used to move byte strings.
■ The mnemonic for the far return is RETF.
■ The assembler will automatically assemble short, near,
or far jumps and calls depending on byte displacement to
the destination address. These can be overridden with
the NEAR or FAR prefix. For example:
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
The NEAR prefix can be abbreviated to NE, but the FAR
prefix cannot be abbreviated.
■ DEBUG cannot tell whether some operands refer to a word
memory location or a byte memory location. In this case,
the data type must be explicitly stated with the prefix
WORD PTR or BYTE PTR. DEBUG will also accept the abbre-
viations WO and BY. For example:
NEG BYTE PTR [128]
DEC WO [SI]
■ DEBUG also cannot tell whether an operand refers to a
memory location or to an immediate operand. DEBUG uses
the common convention that operand enclosed in square
brackets refer to memory. For example:
MOV AX,21 ;Load AX with 21h
MOV AX,[21] ;Load AX with the contents of
; memory location 21h
■ Two popular pseudo-instructions have also been included.
The DB opcode assembles byte values directly into memo-
ry. The DW opcode assembles word values directly into
memory. For example:
DB 1,2,3,4,"This is an example"
DB "This is a quote: "'
DB "This is a quote:'"
DW 1000,2000,3000,", BACH:"
■ All forms of the register indirect commands are support-
ed. For example:
ADD BX,34[BP+2].[SI-1]
POP [BP+DI]
PUSH [SI]
■ All opcode synonyms are supported. For example:
LOOPZ 100
LOOPE 100
JA 200
JNBE 200
■ For 8087 opcodes the WAIT or FWAIT prefix must be ex-
plicitly specified. For example:
FWAIT FADD ST,ST(3) ;This line will assemble
; an FWAIT prefix
FLD TBYTE PTR [BX] ;This line will not
Example: C>debug
-a200
08B4:0200 xor ax,ax
08B4:0202 mov [bx],ax
08B4:0204 ret
08B4:0205