Hi!
I followed the path described here (viewtopic.php?t=7626) to setup a Document Type for Z80 assembler.
That was helpful, however I could not figure out how to get the lookup to work, to make the editor jump to a label which might be defined in the current file, or in a different file which is sourced (included) by the current file.
I have provided a simple example: suppose we have two files, in FineA.asm there is the definition of a label called "ClearBlock", that file may or may not be opened right now. FileB.asm is opened in the Zeus editor, I'm at the statement "call ClearBlock" with the cursor and want the editor to open FileA.asm and to jump to the ClearBlock label.
What do I have to do to make Zeus do that navigation?
Example:
FileA.asm ...
ClearBlock: ; That's the label I want to navigate to
ld d,h
ld e,l
inc de
ldir
ret
FileB.asm ...
include "FileA.asm" ;this tells the assembler to read FileA.asm at this point, all label in this file can be accessed from code.
MainCode:
call ClearBlock ; This is where the cursor is currently sitting in the editor, I want to navigate to ClearBlock from here in FileA.asm
Setup Z80 language
Re: Setup Z80 language
The following new post describes how to do this Z80 setup: viewtopic.php?f=5&t=8216
With those changes in place you will be able to navigate your source code using the options found on the Tags menu.
Cheers Jussi
With those changes in place you will be able to navigate your source code using the options found on the Tags menu.
Cheers Jussi
Re: Setup Z80 language
Thank you Jussi, that worked!
However, a few issues I don't understand how to fix: the macro lookup does not work, and "inc" and "pop" are showing up as macros:
I did everything as described, the label's "ClearScreen, ProgramOrg, repeat" appear in the Packages section, which is as expected I think, however in the Macros section we have "inc, pop" and all the constants, but not the Copy1 macro.
I have attached a screenshot that shows how it looks like and the example asm file.
Would be cool if you have a solution for that.
Thank you
PS: please don't wonder that I'm using the ampersand to prefix hex numbers
However, a few issues I don't understand how to fix: the macro lookup does not work, and "inc" and "pop" are showing up as macros:
I did everything as described, the label's "ClearScreen, ProgramOrg, repeat" appear in the Packages section, which is as expected I think, however in the Macros section we have "inc, pop" and all the constants, but not the Copy1 macro.
I have attached a screenshot that shows how it looks like and the example asm file.
Would be cool if you have a solution for that.
Thank you
PS: please don't wonder that I'm using the ampersand to prefix hex numbers
- Attachments
-
- Test01.zip
- (346 Bytes) Downloaded 551 times
-
- Zeus.png (49.13 KiB) Viewed 13537 times
Re: Setup Z80 language
Looking into this there are at least two issues at play:
1. The default ctags automatically parse ASM files and this is why many of these additional tags are being created.
2. The .ctags details used were copied from the web and they don't appear to be well defined. The new .ctags details shown below work much better and this definition also fixes the first issue as it disable the built in ASM parsing.
Here are the new .ctags settings:
With these setting in place these are the results produced:
NOTE: To have those labels show up as functions use this .ctags configuration instead:
That will then create the following tag information:
Cheers Jussi
1. The default ctags automatically parse ASM files and this is why many of these additional tags are being created.
2. The .ctags details used were copied from the web and they don't appear to be well defined. The new .ctags details shown below work much better and this definition also fixes the first issue as it disable the built in ASM parsing.
Here are the new .ctags settings:
Code: Select all
--langdef=z80
--langmap=z80:.asm
--languages=-Asm
--regex-z80=/^([a-zA-Z]+[a-zA-Z0-9_]*):/\1/r,label/
--regex-z80=/^macro[ ]+([a-zA-Z]+[a-zA-Z0-9_]*)/\1/m,macro/
--regex-z80=/^([a-zA-Z]+[a-zA-Z0-9_]*)[ ]+equ[ ]+/\1/v,variable/
Code: Select all
--langdef=z80
--langmap=z80:.asm
--languages=-Asm
--regex-z80=/^([a-zA-Z]+[a-zA-Z0-9_]*):/\1/f,function/
--regex-z80=/^macro[ ]+([a-zA-Z]+[a-zA-Z0-9_]*)/\1/m,macro/
--regex-z80=/^([a-zA-Z]+[a-zA-Z0-9_]*)[ ]+equ[ ]+/\1/v,variable/