Keil™, An ARM® Company

Technical Support

A51: TAB CHARACTERS ARE EXPANDED TO SPACE CHARACTERS


Information in this article applies to:

  • C51 Version 6.21
  • C51 All Versions

QUESTION

When programming in A51, I have noticed that tab characters (0x09) within a single quote in a DB statement are always expanded to space characters (0x20). How do I force the assembler to keep a tab character as it is?

ANSWER

As an example,

CR      EQU     13
LF      EQU     10

        DB      '01     Test    0', CR, LF
;                  TAB      TAB

In the above statement, tab characters (entered above the TAB comments) are expanded to space characters when the code is assembled.

If you want tab characters, you must modify your assembler source code as follows:

CR      EQU     13
LF      EQU     10
TAB     EQU     9

        DB      '01', TAB, 'Test', TAB, '0', CR, LF

The code above uses constants for the tab characters and these are not expanded into spaces.

Last Reviewed: Thursday, March 07, 2002


Did this article provide the answer you needed?
 
Yes
No
Not Sure