Searching \ for '[PIC]Splitting assemblies in to multiple files' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/microchip/devices.htm?key=pic
Search entire site for: 'Splitting assemblies in to multiple files'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]Splitting assemblies in to multiple files'
2004\10\08@095808 by Mcgee, Mark

flavicon
face
At my first attempt at coding my first PIC program, I think I bit off more
than I can chew.  I attempted to separate my program in to a few assembly
files for structure and convenience thus;
main.asm for the main program (org 0x000 and CODE directives inside)
init.asm for initialisation code (has a CODE directive)
udc.asm for user data
irp.asm for interrupt request processing (org 0x004 - ISR_ADDR label undefined
error on build?)

I discovered that I couldn't use CBLOCK and then use extern <label> in another
file for my data.  So I'm using UDC and RES instructions - is this right?

Furthermore, in (IIRC) the interrupts documentation from Microchip, they
provide some MACROS for saving and restoring registers (PUSH/POP) in the
interrupt handler, which seem to be causing all sorts of build problems.

Also the debugger won't now start on my first instruction for some reason.  I
have used org 0x000 followed by a GOTO Main, then a CODE statement inside
which the Main label presides, maybe this is wrong?

Unfortunately I don't have access to the code from here otherwise I'd post
what I have so far.

Any suggestions on how to develop (for 16F628A - cos that's what I have)
multiple assembly file project would be very welcome!

Regards,
Mark


==============================================================================
This message is for the sole use of the intended recipient. If you received
this message in error please delete it and notify us. If this message was
misdirected, CSFB does not waive any confidentiality or privilege. CSFB
retains and monitors electronic communications sent through its network.
Instructions transmitted over this system are not binding on CSFB until they
are confirmed by us. Message transmission is not guaranteed to be secure.
==============================================================================

_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\08@111009 by Jan-Erik Soderholm

face picon face
Mcgee, Mark wrote :

> At my first attempt at coding my first PIC program, I think I
> bit off more than I can chew.  I attempted to separate my program
> in to a few assembly files for structure and convenience thus;
> main.asm for the main program (org 0x000 and CODE directives inside)
> init.asm for initialisation code (has a CODE directive)
> udc.asm for user data
> irp.asm for interrupt request processing (org 0x004 -
> ISR_ADDR label undefined error on build?)
>
> I discovered that I couldn't use CBLOCK and then use extern
> <label> in another
> file for my data.  So I'm using UDC and RES instructions - is
> this right?

CODE and RES are used for relocatable code, which isn't a bad thing
anyway. Yo have to add a LNK file to the Linker Script option in the
project windows. Select the one matching your PIC model.

I don't think you have to use ORG when writing relocatable code.
The same for CBLOCK (not 100% sue there...).


> Furthermore, in (IIRC) the interrupts documentation from
> Microchip, they provide some MACROS for saving and restoring
> registers (PUSH/POP) in the interrupt handler, which seem to be
> causing all sorts of  build problems.

I don't remeber which PIC ypou where using, but note that the PIC18-line
does this for you when the interrupt happens and when the RETFIE
instruction executes. The 18-line have some special shadow
registers (not the same as the stack) to save some regs.

> Also the debugger

Debugger or simulator ?

> won't now start on my first instruction for
> some reason.  I have used org 0x000 followed by a GOTO Main,
>  then a CODE  statement inside
> which the Main label presides, maybe this is wrong?

I think so. Just do something like :

code_reset     code h'0000'
                       goto main

code_isr     code '0008'
                  your ISR code

then later (anyware actualy) :

code_main   code       ; no address needed.

main            do-whatever...

Note that "code_isr" and "code_main" are not labels, they
are names of the code sections in the source.

>
> Unfortunately I don't have access to the code from here
> otherwise I'd post what I have so far.
>
> Any suggestions on how to develop (for 16F628A - cos that's
> what I have) multiple assembly file project would be very welcome!

I think the most important thing is to remember that some
assembler directives are used in "absolute mode" (such as ORG)
and some others are used in "relocatable mode" (such as CODE).

Then, when splitting the code, you have to add EXTERN when needed,
but that you seems to have found out... :-)

Best Regards,
Jan-Erik.

_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\08@111315 by Ken Pergola

flavicon
face

Hi Mark,

Looks like you are wanting to delve into using the linker MPLINK to create
relocatable code. Please note that you cannot use the 'ORG' directive in
code targeted for the linker. Use the 'CODE' directive.

Use the RES directive in conjunction with the UDATA, UDATA_ACS, UDATA_OVR,
or IDATA RAM allocation directives (some are processor
architecture-specific). You also need to use a linker script. The RES
directive, unlike the CBLOCK or EQU directives, actually reserves RAM
memory. This is a very important concept (and difference) to understand.
Make a copy of the standard linker script for your particular PICmicro and
use the copy, not the original. This is because one will usually need to
edit/modify the linker script to fit into the requirements of your current
project.

Please download and study:

MPASM User's Guide with MPLINK and MPLIB (DS33014G). I've been told that
Microchip will be updating this document in the future. You can also use's
MPLAB IDE's on-line help to supplement this document.


Also, there have been many good discussion here on the PICList as well as on
the Microchip Forums regarding the linker and relocatable code (versus
absolute code). Search terms: MPLINK, linker, relocatable, absolute.

Best regards,

Ken Pergola




_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\08@112339 by Matthew Miller

flavicon
face
Hi everyone,

If anyone has any pointers I would be interested in them as well. The
project I'm working currently is contained in one source file. Can anyone
provide an example of a project (any size) that uses multiple source files?
Or pointers to some good documentation.

Take care, Matthew.

--
"[In] my era everybody smoked and everybody drank and there was no
drug use" -- DEA Chief Thomas Constantine, July 1, 1998
_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\08@113048 by Dave VanHorn

flavicon
face
At 10:23 AM 10/8/2004, Matthew Miller wrote:

>Hi everyone,
>
>If anyone has any pointers I would be interested in them as well. The
>project I'm working currently is contained in one source file. Can anyone
>provide an example of a project (any size) that uses multiple source files?
>Or pointers to some good documentation.

One of the simplest ways to split up a project, is to use include files.
This lets you isolate specific blocks of code into files, but at assemble time, the assembler makes one large source file, then assembles that.


_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\08@120103 by Mcgee, Mark

flavicon
face
Thanks

I'll have a read up on relocatable code and the linker.

Am I correct in saying that code absolutely MUST exist at the reset location
org 0x000?  And also that interrupt code must start from the interrupt
location org 0x008 or 0x004, can't remember which?

Mark

> {Original Message removed}

2004\10\08@123928 by John J. McDonough

flavicon
face
----- Original Message -----
From: "Mcgee, Mark" <spam_OUTmark.mcgeeTakeThisOuTspamcsfb.com>
Subject: RE: [PIC]Splitting assemblies in to multiple files


> Am I correct in saying that code absolutely MUST exist at the reset
location
> org 0x000?

yes

>  And also that interrupt code must start from the interrupt
> location org 0x008 or 0x004, can't remember which?

0004 on the 16F parts.

But that doesn't mean ALL of your code needs to be nailed down.

In the directory where you installed MPLAB go to the subdirectory

  MCHIP_Tools\TEMPLATE\Object

In there are examples for the various processors.

--McD



_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\08@124342 by John J. McDonough

flavicon
face
----- Original Message -----
From: "Dave VanHorn" <.....dvanhornKILLspamspam@spam@dvanhorn.org>
Subject: Re: [PIC]Splitting assemblies in to multiple files


