Keil Logo


3.2 Literals

Assembly language source code can contain numeric, string, Boolean, and single character literals.

Literals can be expressed as:
  • Decimal numbers, for example 123.
  • Hexadecimal numbers, for example 0x7B.
  • Numbers in any base from 2 to 9, for example 5_204 is a number in base 5.
  • Floating point numbers, for example 123.4.
  • Boolean values {TRUE} or {FALSE}.
  • Single character values enclosed by single quotes, for example 'w'.
  • Strings enclosed in double quotes, for example "This is a string".


In most cases, a string containing a single character is accepted as a single character value. For example ADD r0,r1,#"a" is accepted, but ADD r0,r1,#"ab" is faulted.
You can also use variables and names to represent literals.
Non-ConfidentialPDF file icon PDF versionARM DUI0379H
Copyright © 2007, 2008, 2011, 2012, 2014-2016 ARM. All rights reserved. 
  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.