Assembly code highlight

hi

can we add assembly code highlight in md.
for example:

; Define variables in the data section
SECTION .DATA
	hello:     db 'Hello world!',10
	helloLen:  equ $-hello

; Code goes in the text section
SECTION .TEXT
	GLOBAL _start 

_start:
	mov eax,4            ; 'write' system call = 4
	mov ebx,1            ; file descriptor 1 = STDOUT
	mov ecx,hello        ; string to write
	mov edx,helloLen     ; length of string to write
	int 80h              ; call the kernel

	; Terminate program
	mov eax,1            ; 'exit' system call
	mov ebx,0            ; exit with error code 0
	int 80h              ; call the kernel

actual md rendering for asm

Hi Zeid,

Thank you for the question.
You can use z80 mode for the assembly language.

hi
thanks for your response but its clear there no solution for 32 bit and 64 bit assembly. Use z80 (its for 8 bit assembly)is just cosmetic solution not a real solution…
regards

I’m not familiar with assembly languages, and I’m afraid that it is not supported if CodeMirror doesn’t have the mode you are looking for. Please Google with keywords like codemirror assembly mode.

I also have the same problem, finding the correct language for intel x86 assembly. From the docs Markdown Cheatsheet, refer to demo highlight.js demo highlight.js demo, there is assembler in language category with Intel x86 Assembly example. I tried it and not working using x86asm for language code in Inkdrop.

Ah, the documentation is not correct. Inkdrop does not use highlight.js but relies on CodeMirror. The supported languages are listed below:

https://codemirror.net/mode/

Looks like Gas (AT&T-style assembly) and Z80 assembly are supported:

https://codemirror.net/mode/gas/index.html

https://codemirror.net/mode/z80/index.html

I’ll fix the example.

Noted, thank you.

1 Like