Can we enable `x86asm` highlighting?

In Need help with boolean type condition - #6 by scottmcm I was trying to include some assembly, and couldn't find the incantation to get it to highlight it.

Based on https://highlightjs.org/demo I think it should be x86asm, which maybe needs to be enabled (Configure which programming languages are available for syntax highlighting - Site Management - Discourse Meta) for this site?

2 Likes

I love the current list of supported syntaxes. Not sure why, but I find the fact that we can syntax-highlight Objective-C hilarious:

  • apache
  • bash
  • cpp
  • css
  • coffeescript
  • diff
  • xml
  • http
  • ini
  • json
  • java
  • javascript
  • makefile
  • markdown
  • nginx
  • objectivec
  • ruby
  • perl
  • php
  • python
  • sql
  • handlebars
  • rust
  • dust
  • haskell

It seems rather strange to not enable all supported languages. Even though this is a rust forum, it is common to need to mention bits of code in other languages for all sorts of reasons (FFI, what is the equivalent in Rust, wouldn't it be nice if we had this too[1], etc).

I would like to see not just x86 asm turned on, but at least ARM and LLVM IR as well (if they are supported).


  1. That might be more of an internals thing though. â†Šī¸Ž

2 Likes

I could have sworn that one already was, but nope :confused: So llvm as well, please :slight_smile:

define noundef zeroext i1 @obvious_eq(ptr noalias nocapture noundef readonly align 2 dereferenceable(8) %x, ptr noalias nocapture noundef readonly align 2 dereferenceable(8) %y) unnamed_addr {
start:
  %_4 = load i16, ptr %x, align 2
  %_5 = load i16, ptr %y, align 2
  %_3 = icmp eq i16 %_4, %_5
  br i1 %_3, label %bb1, label %bb8

bb1:
  %0 = getelementptr inbounds nuw i8, ptr %x, i64 2
  %_7 = load i16, ptr %0, align 2
  %1 = getelementptr inbounds nuw i8, ptr %y, i64 2
  %_8 = load i16, ptr %1, align 2
  %_6 = icmp eq i16 %_7, %_8
  br i1 %_6, label %bb2, label %bb8

bb2:
  %2 = getelementptr inbounds nuw i8, ptr %x, i64 4
  %_10 = load i16, ptr %2, align 2
  %3 = getelementptr inbounds nuw i8, ptr %y, i64 4
  %_11 = load i16, ptr %3, align 2
  %_9 = icmp eq i16 %_10, %_11
  br i1 %_9, label %bb3, label %bb8

bb3:
  %4 = getelementptr inbounds nuw i8, ptr %x, i64 6
  %_12 = load i16, ptr %4, align 2
  %5 = getelementptr inbounds nuw i8, ptr %y, i64 6
  %_13 = load i16, ptr %5, align 2
  %6 = icmp eq i16 %_12, %_13
  br label %bb8

bb8:
  %_0.sroa.0.0 = phi i1 [ %6, %bb3 ], [ false, %bb2 ], [ false, %bb1 ], [ false, %start ]
  ret i1 %_0.sroa.0.0
}
3 Likes

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.