1. Georg Brandl
  2. pygments-main
  3. Issues
Issue #920 new

cpp-objcopy highlighting problem with arm.

john_kearney
created an issue

The highlighter is is not working with arm disassembler.

Arm asm example.

  fe028210: e2433001    sub r3, r3, #1
  fe028214: e6ef3073    uxtb    r3, r3
  fe028218: e3530001    cmp r3, #1
  fe02821c: 8a00004d    bhi fe028358 <procfs_read+0x210>

vs x86

  f00a3586: 8b 58 20                mov    0x20(%eax),%ebx
  f00a3589: 8b 2d 84 3b 0b f0       mov    0xf00b3b84,%ebp
  f00a358f: 8b 9b 54 08 00 00       mov    0x854(%ebx),%ebx
  f00a3595: 89 5c 24 64             mov    %ebx,0x64(%esp)

changing this solves the main problem

            # Code line with disassembled instructions
            ('( *)('+hex+r'+:)(\t)((?:'+hex+hex+' |'+hex+'{8,8} )+)( *\t)([a-zA-Z].*?)$',
                bygroups(Text, Name.Label, Text, Number.Hex, Text,
                         using(GasLexer))),

i.e. ((?:'+hex+hex+' |'+hex+'{8,8} )+) instead of ((?:'+hex+hex+' ')+)

Second issue is in the gas Lexer number = r'(?:0[xX][a-fA-F0-9]+|#?\d+)' Added an optional #? as this is the asm syntax e.g. #3