Subject of Code Tags.

jpanhalt

Joined Jan 18, 2008
11,087
I tried to get highlighting with no effect with [code=asm] <code>[/code]. Using the color icon, all it did was print the color code like this:
upload_2018-12-24_12-28-58.png

MPASM behaved the same. ASMPIC16 and variations of that simply gave "unknown code. " However, the "mono" tags do work as expected for color.
 

bertus

Joined Apr 5, 2008
22,278
Hello,

As far as I know the language should be in lower case:
Code:
org     0x000
        goto    main

    org     0x004   ; interrupt vector location
        movwf   w_temp          ; save off current W register contents
        movf    STATUS, W        ; move status register into W register
        movwf   status_temp     ; save off contents of STATUS register
int_here:
               ;Identify source
        btfsc    INTCON, INTF    ;Ext P.B.?
         goto    ext_int
         btfsc    INTCON, T0IF    ;Ext TMR0?
         goto    t0_int
         goto    isr_end    ;Neither so go exit
     
ext_int:
        bcf        STATUS, RP0
Bertus
 

bertus

Joined Apr 5, 2008
22,278
Hello,

I used the following to produce the code in post #3


[code=asm]
org 0x000
goto main

org 0x004 ; interrupt vector location
movwf w_temp ; save off current W register contents
movf STATUS, W ; move status register into W register
movwf status_temp ; save off contents of STATUS register
int_here:
;Identify source
btfsc INTCON, INTF ;Ext P.B.?
goto ext_int
btfsc INTCON, T0IF ;Ext TMR0?
goto t0_int
goto isr_end ;Neither so go exit

ext_int:
bcf STATUS, RP0
[/code]

I see that the plain tag also removes the intends.

Bertus
 

jpanhalt

Joined Jan 18, 2008
11,087
With code=asm, I do not get highlighting for this, based on the preview window:
upload_2018-12-24_12-59-4.png
In ASM, literals are normally highlighted, but the movwf is not highlighted as intended:

upload_2018-12-24_13-4-12.png
 

JohnInTX

Joined Jun 26, 2012
4,787
Did you do the color highlighting in the code yourself? If so, the code tag parser doesn't like that. It would be nice if it did or at least ignored the brackets but I've had that problem myself.

FWIW you can use MPASM as the language ID for PIC. I think it's a little better.
 

bertus

Joined Apr 5, 2008
22,278
Hello,

using mpasm

Code:
org     0x000
        goto    main

    org     0x004   ; interrupt vector location
        movwf   w_temp          ; save off current W register contents
        movf    STATUS, W        ; move status register into W register
        movwf   status_temp     ; save off contents of STATUS register
int_here:
               ;Identify source
        btfsc    INTCON, INTF    ;Ext P.B.?
         goto    ext_int
         btfsc    INTCON, T0IF    ;Ext TMR0?
         goto    t0_int
         goto    isr_end    ;Neither so go exit
  
ext_int:
        bcf        STATUS, RP0
Bertus
 
Top