How to built a modular softwar project in CW

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to built a modular softwar project in CW

6,019 次查看
Truk
Contributor I
I am a greenhorn with the CW. Until now, I have written my software (all were small projects) in a DOS enviroment, all in assembler.
Can sombody mail to me an structured example in assembler written in the CW where I can see how I have to build the software project?
标签 (1)
0 项奖励
回复
11 回复数

2,585 次查看
glork
Contributor I


Truk wrote:
I am a greenhorn with the CW. Until now, I have written my software (all were small projects) in a DOS enviroment, all in assembler.

Can sombody mail to me an structured example in assembler written in the CW where I can see how I have to build the software project?





Hi Truk.
I do all my programming in assembly in CW. If you will tell me which processor and which version of CW I will try to guide you.
ron
0 项奖励
回复

2,585 次查看
Truk
Contributor I
My CW is V5.1 Spc.Edition for S08
My Prozessor MC9S08AW16CFG.
Software is for an existing Unit with MC05P6 which has to be rebuild
I would like to adjusting some files to the S08 with a better structure than in the 10 years old software.
If you can give to me the framework with all INC and so on to write a good structured programm it will be very helpfull to me.
0 项奖励
回复

2,585 次查看
glork
Contributor I
Hi Truk.
It may turn out that I can't help you if you intend to use INClude files, etc. I only ever use absolute assembly, 1 file, no includes, no external ref.....

CW5.x is a bit difficult to set up for absolute assembly but I do have the roadmap somewhere. However, I do need to know if you want absolute assembly or the messy kind.
ron
0 项奖励
回复

2,585 次查看
Truk
Contributor I
No I would't write the Software absolute, because I will break the Program in handable files with tables together in sections and so on. I have try this in a ST7LITE-Project also (with ST7-Software enviroment) but I have troubles with the variables, so for debugging (absolute) I must put all routines which I would debug together in one big file. Therefor I have always to lo look at the section boarders because I have 8 256-Byte table-sections.
0 项奖励
回复

2,585 次查看
peg
Senior Contributor IV

I'm no CW expert at all but...

Absolute assembly does _not_ preclude the use of include files.

Includes are just a way of breaking your "1 big file" up into smaller ones. They are all chained together again upon assembly.

I seem to remember some one looking for the AW header or inc file recently

Regards David

Yes it was the OP asking here:

http://forums.freescale.com/freescale/board/message?board.id=8BITCOMM&message.id=1883

Message Edited by peg on 2006-07-06 08:55 AM

0 项奖励
回复

2,585 次查看
Truk
Contributor I
the problem with the INC-File I could solve. I have choosen the MC9S08AW32 - File from the "device Initialisation" and edited it to met specifications of the MC9S08AW16.
0 项奖励
回复

2,585 次查看
glork
Contributor I


peg wrote:


I'm no CW expert at all but...


Absolute assembly does _not_ preclude the use of include files.


Includes are just a way of breaking your "1 big file" up into smaller ones. They are all chained together again upon assembly.


I seem to remember some one looking for the AW header or inc file recently


Regards David


Yes it was the OP asking here:


http://forums.freescale.com/freescale/board/message?board.id=8BITCOMM&message.id=1883

Message Edited by peg on 2006-07-06 08:55 AM





Yes, it may be possible to use multiple files in absolute assembly, and there may exist some strange twisted universe in which it actually makes sense to do so. But not in the one I occupy.

It has been my understanding that an INC statement invoked the linker which isn't supposed to run in 'absolute' mode. I believe that one of the freescale cw people put something to that effect in a response to one of my requests.

Anyway, if he is looking for a 'linked' setup I will bow out. I'm just not interested in that.
cheers, ron
0 项奖励
回复

2,585 次查看
peg
Senior Contributor IV

In this other universe the aliens might be:

Reusing code modules in other projects

Doing conditional assembly to suit different hardware variants

Easing the burden of version control over these variants

Not having to scroll for miles through one file trying to find what you are looking for instead of opening the ISR file to find a particular ISR for example.

I used to do it all in one file, but now the file I throw at the assembler has only comments, version notes and include statements in it. I will never go back!

Regards David from planet Earth.

 

0 项奖励
回复

2,585 次查看
glork
Contributor I


peg wrote:

In this other universe the aliens might be:


Reusing code modules in other projects


[ron] 'cut-n-paste' editors are your friend.

Doing conditional assembly to suit different hardware variants


[ron] The proper documentation of this technique is inevitably more complex than simply having different firmware versions per hardware variant.

Easing the burden of version control over these variants


[ron] See above.

Not having to scroll for miles through one file trying to find what you are looking for instead of opening the ISR file to find a particular ISR for example.


[ron] Using the handy 'find' function within a single file is easier than having to call up a whole 'nother file to find something in.

I used to do it all in one file, but now the file I throw at the assembler has only comments, version notes and include statements in it. I will never go back!


Regards David from planet Earth.







It probably all comes down to taste and training.

In any case the answer to Truk's original question lies within this app note: tn245.pdf (sorry, didn't learn how to post a link)
Regards, ron
0 项奖励
回复

2,585 次查看
bigmac
Specialist III

Hello all,

With absolute assembly there is no restriction on the number of files that may be INCLUDEd, and you may also nest includes (include files may be referenced within an include file).  The primary difference is that absolute assembly code defines its location in memory using ORG directives, whereas relocatable assembly uses SECTION directives to define code location.  For absolute assembly, the programmer also needs to ensure that there is no overlapping of the various code sections in different parts of the program.

Another difference is that, for absolute assembly, since all addresses are known during the assembly process, the linker is not required, and an S19 file can be directly generated by the assembler.  However, I think this may require that the assembler program be used alone, and not called from within the CW IDE.

When using the assembler program alone, the formalised, and rather complex CW project directory structure is not necessary.  Note that the simulator/debugger tool can also be use alone.

I assume that Truk's earlier assembly projects would have used absolute assembly.

Regards,
Mac

 

0 项奖励
回复

2,585 次查看
Truk
Contributor I
I have made a Project with ST7Lite with INCLUDE-Files without ORG-statement. But for debugging, I have to link all files which I would like to debug in 1 big file because I have troubles with the variables.
0 项奖励
回复