AnsweredAssumed Answered

CodeWarrior 8- and 16-bit tools: Mixing C and Assembly - Sample project

Question asked by Marc Paquette Employee on Jan 27, 2006
To help you find solutions to problems that have already been solved, we have posted this message. It contains an entire topic ported from a separate forum. The original message and all replies are in this single message.
Posted: Nov 10, 2004 - 11:41 AM   
For those interested in how to correctly build a project that includes both C and assembly, I have built a test project to demonstrate the procedure. You can download it from here:
This project requires CW for HCS08 version 3.x to build properly, although if you are using an older version or the HC12 tools you can still look over the source code and modify it to suit your needs.
//* This project is meant to demonstrate how to properly mix *
//* C and assembler files, with the C file calling functions *
//* defined in an assembler file, and the assembler file *
//* making use of variables declared in a C file. *
//* Multiple targets have been included to accomodate the *
//* widest possible user base as possible. If the GB60 demo *
//* board hardware is not available to you, use the simulator *
//* target. *
Mario Guerra
Metrowerks Developer Support

Posted: Sep 11, 2005 - 07:27 PM   
Mario: Could you please post your example again, on how to mix c and assembly?
Really, all I want to know how to do is to enter assembly code into Code Warrior. Sorry, but I don't know C.

 Posted: Sep 12, 2005 - 12:15 PM   

Sorry but that file is gone and so is Mario. I think it may be on one of the examples, or something similar. Did you look at those, if you don't have them download the examples and manuals.
Ron Liechty
Ombudsman for Metrowerks

Oct 03, 2005 - 06:33 PM
Hi rb
you can to write assembled in codewarrior using:
//here you write your code in assembled