> At 10:23 AM 10/8/2004, Matthew Miller wrote:
>
> >Hi everyone,
> >
> >If anyone has any pointers I would be interested in them as well. The
> >project I'm working currently is contained in one source file. Can anyone
> >provide an example of a project (any size) that uses multiple source
files?
> >Or pointers to some good documentation.
>
> One of the simplest ways to split up a project, is to use include files.
> This lets you isolate specific blocks of code into files, but at assemble
> time, the assembler makes one large source file, then assembles that.

Include files are certainly the easiest way to do this, for the current
project.  They don't help much, however, when it comes time to rip off some
of that code for the next project.

But, if you would like to see an example of using include files for a
smallish project, go to

  http://www.amqrp.org/elmer160/board/

and download Test_Software.zip

72/73 de WB8RCR    http://www.qsl.net/wb8rcr
didileydadidah     QRP-L #1446 Code Warriors #35



_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\08@124606 by Ken Pergola

flavicon
face

Some clarifications:


Ken Pergola was wrong in writing:

> Please note that you cannot use the 'ORG' directive in
> code targeted for the linker.


I should have said that you most likely will never need to use the ORG
directive in code targeted for the linker.

The ORG directive will compile in code targeted for the linker, and although
I personally never use the 'ORG' directive in my linker-based code, it is
legal:


>From MPLAB IDE's online help:

=====
When generating an object file, the org directive is interpreted as
introducing an absolute CODE section with an internally generated name. For
example:

  L1: org 0x200
is interpreted as:

  .scnname  CODE 0x200
  L1:
where .scnname is generated by the assembler, and will be distinct from
every name previously generated in this context.
====



Jan-Erik wrote:

{Quote hidden}

Just to add what Jan-Erik said, the text name or label *before* the CODE
directive does not *have* to be a reference to a SECTION NAME defined in the
linker script file. I feel it is very important to know this.


1) You can use a SECTION NAME if you need that functionality and need to
place code in that code section referenced by the section name in the linker
script, or, you can just use a label so that in the MAP file you will see
this label as a meaningful name under the 'Section' heading.

2) If that label is not a section name defined in your linker script file,
MPLINK will place the code anywhere it sees fit.

3) You also have the choice of NOT putting a label in front of the CODE
directive -- if you do this, MPLINK generates a name for you in the MAP file
for that particular code section.



For example, I don't even like to supply absolute addresses in my reset and
ISR source code when I use the linker (I prefer to keep all this in the
linker file to reduce editing absolute addresses in my source file):



ResetVector CODE
       .
       .
       .

Main_code   CODE
       .
       .
       .

InterruptVector_HighPri   CODE
       .
       .
       .

InterruptVector_LowPri    CODE

       .
       .
       .




'Main_code', 'InterruptVector_HighPri' and 'InterruptVector_HighPri' are a
SECTION NAMEs that I defined in the linker script file.


CODEPAGE   NAME=ResetVector        START=0x000000   END=0x000007
CODEPAGE   NAME=IntVectorHiPri     START=0x000008   END=0x000017
CODEPAGE   NAME=IntVectorLoPri     START=0x000018   END=0x000027
CODEPAGE   NAME=ApplicationCode1   START=0x000028   END=0x0065FF


SECTION    NAME=Main_code                 ROM=ApplicationCode1
SECTION    NAME=ResetVector               ROM=ResetVector
SECTION    NAME=InterruptVector_HighPri   ROM=IntVectorHiPri
SECTION    NAME=InterruptVector_LowPri    ROM=IntVectorLoPri



Note that all labels before the CODE directive above are actually the names
SECTIONs in the linker script. However, I do have some code sections in
which I do not want to reference a specific SECTION in the linker script --
I want the linker to automatically allocate it, but I also want to see a
meaningful name for that code section in the MAP file:


In those instances I just do this:


Messaging_code   CODE


'Messaging_code' is just a label of my choosing and it is NOT a SECTION name
in this case -- it appears in the MAP file like this:
(hopefully the formatting below does not get mangled)


                                Section Info
                 Section       Type    Address   Location Size(Bytes)
               ---------  ---------  ---------  ---------  ---------
             ResetVector       code   0x000000    program   0x000008
 InterruptVector_HighPri       code   0x000008    program   0x000002
  InterruptVector_LowPri       code   0x000018    program   0x000002
               Main_code       code   0x000028    program   0x0000b4
          Messaging_code       code   0x003f76    program   0x00007e


If I decided not put that 'Messaging_code' label in front of the CODE
directive and just use the 'CODE' directive by itself, the MAP file listing
would be different:

                                Section Info
                 Section       Type    Address   Location Size(Bytes)
               ---------  ---------  ---------  ---------  ---------
             ResetVector       code   0x000000    program   0x000008
 InterruptVector_HighPri       code   0x000008    program   0x000002
      externalLatch_code       code   0x00000a    program   0x00000e
  InterruptVector_LowPri       code   0x000018    program   0x000002
                   .code       code   0x003f76    program   0x00007e



See how using 'Messaging_code   CODE' in your source code creates a
meaningful section name in the MAP file? 'Messaging_code' versus '.code'
(which MPLINK generated).


I hope this is helpful.

Best regards,

Ken Pergola





















Best regards,

Ken Pergola

















_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\08@130617 by Jan-Erik Soderholm

face picon face
Dave VanHorn wrote :

> One of the simplest ways to split up a project, is to use
> include files.
> This lets you isolate specific blocks of code into files, but
> at assemble time, the assembler makes one large source file,
> then assembles that.

But you miss the better speed you might get with "true" multiple
source files. Remember that MPLAB only re-assembles those source
files that have changed. That's is also the difference between
the two buttons "Make" and "Make All" on the MPLAB toolbar.

Jan-Erik.
_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\08@131814 by Ken Pergola

flavicon
face

Mark Mcgee wrote:


> Am I correct in saying that code absolutely MUST exist at the
> reset location org 0x000?

Hi Mark,

If it's any code that you *initially* want to execute upon a reset or
power-up of the PIC, then yes. Not all PICs have a reset vector of 0,
however.


> And also that interrupt code must start from the interrupt
> location org 0x008 or 0x004, can't remember which?

Yes any interrupt code must *start* at the appropriate interrupt vector
address -- whatever that is for the particular PIC in question.

You will see post in this thread (either before or after this message hits)
that shows you how to use the linker and the CODE directive to do this
*without* supplying absolute reset and ISR addresses in the source code. I
like to contain as much as I can in the linker script so that I don't have
to manually edit absolute addresses in source code. Some people like to do
the opposite. Choose the method that works for you -- as long as the linker
does not bark at you. :)

I commend anyone starting out in PICs learning the linker.

Please read the following very carefully, because one might get the
impression I'm going against the grain as far as the whole purpose of using
the linker, multiple files, and this thread is concerned. That's not the
point I'm making. My main point below is to help beginners ease the
transition from absolute code to relocatable code using the linker:

I just want to make sure that everyone understands that for beginners
learning how to write code using the linker, you definitely can have one
source file with MPASM in relocatable code mode. Please note that I'm only
advocating the use of one source file for beginners to *initially* get their
feet wet with the linker. If I were teaching someone, I would use one source
file initially, and then once they start learning how to write code with the
linker, I would then encourage them to think "bigger" and start to break out
your source file into separate modules just like this thread title suggest.
In other words, I feel it would be easier for users new to the linker to
take these "baby steps" since a lot of people are either reluctant to use
the linker or unaware of its advantages. But I would warn them not to get
into the habit of using one source file, since this would defeat the whole
purpose of writing modular and relocatable code.

Believe me, I was one of those people that was unaware of the power of the
MPLINK linker. When I started PICmicros there was no MPASM, only MPALC and
there was no linker at all. So out of habit, I stayed with what I was
comfortable with, and when the linker was introduced in later versions of
MPASM (if I remember correctly, even the early versions of MPASM did not
have a linker) I never put in my time to learn how to use the linker like I
should have (hindsight is 20/20). A while back on the PICList, Olin Lathrop
and Dave Dilatush inspired me to change my ways through their writings about
MPASM's relocatable mode and MPLINK. Thanks guys!

