A [[address]]
address
Begins assembly at this address. If address is not given, assembly begins at the current assembly address (see below).
The Assemble (A) command assembles 8086-family (8086/87/88, 80186/286, 80287/387, and 80286/386/486 unprotected) instruction mnemonics and places the resulting instruction code into memory at a specified address. The only 8086-family mnemonics that cannot be assembled are 80386/486 protected-mode mnemonics. In addition, the CodeView debugger can assemble 80286 instruc-tions that use the 32-bit 386/486 registers.
If address is specified, the assembly starts at that address; otherwise, the current assembly address is assumed.
The assembly address is normally the current address or the address pointed to by CS:IP. However, when you use the Assemble command, the assembly address is set to the address immediately following the last assembled instruction.
When you enter any command that executes code (Trace, Program Step, Go, or Animate), the assembly address is reset to the current address.
Use the following procedure to assemble instructions:
1.Type the Assemble (A) command in the command window and press ENTER. CodeView displays the assembly address and waits for you to enter a new instruction.
2.Type a mnemonic and press ENTER. CodeView assembles the instruction into memory and displays the next available address. If an instruction you enter contains a syntax error, CodeView displays the message:
^ Syntax error
Then CodeView redisplays the current assembly address and waits for you to enter a correct instruction. The caret (^) in the message points to the first character that CodeView could not interpret.
3.Continue entering new instructions until you have assembled all the instructions you want.
4.Press ENTER without entering any mnemonic to conclude assembly and return to the CodeView prompt.
Consider the following principles when you enter instruction mnemonics:
The far-return mnemonic is RETF.
String 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.
CodeView automatically assembles short, near, or far jumps and calls, depending on byte displacement to the destination address. These may be overridden with the NEAR or FAR prefix. The NEAR prefix can be abbreviated to NE, but the FAR prefix cannot be abbreviated.
CodeView cannot determine whether some operands refer to a word memory location or to a byte memory location. In these cases, the data type must be explicitly stated with the prefix WORD PTR or BYTE PTR. Acceptable abbreviations are WO and BY.
CodeView cannot determine whether an operand refers to a memory location or to an immediate operand. CodeView uses the convention that operands enclosed in brackets ([]) refer to memory.
CodeView supports all forms of indirect register instructions.
All instruction-name synonyms are supported. If you assemble instructions and then examine them with the Unassemble (U) command, CodeView may show synonymous instructions, rather than the ones you have assembled.
Do not assemble and execute 8087/287 instructions if your system is not equipped with a math coprocessor chip.
The effects of the Assemble command are temporary. Any instructions that you assemble are lost as soon as you exit the program.
The instructions you assemble are also lost when you restart the program with the Restart command. The original code is reloaded, possibly writing over parts of memory that you have changed.
This example places two new instructions in a program, replacing any instructions already there.
>a 0x47:0xb3e
0001:0B3E mov ax,bx
0001:0B40 mov si,0x9ce
0001:0043
You can modify a portion of code for testing, as in the example, but you cannot save the modified program. You must modify your source code and recompile.