Author
Topic: Apply Keyword to first byte only (Read 1340 times)

Hi everyone, i have attempted to setup a Motorolla 68HC11 syntax xml, it's all working but due to the code being hex other variables or numbers get picked up as syntax, can we limit syntax searching to the first byte only on each line?

You may try also replace Keywords by Regexp or Block definition if registered are all combinations of hex from 00 to FF, but in this case, you will not get them suggested in auto-completion list (if a register is not yet typed in a document).

BR, Alex.P.S: If you would like to share your syntax schema and get it available in the repository for download, you may send it to me when it is done - I will validate and publish it. It also qualify for free license, if you need it http://hippoedit.com/free_licensed_copy.php

can you attach here (or send to supportbox at hippoedit com) a test file Motorolla 68HC11 file? I would use it for further validation and we can also check if something can be added.

Do you have ideas about what can be:- default file template for Motorolla 68HC11 file- standard Code Templates that can be added to the scheme- Some internet links to documentation, instruction documentation that can be added as syntax contextual help and reference?

checking your sample, and also other samples I have found on the Internet, I saw that the scheme was rather incomplete. Even in your example comments were not properly syntax highlighted :/So, I have spent some time on correcting it and extending based on information from the Internet. Also adding descriptions for instructions.Resulted scheme may be found in GitHub: https://github.com/hippoedit/syntax/tree/master/AssemblerPlease validate, if it is OK (you can find attached examples or find some other samples in Web).

Also for me was confusing, that you have used for comments {} and @ for labels. Have not found any example with that.Do you have a link to syntax specification for Freescale 68HC11?

Unfortunately it's not a one size fits all, different companies used different compilers which wrote the assembly differently, mine is GM specific, others will be different. There are so may Variants that you will not cater to them all, this is why i have searched for many years to find a program i can customize the syntax highlighting to suit what i am using. It is fine if you dont want to publish it, it is here on the forums if people need it and can also mod it to suit their variant.

I publish new schemes with a pleasure, but I need to be sure, that it has the best quality And it is completely correct (at least in a way syntax rules may allow). That is why I always verify schemes before publishing, checking in live examples.

On your example (screenshot):- everything after ";" is not recognized as a comment- numbers are not properly highlighted - you have in scheme {} for comment, but I do not see this in your sample file- you have in scheme @ for a label, but I do not see it in your sample file

I wasn't worried about number or comment highlight sorry just main code and syntax. But you have fixed that.

As before there is no standard schema because it depends on what compiler your using unfortunately. The one i use is not published because it's propriety. Here is the manufacturers datasheet for the chip, page 72 on has the syntax, but no standard code layout because it was left to people to use their own compilers.

It makes no sense to release to others some syntax schema that they can not use because the compiler is proprietary. But we can try to release some more generic for 68HC11 and you will do specialization of it, by inheriting the generic schema. If it will work.

Please provide a more extended version of you sample file, with labels and block comments (better with all syntax constructions that may appear) that we can verify if generic scheme fits. As I wrote, you used @ for defining a label and {} for comments. And I do not know if it was a mistake in a scheme definition, or is a real part of the syntax - then I need to see an example that can validate that it works.

In addition, I have found several keywords that are in the scheme but not in the data sheet you have provided, as:

Code: XML

<Keywordtext="ABDA"/>

<Keywordtext="ADC A"descr="Add with Carry to A"/>

<Keywordtext="ADC B"descr="Add with Carry to B"/>

<Keywordtext="ADMMUX1"/>

<Keywordtext="ADREAD"/>

<Keywordtext="ASL A"descr="Arithmetic Shift Left A"/>

<Keywordtext="ASL B"descr="Arithmetic Shift Left B"/>

<Keywordtext="ASL D"descr="Arithmetic Shift Left D"/>

<Keywordtext="ASR A"descr="Arithmetic Shift Right A"/>

<Keywordtext="ASR B"descr="Arithmetic Shift Right B"/>

<Keywordtext="DEC A"descr="Decrement Accumulator A"/>

<Keywordtext="DEC B"descr="Decrement Accumulator B"/>

<Keywordtext="EOR A"descr="Exclusive OR A with Memory"/>

<Keywordtext="EOR B"descr="Exclusive OR B with Memory"/>

<Keywordtext="LD D"/>

<Keywordtext="LD S"/>

<Keywordtext="LD X"/>

<Keywordtext="LD Y"/>

<Keywordtext="LDA A"/>

<Keywordtext="LDA B"/>

<Keywordtext="LDA D"/>

....

Can you please verify the list of keywords (in updated scheme from me) against of datasheet you have provided and tell, if the list is OK. What is missing, what is incorrect, and where is your personal additions (if they are in). Check if descriptions of instructions are OK - this what will be displayed in auto completion list.I assume all instructions with spaces inside like "PSH X" etc are alternatives to instructions without space e.g. "PSHX"?

Also, I would like to know, what means are "registers" on the first column. Are they works as labels? While in all other samples I have found, it was a place for labels. Is it required that first "column" is always filled? And for what means a second column where numbers are used? This actually was a problem for extending the definition of number to support also HEX because I need rules to distinguish it from instruction in the text, e.g. "ADCD".

while I did not get any response and clarification from you, I have stripped from the scheme instructions I have not found in the official documentation, comment style with {} and registers and have published the scheme in that way in the on-line repository. Now other users can benefit from it.http://asm68hc11-editor.hippoedit.com

But to still keep your extension, I have moved them in new "specialized" scheme, which inherits from base ASM68HC11 and extend it with additional styles and keywords. You can find it on GiHub:https://github.com/hippoedit/syntax/blob/master/Assembler/asm68HC11X_spec.xmlIf you want to use it, you need to install base ASM68HC11 and extension. Then you can disable the base scheme in settings to not get it selected/suggested.

Yes unfortunately these older processors it was specialized, so it may not be of use to all people using the same processor. Standardization has come along way now with compilers. Im not sure what you really want me to do, i have verified it does what i need it to do so i dont really have anything more to add.

Yes the spaces i added in like PSHX and PSH X was because some of my code can have either. I spaced it in some of my later code for ease of reading.

The reference highlights you can call what you wish that is just what i came up with. Yes the highlighting of things that have the same value is a problem.

for me was important to know, what is a common instruction set/syntax for Freescale 68HC11 and what is an extension for your special case. Because I can only publish most common part. That was a reason for my questions. I can not be an expert in all syntaxes, so for preparation/validation of syntax scheme, I need someone who has a deep knowledge in the language specification.

But OK, now it is done, I have published the common syntax, hope it is OK.And, as mentioned, your extensions for common subset of Freescale 68HC11 instructions you can find in "ASM68HC11X" on GitHub.