If beginners would only realize how easy it is to set up the linker and
write relocatable code at its simplest level, I think more people would
start to write PICmicro code this way. Once again, I'm not saying people
should be using one source file in relocatable mode, but it can be done, and
it is easier, in my opinion, for beginners to *start* this way. If beginners
feel overwhelmed, there is more of a chance they will abandon their efforts
in learning something new -- starting with one source file when using the
linker simplifies things somewhat for beginners and keeps their frustration
level lower. But like I said previously, I'm not advocating one source file
for relocatable code for the long term -- only for the short term for
initially learning how to use the linker. I want to be *real clear* and
explicit about this point.

I love to see discussions on using MPLINK linker/relocatable code since it
is a chance for people to get inspired and put in their time to learn it.

And, if you ever start working with dsPICs in the future, Microchip has
taken away the absolute code "binkie" with dsPICs -- you have to use the
linker -- Olin made a good argument in the past regarding this point.

Best regards,

Ken Pergola


_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\08@134747 by Jan-Erik Soderholm

face picon face
Matthew Miller wrote :

> Hi everyone,
> Can anyone provide an example of a project (any size) that uses
> multiple source files?

OK, since you asked... :-) Here is a simple example.

There is one main code. The main code makes a call (CALL) to one
sub (INIT_REGS) that is in another file, and one jump (GOTO)
to another label (ISR_START) in the third file. I have stripped them
down quite hard and and left comments that are rellevant for the multiple
file "thing".

****** First (main) file  ***********
; Program exempel AP20
;
; (c) 2004 Jan-Erik Söderholm Consulting AB
;
   list p=18f252, r=hex, c=100
;    

   #include "ap20.inc"         ;appl specific stuff...
   #include "ap20_config.inc"  ;__CONFIG settings

main_vars    UDATA_ACS          ;a couple of reg in access bank.
led_stat     RES 1              ; -"-
direction    RES 1              ; -"-

     extern   init_regs  ;label found in other file.
     extern   isr_start  ;label found in other file.

     global   led_stat   ;reg used in other file.
     global   direction  ;reg used in other file.
           
CODE_RESET    code h'0000'  ; Reset vector.
   goto START

CODE_ISR      code h'0008'  ; Interrupt vector.
   goto ISR_START     ; Jump to the main ISR (in another file)


CODE_MAIN    code
   
START

   call init_regs     ;call sub in other file.

; Sett ett startläge på dioderna.

   movlw    b'00010000'
   movwf    led_stat
   clrf     direction

MAIN_LOOP
       bra      MAIN_LOOP  ;loop forever, let ISR do the work...

 
   end

**** Second file (with the INIT_REGS label)  *******

   #include "ap20.inc"         ;appl specific stuff...

    global init_regs           ; have to export label
   
CODE3    code

init_regs                  ;just common setup...

   movlw   b'01111111'
   movwf   T2CON
   movlw        d'195'
   movwf   pr2
   clrf    RCON
   bsf     INTCON, GIE
   bsf     INTCON, PEIE
   bsf     PIE1, TMR2IE
   movlw    b'00000111'
   movwf    ADCON1
   clrf     ADCON0
   clrf     RCSTA
   movlw    PA_TRIS
   movwf    TRISA
   movlw    PB_TRIS
   movwf    TRISB
   movlw    PC_TRIS
   movwf    TRISC
   
   return
   
   end


***** Third file (with the ISR_START label)  ******

       #include "ap20.inc"        ;appl specific stuff...
       
       global isr_Start           ;have to export label
       extern direction           ;reg defined in other file
       extern led_stat            ;reg defined in other file

CODE_ISR_2  code

ISR_START

; Actual code removed...
; Not realy interesting, just "running LEDs"...


   bcf     PIR1, TMR2IF   ; Återställa TMR0 avbrotts
                            ; flaggan.

       retfie 1                 ; Return från avbrotts rutinen.

   end


**** End of code examples  ***

A few notes:
- Yes, I have mixed uppper and lower case, sorry...
- The code builds cleanly as-is, but that's it.
- A change in one file, makes that file to be re-assembled and
 then the linker i called.
- If "Build All" is clicked, all files are re-assembled and then linked.

Hope it helps.
Jan-Erik.
_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\08@141256 by Jan-Erik Soderholm

face picon face
Ken Pergola wrote :

> I just want to make sure that everyone understands that for beginners
> learning how to write code using the linker, you definitely
> can have one source file with MPASM in relocatable code mode.

Actualy, in the school project I'm currently involved with, all my
code examples are relocatable and uses *one* single source file.
Split source files might come into the "extra" section, I'll see...

> Please note  that I'm only advocating the use of one source file for
> beginners to *initially* get their feet wet with the linker.

He, they barely even know there is a "linker" somewere "under the hood".
I show them how to set up a new project in MPLAB, and the only
specific in a relocatable code project, is to include the LNK file.
They have no idea what so ever that there is something called "absolut mode".
I learn them how to program in assembler, and it just happens to be
relocatable code.

Yes, they have some problems understanding old F84 code from the net :-)

> If I were teaching someone, I would use one source
> file initially, and then once they start learning how to
> write code with the linker, I would then encourage them to think "bigger" and
> start to break out your source file into separate modules just like this thread
> title suggest.

Yes, and its *MUCH* easier to split a single file that already is written
with relocateble code, then to split a absolute mode file.


> But like I said previously, I'm not advocating one source file
> for relocatable code for the long term

Why not ? If it's simple enough ?

Best Regards,
Jan-Erik.
_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\08@145946 by Ken Pergola

flavicon
face

Jan-Erik wrote:


> Actually, in the school project I'm currently involved with, all my
> code examples are relocatable and uses *one* single source file.
> Split source files might come into the "extra" section, I'll see...

Sounds great Jan-Erik.


> I learn them how to program in assembler, and it just happens to be
> relocatable code.

Again, kudos to you for teaching them how to write code targeting the
linker. Your students are in good hands. :)


Ken Pergola wrote:

> But like I said previously, I'm not advocating one source file
> for relocatable code for the long term

Jan-Erik asked:

> Why not ? If it's simple enough ?

As long as there is no danger in the students thinking it is the "only way".
I guess it is important that the students are told when 'one file' and when
'multiple files' have "their place".

Sure, if the project is simple enough one file might be all you need. But
when the project gets more complicated and you code in a modular fashion,
get into local variables, objects, and encapsulation, multiple files are the
way to go in my opinion.

Best regards,

Ken Pergola


_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\08@151251 by Ken Pergola

flavicon
face

Jan-Erik wrote:

> But you miss the better speed you might get with "true" multiple
> source files. Remember that MPLAB only re-assembles those source
> files that have changed. That's is also the difference between
> the two buttons "Make" and "Make All" on the MPLAB toolbar.


Jan-Erik wrote:

I agree with this point, but let me add this:

There is one thing however that caught me off guard when I switched to using
the linker: longer compiling times when assembling the *entire project*
compared to the comparable *entire project* in absolute mode -- but that is
something I can live with.

I found compiling in absolute mode to be lightning fast. I have always been
assembling relocatable and absolute projects from within MPLAB IDE --
perhaps if I assemble the relocatable project using a MAKE file and command
line outside the IDE, it would be faster, but I have not played with that to
come up with any statistics.

In certain situations of course, as you suggest, the relocatable code will
assemble faster than the equivalent absolute code project because the way
MPASM works when it determines that some modules do not need re-assembling,
but I wanted to illustrate a 100% project assembling comparison (absolute
versus using the linker), to be fair and balanced -- at least that has been
my experience compiling from within the MPLAB IDE with a linker project and
its corresponding absolute counterpart.

