Keil Logo


The ASM command displays or sets the current assembly address, or assembles an instruction.

Syntax Description
ASM Displays the address where in-line assembly instructions are stored.
ASM startAddr Sets the in-line assembly address to startAddr.
ASM instruction Assembles the specified instruction and stores the resulting opcode in memory at the current in-line assembly address. The address is increased by the number of bytes in the instruction. You may use the Inline Assembler to correct mistakes or to make temporary changes to the target program.
>ASM C:0x0000          /* set assemble address to C:0x0000 (8051 & 251) */
>ASM mov a,#12
>ASM mov r0,#0x20
>ASM movx @r0,A
>ASM inc r0
>ASM movx @r0,A
>ASM jmp C:0x8000

>ASM C:0020H          /* set assemble address to C:0x0020 (8051 & 251) */


  • The Inline Assembly... dialog allows assembling instructions while debugging. Open the dialog via the Context menu of the Disassembly window. The Inline Assembler accepts mnemonics for assembly instructions based on the device in use.
  • For 80x51 microcontrollers, the startAddr can contain a Memory Type Specifier.
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.