gnupic: What are stkadj and FUSTART???


Previous by date: 14 Mar 2012 06:57:02 -0000 Re: What are stkadj and FUSTART???, Lorenzo Marcantonio
Next by date: 14 Mar 2012 06:57:02 -0000 Re: What are stkadj and FUSTART???, Lorenzo Marcantonio
Previous in thread: 14 Mar 2012 06:57:02 -0000 Re: What are stkadj and FUSTART???, Lorenzo Marcantonio
Next in thread: 14 Mar 2012 06:57:02 -0000 Re: What are stkadj and FUSTART???, Lorenzo Marcantonio

Subject: Re: What are stkadj and FUSTART???
From: Marko Kohtala ####@####.####
Date: 14 Mar 2012 06:57:02 -0000
Message-Id: <CAJ0yFay1FTvLyY88mUc+N95MidgG_SYyQxQwLAwfaQ0dEwOiJQ@mail.gmail.com>

2012/3/13 Lorenzo Marcantonio ####@####.####
> Funny thing: mpasmx seems to be written in... pascal! (object free pascal, probably, the exec is not stripped so the inner symbols are visible:P)

Yes, I've seen it mentioned elsewhere. I've understood it is somewhat
of a burden to Microchip because not many people are competent in
maintaining anything written in pascal.

> A 'strings' check on mplabx revealed these between the various opcodes:
>
> ICD_IRQ
> ICD_POP
> ICD_PUSH
> ICD_RET
> EMULDIS
> EMULEN
> FUEND
> FUSTART
> MOVFX
> RELOCTLMERGE
> SCNEND_LFSR
> SCNSTART_LFSR
> STKADJ
> TRAP
> TRET
>
> Some of these are mentioned here:
>
> http://support2.microchip.com/KBSearch/KB_Ticket.aspx?ID=Tt6UJ9A0003LM
> so it seems there are undocumented features in mpasm

Yes, the SCNSTART_SFSR and END have relocations in the object file and
linker modifies the section information into it. However these
relocations are not implemented in the gputils linker.

When using ICD, MPLAB adds some code for the debugger. Some of these
sound like they could be used in that code to access some debugging
features of PICs that are not public to us mortals.

>> This link includes a stkadj function, but I don't know if it's the
>> same stkadj you're finding (it's being used in some table lookup code)
>
> No, it's some kind of internal macro, the comment says 'pseudo-instruction'
> I think its used for critical stack depth analysis (mplink has a -g flag to "generate the report file for stack analysis", but didn't found any doc)

C18 generates some extra information into the COFF file that you can
not generate with MPASM. Part of it is the call tree that is used by
the linker mainly to allocate overlay storage class function local
variables ("activation records"). I have not tried this -g option, but
it most likely uses this information for a report.

>> And here's a use of FUSTART -- I've got *no* idea what it's being used
>> for (from context, I wouldn't be surprised if you came back and told
>> me that this is the code you found it in!)
>
> More or less... C18 libc, still; IMHO is a marker to emit a COFF function
> something (there's also FUEND).
>
> Morale: removed them, code works XD
>
> --
> Lorenzo Marcantonio
> Logos Srl
>

Previous by date: 14 Mar 2012 06:57:02 -0000 Re: What are stkadj and FUSTART???, Lorenzo Marcantonio
Next by date: 14 Mar 2012 06:57:02 -0000 Re: What are stkadj and FUSTART???, Lorenzo Marcantonio
Previous in thread: 14 Mar 2012 06:57:02 -0000 Re: What are stkadj and FUSTART???, Lorenzo Marcantonio
Next in thread: 14 Mar 2012 06:57:02 -0000 Re: What are stkadj and FUSTART???, Lorenzo Marcantonio


Powered by ezmlm-browse 0.20.