Best regards,

Ken Pergola


_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\08@161357 by Jan-Erik Soderholm

face picon face
Ken Pergola wrote :

> ...perhaps if I assemble the relocatable project using a MAKE
> file and command line outside the IDE, it would be faster, but I
> have not played with that to come up with any statistics.

I would guess that that would not make any (major) difference. Your
external MAKE tool must still call the same MPASM and MPLINK
tools, and MPLAB does already the "MAKE-logic" for you. In what
way would an external MAKE tool "make" better ? You would have
to come up with smarter rules then MPLAB uses.

On the other hand, when I use Olins environment (that does a full
re-build as default), I rewrote Olins script to use a MAKE tool instead.
That speeded up the build of projects using Olins environment.

Jan-Erik.
_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\08@200639 by Ken Pergola

flavicon
face

Jan-Erik wrote:

> I would guess that that would not make any (major) difference. Your
> external MAKE tool must still call the same MPASM and MPLINK
> tools, and MPLAB does already the "MAKE-logic" for you. In what
> way would an external MAKE tool "make" better ? You would have
> to come up with smarter rules then MPLAB uses.


Hi Jan-Erik,

It's been fun conversing with you in this thread -- thanks for
participating. :)

Well maybe I made a wrong assumption. I assumed that people who assemble
outside MPLAB IDE use 'MPASM.EXE' instead of 'MPASMWIN.EXE'.

Since I assemble from within the MPLAB IDE, my feeling that made me surmise
in my last post was that assembling with the DOS-based versions of MPASM
outside MPLAB IDE would be faster than the GUI-based 'MPASMWIN.EXE' (all
other things like processor speed being equal), but I have no proof to know
for sure. There seems to be a lot of overhead in the MPASMWIN dialog box
opening, assembling, and closing for each .ASM file in the relocatable
project when you assemble them (as I've said before, I have not compiled and
linked outside the MPLAB environment).

I know for sure that MPLAB IDE invokes 'MPASMWIN.EXE' for assembling
purposes. In the older days, there used to be two DOS versions of MPASM:
'MPASM_DP.EXE' and 'MPASM.EXE'.


In my current MPLAB IDE v6.62 installation, I cannot find 'MPASM.EXE', but
MPLAB's online help for MPASM says the following:

=====
There are two executable versions of the assembler:

The windows version (mpasmwin.exe). Use this version with MPLAB IDE, in a
stand-alone Windows application, or on the command line. This version is
available with MPLAB IDE or with the regular and demo version of the MPLAB
C18 C compiler. This is the recommended version.

The command-line version (mpasm.exe). Use this version on the command line,
either from a command shell or directly on the command line. This version is
available with the regular and demo version of the MPLAB C18 C compiler.
====



Jan-Erik, let me ask you these questions:

1) It appears that the only way to get a current version of 'MPASM.EXE' is
to get it from the regular or demo version of MPLAB C18 C compiler? Has that
been you experience? (I'm going to check it out for myself after I finish
this message.)

2) What do you use to assemble your projects outside the MPLAB IDE: 'MPASM'
or 'MPASMWIN.EXE'?

3) If you do use 'MPASM.EXE' instead of 'MPASMWIN.EXE', have you compared
the assembling times to see which one is faster?


Best regards,

Ken Pergola





_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\08@202100 by John J. McDonough

flavicon
face
----- Original Message -----
From: "Jan-Erik Soderholm" <jan-erik.soderholmspamKILLspamtelia.com>
Subject: RE: [PIC]Splitting assemblies in to multiple files


> But you miss the better speed you might get with "true" multiple
> source files. Remember that MPLAB only re-assembles those source
> files that have changed. That's is also the difference between
> the two buttons "Make" and "Make All" on the MPLAB toolbar.

I'm not convinced MPLAB gets that right all the time, but I haven't tried to
nail the exact set of circumstances that gets it.  Sometimes, though, I know
MPLAB assembles more things than I think it should.

It does seem to me to be "easier" to use a makefile when building a library.
If nothing else, it clearly documents the relationships.  But that annoying
dialog box still pops up every time, so I'm not convinced it is necessarily
faster.

--McD


_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\08@232921 by Matthew Miller

flavicon
face
Hi Jan-Erik,

Thank you so much for this example! I won't change my current project from
being one file, but when I finish the project I want to pull out different
things (LCD routines especially) and keep them in one file for later
use. This example is a big help.

Thanks everyone for this interesting thread. Take care, Matthew.

--
"There is nothing so strong as gentleness, and there is nothing so gentle
as real strength."  -- St. Francis de Sales
_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\08@234209 by Ken Pergola

flavicon
face

Hello,

Well, this has been interesting. Apparently, it seems there should be a
currently released DOS version of MPASM (MPASM.EXE) out there somewhere but
I'm having a heck of a time trying to locate it. I currently have a post on
the Microchip Forums asking where I can obtain it.

=====

>From MPLAB IDE v6.62 'README.ASM' file

-----------------------------------------------------------------
Operating System Support List for v3.80.04
-----------------------------------------------------------------

MPASM.EXE is the command-line version of MPASM Assembler.  It is supported
by the following platforms:

Windows 3.1x   Windows 95     Windows 98     Windows NT
Windows ME     Windows 2000   Windows XP

=====

Has anyone been able to locate the file 'MPASM.EXE' v03.80.04? This should
be the currently released DOS version of MPASM.

Regarding the latest public release of MPLAB IDE v6.62:

I would have expected to see MPASM.EXE in the same directory as MPASMWIN.EXE
(v03.80.04). But it's no where to be found on my PC. Microchip does bundle
MPASM.EXE with the MPLAB C18 C compiler demo, but it's an old version
(v03.70.01).

Unless anyone knows where it is, I'll wait for an answer from the Microchip
Forums and post here.

Best regards,

Ken Pergola



_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\09@030047 by Rob Hamerling

flavicon
face


Ken Pergola wrote:

> In my current MPLAB IDE v6.62 installation, I cannot find 'MPASM.EXE'

You might find a good alternative at the GPUTILS site
(http://gputils.sourceforge.net/) for several platforms.

Rob.

--
Rob Hamerling, Vianen, NL phone +31-347-322822
homepage: http://www.robh.nl/

_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\09@030147 by Wouter van Ooijen

face picon face
> Well, this has been interesting. Apparently, it seems there
> should be a
> currently released DOS version of MPASM (MPASM.EXE) out there
> somewhere but
> I'm having a heck of a time trying to locate it. I currently
> have a post on
> the Microchip Forums asking where I can obtain it.

It used to be part of the MPLAB distribution, but I don't see it in the
latest MPLAB.

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products
docent Hogeschool van Utrecht: http://www.voti.nl/hvu



_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\09@062417 by Jan-Erik Soderholm

face picon face
Ken Pergola wrote :

> Well maybe I made a wrong assumption. I assumed that people
> who assemble outside MPLAB IDE use 'MPASM.EXE' instead
> of 'MPASMWIN.EXE'.

He, I didn't thought about that...
I had to look up my modified scripts from my Olin-installation,
and I do the following in my "makefile" (just the ASM parts...) :

asm             =  c:\Program\MPLAB IDE\MCHIP_Tools\MPASMWIN.EXE

and then :

%.o     : %.asm
       $(asm) /c- /q /o$@  $<

> There seems to be a lot of overhead in the MPASMWIN
> dialog box opening, assembling, and closing for each.

Well, I do not see any "dialog" box, just a small "status"
window with a temp scale style progress indicator. But maybe
that's what you ment !? We must be talking about a few ms's here, not ?
And for a reasonable large project, opening and closing that small
status box can't be that much overhead, IMHO. But I don't know
realy...


> There are two executable versions of the assembler:
>
> The windows version (mpasmwin.exe).   snip......
> *** This is the recommended version. ***

Well, that's all *I* have to know... :-) :-)

> Jan-Erik, let me ask you these questions:
>
> 1) It appears that the only way to get a current version of
> 'MPASM.EXE' is to get it from the regular or demo version
> of MPLAB C18 C compiler? Has that been you experience?
> (I'm going to check it out for myself  after I finish this message.)

I've no idea.

> 2) What do you use to assemble your projects outside the
> MPLAB IDE: 'MPASM' or 'MPASMWIN.EXE'?

