Jump to content
Sign in to follow this  
JJHawg

RE: Assembler include file...

Recommended Posts

I use different assembler directives for each project I am

working on.  However, it seems that PicAnt always selects

the include file according to the target selected, even if

I manually change it for a given project.

 

The bottom line is that I would like some way to set assembler

directives (DEVICE, FREQ, IRC_CAL, etc) for each project.

It can be from inside the cpp code or an include file, either

way would be fine.

 

If there is already a way to do this, please advise.

 

Thanks...

BTW: I am liking the new version...

Share this post


Link to post
Share on other sites
Guest Pavel

Have you tried the asm operator in C code? Something like:

 

//Define device config block
asm
{
list p=PIC16F877
__config H'3FF9';XT,!CP,!WDT,!PWRT,BODEN,LPV,!CPD,WRT,!DEBUGGER
}

 

Regards,

Pavel

Share this post


Link to post
Share on other sites

Thanks for the reply.

 

I have tried something like what you suggest, but I think

the assembler built into the IDE gets upset because it

doesn't recognize the codes.  The nice thing about using

the .inc file is that the built in assembler doesn't look at it.

 

I am using the latest SXKey program that wants

these directives:

 

asm

{

  DEVICE   OSC4MHZ, TURBO, OPTIONX, STACKX

  FREQ      4_000_000

  IRC_CAL  IRC_4MHZ

}

 

Any hints you can provide will be appreciated.

 

Jim

Share this post


Link to post
Share on other sites
Guest Pavel

If compiler complains about unknown opcodes and you are sure that these are not instruction opcodes than it's safe to ignore these warnings.

 

Regards,

Pavel

Share this post


Link to post
Share on other sites

Thanks for the reply...

 

When I compile a program with the directives as shown

above, I get the following output:

 

Compiling...

 

C:\PROGRA~1\PicAnt\c2cpp.exe -PSX28AC -SRC -ols -md -O0 -W2 -IC:\PROGRA~1\PicAnt\Include\pSX28AC.inc -oC:\PROGRA~1\PicAnt\Projects\DUALCH~1\DualChannel.asm  ROTARY~1.CPP System.cpp Zone.cpp DUALCH~1.CPP

 

C2C++ 5.1e C/C++ compiler  Copyright© 1998-99,2000-2003 by Pavel Baranov

support@picant.com

(Extended version)

 

Licensed to: Jim Greenhaw

 

 

ROTARY~1.CPP

System.cpp

Zone.cpp

DUALCH~1.CPP

C:\PROGRA~1\PicAnt\Lib\cppSX.lib

Warning in a library: Possible truncation to 8-bit

Warning: The function '___compress' was not called. Code generation skipped

Warning: Variable '_c_MinuteTick' is not used. Ram allocation skipped

asm error: Non-native Scenix assembler found: ret

DEVICE OSC4MHZ, TURBO, OPTIONX, STACKX

 

Finished.

Done

 

Failed

 

----------------------

 

This is a real error that doesn't create a .asm file.

 

The "asm" operator is nice because you can reference C code

variables there.  Maybe there could be a "literal_output"

operator that just copies its contents to the output file....

 

----------------------

 

Here is something that I just tried, it might be the solution.

In my PSX28AC.INC file I added this line:

 

  INCLUDE 'Setup.inc'

 

In my project directory I created a Setup.inc file that has

the directives I need.  The compiler puts the INCLUDE in the

output file, and the assembler picks up the actual file.

 

So, this is an acceptable solution, for me anyway... ;-)

 

Thanks looking into this...

 

Jim

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...