textadept icon indicating copy to clipboard operation
textadept copied to clipboard

org directive isn't highlighted in 'asm' lexer

Open Selorax opened this issue 2 years ago • 2 comments

'org' is the directive of the assembly language to tell the assembler that next code will be loaded at a specific address in memory.

Selorax avatar Jan 11 '23 09:01 Selorax

Also, a question, is it possible to highlight assembly labels and constants defined with EQU in the current file?

Though that would make lexer dynamic in a sense, as in, what it highlights depends on the content of opened file. You might also want to add definitions from include files, but that's going to be another level.

However it would let the user easily spot mistypes such as

print_string EQU 0F809h
exit EQU 0F800h
org 100h
	jmp satrt:
hello_world_string:
	db "Hello, world!", 10, 0
start:
	mov a, hello_wrld_string
	call priint_string
	call exit

Selorax avatar Jan 11 '23 09:01 Selorax

I think it can be done, but I'm not sure how accurate or performant it would be.

orbitalquark avatar Jan 11 '23 13:01 orbitalquark