See example above.


> 3) If you do use 'MPASM.EXE' instead of 'MPASMWIN.EXE', have
> you compared the assembling times to see which one is faster?

Nop.
I have a hard time to even find time to do any *real* work
on my projects... :-) :-)

Best Regards,
Jan-Erik.

_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\09@122759 by Ken Pergola

flavicon
face

Wouter van Ooijen wrote:

> It used to be part of the MPLAB distribution, but I don't see it in the
> latest MPLAB.

Hi Wouter,

Yeah, I know -- I'm not sure why it is not being distributed with MPLAB IDE
anymore, but I'll do my best to remember to post here in this thread when I
get an answer from the Microchip Forums.

In the meantime, I'll use the older MPASM.EXE and MPASMWIN.EXE on a fairly
large project to see how "wins" the assembling race. My bets are on
MPASM.EXE.

Best regards,

Ken Pergola


_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\09@122800 by Ken Pergola

flavicon
face

Rob Hamerling wrote:

> You might find a good alternative at the GPUTILS site
> (http://gputils.sourceforge.net/) for several platforms.

Hi Rob,

Thanks for your help and for the link. I'm specifically looking for
Microchip's latest DOS version of MPASM. I have a post on the Microchip
Forums asking where I can find it.

Best regards,

Ken Pergola


_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\09@122803 by Ken Pergola

flavicon
face

> Ken Pergola wrote:

> Well maybe I made a wrong assumption. I assumed that people
> who assemble outside MPLAB IDE use 'MPASM.EXE' instead
> of 'MPASMWIN.EXE'.


Jan-Erik Soderholm wrote:

> He, I didn't thought about that...
> I had to look up my modified scripts from my Olin-installation,
> and I do the following in my "makefile" (just the ASM parts...) :


Hi Jan-Erik,

Thanks for your feedback -- ok, I thought for some reason you guys used the
DOS version of MPASM to assemble projects outside of MPLAB IDE. Now I know
that you use MPASMWIN.EXE. I'm going to do a quick test and pit MPASM.EXE
versus MPASMWIN.EXE to see how the assembly times compare on a fairly large
project.


> We must be talking about a few ms's here, not ?

I'm curious why would you think it must be a few milliseconds?



Here are my results with assembling 18 .ASM files:
--------------------------------------------------

Assembling within MPLAB IDE v6.62:               57 seconds
(excluding the clean operation to be fair)
(excluding the linking stage to be fair)

Assembling outside MPLAB IDE using MPASMWIN.EXE: 36 seconds
(windows version of MPASM)

Assembling outside MPLAB IDE using MPASM.EXE:    30 seconds
(DOS version of MPASM)

The above results show that, as I had originally surmised, there is extra
overhead involved in assembling from within the MPLAB IDE.

Assembling outside the MPLAB IDE is faster that assembling inside the MPLAB
IDE.
Assembling using the DOS version of MPASM (MPASM.EXE) is faster than using
the Windows version of MPASM (MPASMWIN.EXE).

Once again, this has been *my* experience with my project. Your mileage may
vary.

Best regards,

Ken Pergola














Best regards,

Ken Pergola


_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\09@142549 by Jan-Erik Soderholm

face picon face
Ken Pergola wrote :

> Hi Jan-Erik,
>
> > We must be talking about a few ms's here, not ?
>
> I'm curious why would you think it must be a few milliseconds?

OK, a few hundreds of milliseconds then :-) :-)

{Quote hidden}

OK. So it's aprox 330 ms difference for each source file.
Personaly I can live with that.

Add to that that you have to add your own MAKE tool to the "outside"
examples to get the same features as inside MPLAB. No big deal,
but you now have a makefile to keep current also.

So it's a tradeoff between using what is actualy recomended and saving
6 seconds per build (on a full build on an 18 file project), if I
understand things correctly.

What you realy would need to know to decide on this, is *why*
Microchip recomends the MPASMWIN.EXE version over the
DOS version. Let's see if you get any reply on the Forums that
explains that also...

Best Regards,
Jan-Erik.
_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\09@153933 by William Chops Westfield

face picon face
On Oct 9, 2004, at 11:25 AM, Jan-Erik Soderholm wrote:

> What you realy would need to know to decide on this, is *why*
> Microchip recomends the MPASMWIN.EXE version over the
> DOS version.

Hopefully the win version supports long filenames.  8 character
filesnames
are *SO* 20th century; it has become noticeably painful when I try to
use
older software that doesn't allow long filenames!

BillW

_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\09@154759 by Dave VanHorn

flavicon
face

>
>Hopefully the win version supports long filenames.  8 character filesnames
>are *SO* 20th century; it has become noticeably painful when I try to use
>older software that doesn't allow long filenames!

It would also be nice if applications would go look and see what com ports are available, instead of insisting on using COM1/2 or maybe 1-4. Those ports are full up with older programs that can't deal with COM25.  

Thanks to Inside Out Networks, I have COM1-26, and everything above COM2 actually sits on my twisted pair LAN.  The applications that can deal with the higher com ports so far, have had no problems, and the whole thing is utterly transparent.


_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\09@162219 by Ken Pergola

flavicon
face

Jan-Erik wrote:

> So it's a tradeoff between using what is actually recommended and saving
> 6 seconds per build (on a full build on an 18 file project), if I
> understand things correctly.

No, it seems to me that you may have missed the bigger point I was trying to
make -- maybe I did not make myself very clear. The savings in seconds for
assembling outside MPLAB IDE is a lot more than that: a savings of 21
seconds or 27 seconds to be exact (depending on whether you assemble with
MPASMWIN.EXE or MPASM.EXE, respectively). Look at the results in my last
post again. Remember that I was *originally* talking about assembling from
*within* MPLAB IDE or *outside* MPLAB IDE. I made a guess thinking that
assembling outside MPLAB IDE would be faster, but you did not seem to be
convinced of that, and neither was I since I just had a hunch.

That's why I ran some tests to find out one way or another. Even if you
*don't* use the DOS version of MPASM (MPASM.EXE), the difference between
assembling from within MPLAB IDE and assembling outside of MPLAB IDE can be
significant depending upon your project at hand.

Then I just guessed that, when assembling outside MPLAB IDE, the DOS version
of MPASM would be faster than the Windows version of MPLAB -- it turned out
in my case that it is, but the difference is not as significant.

This was just a curiosity test and experiment -- nothing more. But I do feel
that running metrics is very important at times -- at least I know now. In
any event, I prefer the ease of assembling from within MPLAB IDE -- 21 or 27
seconds is not a deal-breaker as we all know that a 100% assemble will not
be happening all the time due to how 'Make' works in MPLAB IDE.


So in summary, there were two separate concepts I was talking about:

1) Assembling inside or outside MPLAB IDE
  I found that assembling outside is significantly faster with my test
project.


2) Who's faster when assembling *outside* MPLAB IDE: DOS MPASM or Windows
MPASM?
  I found that the DOS version of MPASM is faster than the Windows version,
but the difference is not that significant.


I hope this clears things up.


Best regards,

Ken Pergola


_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\09@163503 by Ken Pergola

flavicon
face

William Chops Westfield wrote:

> Hopefully the win version supports long filenames.  8 character
> filesnames are *SO* 20th century; it has become noticeably painful when I
try to
> use older software that doesn't allow long filenames!

