Enable syntax highlighting for ARM and x86 assembly

According to Discourse Meta > Configure which programming languages are available for syntax highlighting, site admins can configure the languages for which syntax highlighting is supported in forum posts by using the hightlighted_languages site setting.

I propose to add armasm, arm, and x86asm to this list (these are the corresponding language codes supported by highlight.js). I just wrote a post that would have benefited from syntax highlighting (What's stored at [AsyncContext + 16]?).

For reference (and for verifying eventual success), here's a code block with the x86asm language code:

output.caller() async -> ():
        push    rax
        ; Load size of AsyncContext required for calling asyncFunc()
        mov     edi, dword ptr [rip + (async function pointer to output.asyncFunc() async -> ())+4]
        ; Allocate AsyncContext for async function call.
        call    swift_task_alloc@PLT

And here's one with armasm (copied from Godbolt):

square(int):                             // @square(int)
        sub     sp, sp, #16
        str     w0, [sp, #12]
        ldr     w8, [sp, #12]
15 Likes

Enabled highlighting for the above request.

5 Likes

Fantastic, thank you!

2 Likes

Now that we’ve got assembly syntax covered, can we also turn on support for LaTeX math? Enable discourse-math plugin for rendering LaTeX-style equations - Site Feedback - Racket Discourse

5 Likes