Pic Assembler font colurs

Status
Not open for further replies.

Wp100

Well-Known Member
Hi,

If someone sends me their pic assembler code, I want to add extra comments to their already commented code, but in a different colour to their original, so it stands out more ?

I can see how to change colour to all the comments or label etc but not how to add in extra comments text of a different colour ? - seem to remember seeing someome had posted code with different colours in the comments fields, so assume it is possible but just cannot see how to do it.

Thanks
 
hi,
Test for the end of line CRLF code 0x13 0x10.
Insert a ";" ahead of the comment string you want to insert..

Why dont you post the source code for the colour change program, I have done something similar, I maybe able to suggest a method.
I use Visual Basic5
 
Hi Eric,

Thanks for your reply, all I was trying to do is as shown here, the DEC line has the missing ,F so just wanted to add that comment to tell the guy what the error is but wanted it to be in say, bold Red so it stood out from his normal comments , if you see what I mean.


Code:
         BTFSS    PORTB,6  ;CHECK PANIC BUTTON N/C CONTACT
                  GOTO     ALARM
                  BTFSS    PORTB,7  ;CHECK FOR 24HR PANIC BUTTON N/C CONTACT
                  GOTO     ALARM
                  DECFSZ   COUNT    ;  needs to know what to do with thecount                                       
	          GOTO     LOOPA
                  RETLW    0
 
hi,
What language is the recolour program written in.? VB5 etc.?
If you post what you have already for the colour coding, it will make it easier to make an addition, rather than writing a stand alone program.
 
Hi Eric,

Afraid we are talking at cross purposes here - the code sample is just plain old microchip assembler,
I was simply wanting , if possible within Mpasm / Mplab , to highlight some of my additional comments lines by the use of a different colour from the other comments lines.
 

him
Gotcha.
I thought you had written a program that went thru an existing assembler program that added colours to its labels, etc....
I will have a rethink!
 

Like this?

Just add the required amendment within the quoted text, highlight it, then choose an appropriate colour from the dropdown.

EDIT: To make it bold, highlight it again as you did before changing colour, then click the B icon.
Sometimes, it is difficult to highlight correctly with the mouse. You can place the cursor at the start of the part you want to highlight, then hold SHIFT and use the right arrow. ;-)

After you have done your edits to the code listing, the relevant text would look something like this in your post preview window:
DECFSZ COUNT[ COLOR="red" ][ B ],F[ /B ][ /COLOR ] (Spaces added within brackets, to prevent parsing)
 
Last edited:

Ooops, I'm at cross purposes here too. I'm afraid I don't know how to do it in MPLAB/MPASM but if you are posting the edits on a forum, the example would work...

Sorry.
 
Ooops, I'm at cross purposes here too. I'm afraid I don't know how to do it in MPLAB/MPASM but if you are posting the edits on a forum, the example would work...

Sorry.

hi,
I have tried with MPLAB and I cannot add a 'comment' to a line with a different colour.
 
Eric,
I think we need Wp100 to clarify whether it is forum-posted code that is coloured.

MPLAB changes the colour of labels and such, but when the .asm is viewed outside of MPLAB the text is mono.

Regards.
 
Hi guys,

Thanks for your efforts.

I was wanting to add in additional comments to some existing .asm code, but the additional text would be in a different colour so when I sent the code back he could easily see my notes.

From the sample code above it would be this comment text that I wanted to be in red.
Code:
  ;  needs to know what to do with the count

Just thought there might have been a simple way that I had missed, but seems not ?

thanks again.
 
The .asm is a simple mono text file. Maybe you could convert it to .doc or something and insert coloured text there?

Alternatively and assuming you have enough room in the .asm comments, you could do something like this:

Code:
BTFSS    PORTB,6  ;CHECK PANIC BUTTON N/C CONTACT
              GOTO     ALARM
              BTFSS    PORTB,7  ;CHECK FOR 24HR PANIC BUTTON N/C CONTACT
              GOTO     ALARM     ; **********************************************
              DECFSZ   COUNT     ; * <- needs to know what to do with the count *
              GOTO     LOOPA     ; **********************************************
              RETLW    0

You could even create a large blank section above & below the area you wish to point out.

HTH.

EDIT: Lost the formatting...
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…