Hi Bill,

I thought I was the only that felt this way. :) I'm glad I have company!
Seriously, I totally agree with you.

To answer your question, the Windows version of MPASM (MPASMWIN.EXE)
definitely supports long file names, but the DOS version (MPASM.EXE), does
not. I'm sure that is one of the reasons Microchip recommends MPASMWIN over
the DOS version of MPASM.

I just don't like to be limited to 8-character filenames either. In my test
that I posted in this thread, I had to coerce my long file names into short
ones so that the DOS version of MPASM version was happy.

Best regards,

Ken Pergola






_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\09@170419 by Jan-Erik Soderholm

face picon face
Ken Pergola wrote :

> Jan-Erik wrote:
>
> > So it's a tradeoff between using what is actually
> > recommended and saving
> > 6 seconds per build (on a full build on an 18 file project), if I
> > understand things correctly.
>
> No, it seems to me that you may have missed the bigger point...
>
> ...Remember that I was *originally* talking about
> assembling from *within* MPLAB IDE or *outside* MPLAB IDE.

Yes, you are right, I did. I got a bit tied up in the WIN or not-WIN
version of MPASM question. Sorry, my fault.

Regards,
Jan-Erik.

_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\09@171456 by piclist

flavicon
face
On Sat, 9 Oct 2004, Ken Pergola wrote:

> The savings in seconds for
> assembling outside MPLAB IDE is a lot more than that: a savings of 21
> seconds or 27 seconds to be exact

I just did a quick test on a C project consisting of 13 files.  It
took about 12 seconds to build with "make", and about 35 seconds to
build with MPLAB.  This is on a relatively slow system running Win 98.
Moving the same project over to a faster machine running XP, the
difference becomes about 3 seconds vs. 5 seconds.  Percentage-wise,
MPLAB appears to incur a huge penalty in project building.

--
John W. Temples, III
_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\09@183501 by Ken Pergola

flavicon
face

John W. Temples wrote:

> I just did a quick test on a C project consisting of 13 files.  It
> took about 12 seconds to build with "make", and about 35 seconds to
> build with MPLAB.  This is on a relatively slow system running Win 98.
> Moving the same project over to a faster machine running XP, the
> difference becomes about 3 seconds vs. 5 seconds.  Percentage-wise,
> MPLAB appears to incur a huge penalty in project building.

Hi John,

Thanks for your sharing your experiences with compile times on your C test
project.

I think I'll make a post on the Microchip Forums sometime in the future to
ask if there is anything they can do about this, since these differences are
so great in certain circumstances that some people are not using the IDE to
assemble or compile their projects. There might be something they can do to
improve build times, it's worth it to me to ask them (nothing ventured,
nothing gained).

I personally think people should not feel like they have to "jump ship" and
assemble or compile outside the IDE just to improve the build times. The IDE
just offers so many advantages like auto-refreshing the applicable memory
buffers after a build (program memory, data memory, configuration bits).

Best regards,

Ken Pergola




_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\09@195415 by William Chops Westfield

face picon face

On Oct 9, 2004, at 1:22 PM, Ken Pergola wrote:

> No, it seems to me that you may have missed the bigger point I was
> trying to
> make -- maybe I did not make myself very clear. The savings in seconds
> for
> assembling outside MPLAB IDE is a lot more than that: a savings of 21
> seconds or 27 seconds to be exact

You guys are SO spoiled.  We have a compile optimization team that
is really excited cause they reduced compile time for an image from
70 minutes to 30 minutes, or only 12 minutes using a farm of linux
build servers instead of a multi-cpu sparc machine...

BillW

_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\09@201655 by Ken Pergola

flavicon
face

William Chops Westfield wrote:

> You guys are SO spoiled.  We have a compile optimization team that
> is really excited cause they reduced compile time for an image from
> 70 minutes to 30 minutes, or only 12 minutes using a farm of linux
> build servers instead of a multi-cpu sparc machine...

Hi Bill,

Your quote above brought a big smile to my face. Yes, all things in life are
relative. :)

But it never hurts to try to improve one's situation though -- that's the
engineering spirit -- spot inefficiencies and try to improve them.

Best regards and thanks for the humor,

Ken Pergola

P.S. If it makes you feel any better, back in school I hand-assembled 8080A
code. :)
    So I do have a taste of the good old days. I like being spoiled better.
:)


_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\11@042851 by Alan B. Pearce

face picon face
>If anyone has any pointers I would be interested in them
>as well. The project I'm working currently is contained
>in one source file. Can anyone provide an example of a
>project (any size) that uses multiple source files?
>Or pointers to some good documentation.

Look at the example projects that Olin has using his development environment
at http://www.embedinc.com/pic/

_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\11@045024 by Alan B. Pearce

face picon face
>On the other hand, when I use Olins environment (that
>does a full re-build as default), I rewrote Olins script
>to use a MAKE tool instead. That speeded up the build
>of projects using Olins environment.

Hmm, don't remember it being terribly sluggish anyway, and I was using only
a 300MHz Pentium, but had sweet all else running on it. Maybe I was just
happy to sit back for a couple of minutes while it built. Never bothered me
that it did a complete build.

_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\11@052220 by Jan-Erik Soderholm

face picon face
Alan B. Pearce wrote :

> >On the other hand, when I use Olins environment (that
> >does a full re-build as default), I rewrote Olins script
> >to use a MAKE tool instead. That speeded up the build
> >of projects using Olins environment.
>
> Hmm, don't remember it being terribly sluggish anyway, and I
> was using only a 300MHz Pentium, but had sweet all else
> running on it. Maybe I was just happy to sit back for a couple
> of minutes while it built. Never bothered me
> that it did a complete build.

Well, one could just regard it as a "proof-of-concept" :-)
And I was modifying the scripts anyway  to better integrate
(or cooperate) with the "user-tool" interface in UltraEdit32.

It actualy becomed better integrated then MPLAB, since
I now can run Wouters Wisp628 tools from within the editor.
(Actuly, they are run from the same script that first runs Olins
tools. But it's a single "click" on a button in the toolbar
in UltraEdit32 anyway...)

Regards,
Jan-Erik.

_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\11@102050 by olin_piclist

face picon face
Jan-Erik Soderholm wrote:
> Well, one could just regard it as a "proof-of-concept" :-)
> And I was modifying the scripts anyway  to better integrate
> (or cooperate) with the "user-tool" interface in UltraEdit32.

I now have to do PIC development away from my usual office and hardware
setup.  Since 1988 I've been using the editor built into Apollos, but that
is not available at the other site.  I got a copy of UltraEdit based on many
recommendations I had seen, including yours.

UltraEdit seems to be a powerful tool, but it is also clear it will take a
while to get used to.  I have run into two issues in particular that there
must be a solution for, but I can't find it.

First, I can't get it to recognize the ".aspic" file name suffix (it calls
them "extensions" although that is not strictly correct for Windows).  I've
tried "aspic", "ASPIC", ".aspic", ".ASPIC", but nothing seems to work.  I
know it doesn't recognize the suffix because only the tab stops and the like
for "default" apply when I'm editing a .aspic file.  How do I make it
recognize the .aspic suffix so that I can set up separate settings for that
file type?

Second, I seem to be missing something in the way tabs work.  I want the TAB
key to advance to the next of an arbitrary list of tab stops, but insert
spaces to get there instead of TAB characters.  It seems I can only specify
arbitrary tab stops when using TAB characters.  These are entered into a
little window with the incremental distance between tab stops separated by
commas.  That seems to work.  However, when you tell it to use spaces
instead of TABs, it uses the setting in another little window that only
allows a single integer.  In other words, you can have arbitrary tabs stops
when using TAB characters, but when emulating TABs with spaces you can only
have tab stops at a fixed pitch.  This sounds too brain dead to be true.
What am I missing here?


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com
_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\11@120041 by Alan B. Pearce

