orbitalquark / textadept

Textadept is a fast, minimalist, and remarkably extensible cross-platform text editor for programmers.
https://orbitalquark.github.io/textadept
MIT License
640 stars 38 forks source link

org directive isn't highlighted in 'asm' lexer #335

Open Selorax opened 1 year ago

Selorax commented 1 year ago

'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 commented 1 year ago

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
orbitalquark commented 1 year ago

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