face picon face
>First, I can't get it to recognize the ".aspic"
>file name suffix

I did not have a problem doing this. Let me have a look at my Ultraedit.

Right. Now under "Advanced/Configuration/File Types" enter the aspic
extension (without the full stop I believe) and associate it with the PIC
assembler type.


>Second, I seem to be missing something in the way
>tabs work.  I want the TAB key to advance to the
>next of an arbitrary list of tab stops, but insert
>spaces to get there instead of TAB characters.  It
>seems I can only specify arbitrary tab stops when
>using TAB characters.

Hmm, I know I set mine up to replace tabs with spaces, but have not tried
using arbitrary stops, I set mine to every 4 columns. Did this under
"Advanced/Configuration/Edit". Looks like it can be changed according to
file extension, but I have not tried that, just left it at "default".

_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\11@120813 by Jan-Erik Soderholm

face picon face
olin_piclist@embedinc.com wrote :

> Jan-Erik Soderholm wrote:
> > Well, one could just regard it as a "proof-of-concept" :-)
> > And I was modifying the scripts anyway  to better integrate
> > (or cooperate) with the "user-tool" interface in UltraEdit32.
>
> I now have to do PIC development away from my usual office
> and hardware setup.  Since 1988 I've been using the editor
> built into Apollos, but that is not available at the other site.
> I got a copy of UltraEdit based on many recommendations
> I had seen, including yours.

Well, I'm also *using* it, based on recomendations from others :-)

{Quote hidden}

It's not sure where you have made your changes.
I have added a "Microchip" section to the "wordfile.txt" file
that is in the \Program\UltraEdit directory. I have included a
copy of that section below. I have used Language #10 (the /L10
parameter). If "/L10" is already in use, you can select another
number or remove the current /L10 (if you don't need that "Language".

** If the file section gets mangled in the mail transfer, I can could ZIP it
and attach it instead ! **


As you can see, I have also entered the macros from your environment,
so they will be different color coded from the usual MPASM mnemonics.
(Not the latest version though...)

Note, if you'd like to modify this file, be sure to read up on the
docs for it. It's in the online help somewhere. The file is a bit "picky"
about such things as the order of the "words" under each heading.
I think it was something like that the lines must be in alphabetical
order and each line must only have keywords starting with the
same character.

The version included was based on a wordfile lacking PIC18
instructions (but with PIC17 instructions !). I have added
support fron the PIC18 instr set, but I'm not sure if it's
100% complete.


Another thing...
UE creates what it calls a "project" in the current directory, usualy
where your source file are. The project specifics are stored in a
*.PRJ file. Now, I have setup buttons on the toolbar i UE to call
the build scripts. Those buttons are stored in the PRJ file in the
[Tools] section like this :

[Tools]
Tool Cmd0="D01_make"
Tool Dir0="\embedinc\src\d01"
Tool Menu0="D01 Make"
Bitmap Path0=""
Show DOS Window0=0
Capture0=1
Capture Mode0=3
WinProg0=0
SaveAllFiles0=1
Save Active File0=1
Replace Type0=0

Instead of going through the menus, one can just add
such a section to the current PRJ file, and then either edit
directly in the file, or adjust the parameters in the menu
system later. Exit UE before doing any changes to the PRJ file.
If you already have made the "walk-thrue" of the menu system,
you could just as well add your "tools" using the dialogs there...


Another nice feature is that you can open the "wordfile.txt" file in
a special window in UE and add keywords on the fly. There is
a button to "reload" the wordfile live and any changes shows
at once in the currently open source code windows. Nice...
It also helps when testing out the syntax of the "wordfile".

{Quote hidden}

I probably havn't done that operation, but your description sounds
as what I'd expect from the tool.
I think you have a good point, but I have no solution...

Jan-Erik.


/L10"Microchip PIC Asm" Nocase Line Comment = ; File Extensions = ASM ASPIC INC
/Delimiters = ~!@$%^&*()-+=|\{}[]:;"'<> ,   .
/Function String = "%[a-zA-Z_]*"
/C1 ASSEMBLER DIRECTIVES
#DEFINE #INCLUDE #UNDEFINE
BANKISEL BANKSEL
CBLOCK CODE CONSTANT
DATA DB DE DT DW
ELSE END ENDC ENDIF ENDM ENDW EQU ERROR ERRORLEVEL EXITM EXPAND EXTERN
FILL
GLOBAL
IDATA IF IFDEF IFNDEF
LIST LOCAL
MACRO MESSG
NOEXPAND NOLIST
ORG
PAGE PAGESEL PROCESSOR
RADIX RES
SET SPACE SUBTITLE
TITLE
UDATA UDATA_OVR UDATA_SHR
VARIABLE
WHILE
__BADRAM __CONFIG __IDLOCS __MAXRAM
=
/C2 INSTRUCTION SET
addlw addwf addwfc andlw andwf
bc bcf bsf btg btfsc btfss
clrf call clrw clrwdt comf cpfseq cpfsgt cpfslt
decf decfsz dcfsnz daw
goto
incf incfsz infsnz iorlw iorwf
movf movlw movwf movff mullw mulwf negf
nop
rlcf rlncf rrcf rrncf retfie retlw return rlf rrf
sleep sublw subwf swapf setf subwfb
xorlw xorwf
tstfsz
** tblrd tblwt
/C4 PRE-DEFINED REGISTER LABELS
ADCON0 ADCON1 ADCON2 ADRES
CCP1CON CCP2CON CCPR1H CCPR1L CCPR2H CCPR2L CMCON
ECCPAS EEADR EECON1 EECON2 EEDATA
F FSR
GPIO
INDF INTCON INTCON2 INTCON3 IOC IOCA IPR1 IPR2
LCDCON LCDD00 LCDD01 LCDD02 LCDD03 LCDD04 LCDD05 LCDD06 LCDD07
LCDD08 LCDD09 LCDD10 LCDD11 LCDD12 LCDD13 LCDD14 LCDD15 LCDPS LCDSE
OSCCAL OPTION_REG OSCTUNE OSCCON
PCL PCLATH PCON PIE1 PIE2 PIR1 PIR2 PORTA PORTB PORTC PORTD PORTE PORTF PORTG PR2
PWM1CON
RCREG RCSTA RTCC RCON
SPBRG SSPADD SSPBUF SSPCON SSPSTAT STATUS
T0CON T1CON T2CON TMR0 TMR0L TMR1H TMR1L TMR2 TRISA TRISB TRISC TRISD
TRISE TRISF TRISG TXREG TXSTA
VRCON
W WPU WPUA WREG
/C5 PRE-DEFINED BIT LABELS
ADCS0 ADCS1 ADIE ADIF ADON
BF BO BRGH
C C1OUT C2OUT
CAL0 CAL1 CAL2 CAL3 CAL4 CAL5
CCP1IE CCP1IF CCP1M0 CCP1M1 CCP1M2 CCP1M3 CCP1X CCP1Y
CCP2IE CCP2IF CCP2M0 CCP2M1 CCP2M2 CCP2M3 CCP2X CCP2Y
CHS0 CHS1 CHS2
CKE CKP CM0 CM1 CM2 CIS CMIE CMIF CREN CS0 CS1 CSRC
DA DC
EEIE EEIF
FERR
GIE GO_DONE GPIE GPIF
IBF IBOV INTE INTEDG INTF IRP IPEN IRCF0 IRCF1 IRCF2 IOFS
IOC0 IOC1 IOC2 IOC3 IOC4 IOC5
LCDEN LCDIE LCDIF LMUX0 LMUX1 LP0 LP1 LP2 LP3
NOT_BOD NOT_GPPU NOT_PD NOT_POR NOT_RBPU NOT_RBWU NOT_TO NOT_T1SYNC
OBF OERR
P PA0 PA1 PCFG0 PCFG1 PCFG2 PEIE POR PS0 PS1 PS2 PSA PSPIE PSPIF PSPMODE
RBIE RBIF RBWUF RCIE RCIF RD
RP0 RP1 RW RX9 RX9D
S SE0 SE5 SE9 SE12 SE16 SE20 SE27 SE29
SLPEN SMP SPEN SREN SSPEN SSPIE SSPIF SSPM0 SSPM1 SSPM2 SSPM3 SSPOV SYNC
T0CS T0IE T0IF T0SE
T1CKPS0 T1CKPS1 T1IE T1IF T1OSCEN
T2CKPS0 T2CKPS1
TMR0IE TMR1CS TMR1GE TMR1IE TMR1IF TMR1ON TMR2IE TMR2IF TMR2ON
TOUTPS3 TOUTPS2 TOUTPS1 TOUTPS0
TRISE0 TRISE1 TRISE2 TRMT
TX89 TX9 TX9D TXD8 TXEN TXIE TXIF
UA
VGEN VR0 VR1 VR2 VR3 VREN VROE VRR
WCOL WR WREN WRERR
Z
/C6 SYMBOLS
+
,
-
/
<
>
/C7 MACRO EQUATES
ADDCF ADDDCF
B BC BNC BNDC BNZ BZ
COPYN COPY32 COPY24 COPY16 CLRC CLRDC CLRZ
LCALL LGOTO
MOVFW
NEGF
SETC SETDC SETZ SKPC SKPDC SKPNC SKPNDC SKPNZ SKPZ SUBCF SUBDCF
TSTF
/C8 OLINS MACRO OPERATIONS
ADD32 ADD24 ADD16
BANKADR BANKADRG BANKADRR BANKOF
DBANK DBANK? DBANKIF DBANKIS DEFRAM DTWORD DT32I
ENTER EXTERN_FLAGS EXTERN_IREGS
FP24 FP24ABS FP24NEG FREQ_INST FREQ_OSC FLAGS_CLEAR FLAGS_DEFINE FIFO_DEFINE FIFO_INIT
FIFO_SKIP_EMPTY
FIFO_SKIP_NEMPTY FIFO_SKIP_FULL FIFO_SKIP_NFULL FIFO_PUT FIFO_GET
GBANK? GBANKIF GBANKIS GCALL GCALLNR GCALLR GCALLWR GETF GETFZ GJUMP GLBENT GLBSUB
IBANK IBANK? IBANKADR IBANKIF IBANKIS IBANKOF INACCESSBANK INBANKED
INTR_OFF INTR_ON IREGS_DEFINE
JUMP
LEAVE LEAVEREST LOADK32 LOADK24 LOADK16 LOCENT LOCSUB
MCALL MCALLR MYPAGE
NEGATE N_IREGS NSEC_INST
POPREG POPREGS PUSHREG PUSHREGS
RBANK? RBANKIF RBANKIS REG
SETPAGE SETREG SHIFT32RL1 SHIFT32RA1 SHIFT32L1
SKIP_FLT SKIP_FLE SKIP_FEQ SKIP_FGT SKIP_FGE SKIP_FNE SKIP_ERR SKIP_NERR
SKIP_WLE SKIP_WGT SKIP_Z SKIP_NZ SKIP_CARR SKIP_NCARR SKIP_BORR SKIP_NBORR
SUB32 SUB24 SUB16
TESTFZ TMR0_PER TMR0_PRE TMR0_PSA TIMER0_SETUP_INTR TIMER0_USEC
TMR1_PER TMR1_POS TMR1_PRE TIMER1_SETUP_INTR TIMER1_USEC
TMR2_PER TMR2_POS TMR2_PRE TIMER2_SETUP_INTR TIMER2_USEC
UART_BAUD UART_SETUP UNBANK
VAL_BAUDCTL VAL_RCSTA VAL_SPBRG VAL_TRIS VAL_TXSTA VAL_PORT
W_TRASHED WAITNOP

_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\11@145229 by olin_piclist

face picon face
Jan-Erik Soderholm wrote:
> It's not sure where you have made your changes.
> I have added a "Microchip" section to the "wordfile.txt" file
> ...

I'm not in front of the system with UltraEdit on it.  I'm saving your's and
Alan's responses to study at that system tomorrow.  Thanks for your help.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com
_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\11@154835 by Jan-Erik Soderholm

face picon face
olin_piclist@embedinc.com write :

> Jan-Erik Soderholm wrote:
> > It's not sure where you have made your changes.
> > I have added a "Microchip" section to the "wordfile.txt" file
> > ...
>
> I'm not in front of the system with UltraEdit on it.  I'm
> saving your's and Alan's responses to study at that system tomorrow.
> Thanks for your help.

I hope it will be of any/some help.
Just a few notes...

I think I might have mixed up the extension handling with "keyword
highlighting" in my reply. The extension handling (that you asked about)
might not be depending on the "wordfile.txt" file after all...

I currently have "UE32 Prof Version 10.00c". If you have a later
(if any) version, there might be differences I don't know about.

Regards,
Jan-Erik.
_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\12@043023 by Alan B. Pearce

face picon face
>As you can see, I have also entered the macros from your
>environment, so they will be different color coded from
>the usual MPASM mnemonics. (Not the latest version though...)

I did that too. Still need to update mine to the latest version on Olins
macros.

>Note, if you'd like to modify this file, be sure to read
>up on the docs for it. It's in the online help somewhere.
>The file is a bit "picky" about such things as the order
>of the "words" under each heading. I think it was something
>like that the lines must be in alphabetical order and each
>line must only have keywords starting with the same character.

I have had that problem as well. Every so often it just seems to get its
knickers in a twist, and ends up with some hidden characters that mess up
the rest of the highlighting in that section. Fix seems to be to open the
file in UE, and fiddle with it, while viewing it highlighted as itself.

>The version included was based on a wordfile lacking PIC18
>instructions (but with PIC17 instructions !). I have added
>support fron the PIC18 instr set, but I'm not sure if it's
>100% complete.

I think this portion could do with a major re-organisation, as it is
obviously quite old. It needs to be relabelled as "12 bit core", "14 bit
core" and "16 bit core" to reflect the modern families. Then perhaps a copy
could be passed back to UE for posting on their web site.

_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\12@063742 by Mcgee, Mark

flavicon
face
Hi I've just got back to work, and read this email

Very useful, thank you.

Cheers,
Mark

{Quote hidden}

==============================================================================
This message is for the sole use of the intended recipient. If you received
this message in error please delete it and notify us. If this message was
misdirected, CSFB does not waive any confidentiality or privilege. CSFB
retains and monitors electronic communications sent through its network.
Instructions transmitted over this system are not binding on CSFB until they
are confirmed by us. Message transmission is not guaranteed to be secure.
==============================================================================

_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\12@075934 by Jan-Erik Soderholm

face picon face
Alan B. Pearce wrote :

[About the wordfile in UE...]

> Still need to update mine to the latest
> version on Olins macros.

Me to. So little time... :-)

> I think this portion could do with a major re-organisation, as it is
> obviously quite old. It needs to be relabelled as "12 bit
> core", "14 bit core" and "16 bit core" to reflect the modern families.

Now, I seems to remember one problem I run into. It was the
instructions with non-A->Z charcters as TBLxx instructions
(" TBLRD*+ " as an example).

I don't think I found a solution to that. Did you ?

I think that UE thought that the "*" was an delimiter or
an operator or something...

Jan-Erik.
_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

More... (looser matching)
- Last day of these posts
- In 2004 , 2005 only
- Today
- New search...