Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About JJHawg

  • Rank
  1. I am trying to have the methods of a statically declared object assemble at a certain address, to avoid crossing page boundries, and nothing I try works. Can this be done? Thanks, Jim
  2. I found out that the compiled code doesn't always work when it wraps a page boundry, so I used the "func() @ 0x200" to start the compiling in another page. My question is, "how do I know the order of file compiling so I can do this efficiently?" Also, it there a way to set the page for the built-in library code, like the "delay_xx()" functions? Thanks, Jim
  3. I am having problems with the compiler not creating "bank" instruction when it should. The problem occurs when I use up all the global registers with my own hard-addressed variables. The compiler does not include a "bank" instruction before it uses the "_code_tempxxx" variables. I don't always need to use up all of the global registers for my own variables, but shouldn't the compiler figure this out? Thanks, Jim
  4. Has anyone actually sucessfully created a .lib file using any of these compilers? I recall seeing some posts about it here a few years ago, but nothing since. I have tried doing it from the IDE, and command line with no success. When I try to include the new lib file in a project it complains about it being corrupt. One potential problem with creating a library file is that none of the code in the source file is actually called by anything, and it might optimized out. Of course, if you turn on the flag to keep code that isn't used, you get a ton of stuff that isn't needed. I
  5. Thanks for the quick reply... I tried this again today with the same results: Create a folder for testing, and copy a .cpp (or other) file into it. From the "Edit" menu, select "Replace in Files" On the dialog: Look in: Browse to the desired directory For files named: *.* Set the find/replace strings as desired. When I click "Replace", everything is turned upper case, except my particular replace string, which happened to be lower case. I just tried it again with another file (*.h) with the same results. Like I said before, the is version 5.8 as stated i
  6. I am using SourceBoost IDE 5.8, and just used "Replace in Files", and was a little "surprised" to find that in the file where my replace string was found, all of the text was converted to UPPER CASE. I tried this in another small test file and it seems to be repeatable. Otherwise, I am having pretty good luck with the IDE. Got to go now and retype 200+ lines... Thanks.
  7. Hi there. I don't have time for the long version right now, but I suspect that your difficulty is caused by not using the Mode register properly. Here is how I set the tristate mode (direction) for port B asm mov m, 0xff asm mov !RB, _TrisImage Moving the 0xff into "m", mode register, directs the mov !Rx instruction to the tristate control register. You set the mode register to different values depending upon which control register you want the mov !Rx instruction to modify. Check the SX datasheet for details. The default value of the mode register is 0xff
  8. Here is one approach that popped into my head. I have tested a few values with it, but can't guarentee that it will work in all cases... The only time that the sum will be less than either (both?) of the source operands will be if there is an overflow. So, here is one way you might code it: short temp_sum; temp_sum = shortA + shortB; if ( (temp_sum < shortA) || (temp_sum < shortB) ) { shortA++; } See what happens... ;-) Jim
  9. It would be helpful to see the context of this code; what you are really trying to accomplish. ... The value of a 16 bit integer can never be greater than 0xffff ... Jim
  10. I have encountered problems similar to the one you describe, and it usually turned out that the problem was really somewhere before the indicated error line. That is why commenting lines simply moves the indicated error line. The compiler reports the error where it does because it is the first place that it _notices_ the error, not always on the line that is actually causing the error. Usually it is some difficult-to-find, silly mistake that I made. One place to look is inside any "asm{}" blocks that you have. I have sometimes had syntax problems inside these. I don't k
  11. You have to read the entire port, then isolate the pins you care about; for instance: char gpio @ 0x05 char SwitchPort @ 0x05 //different name for same port... //Set up bit masks for the inputs. #define SWITCH_1 0x01 #define SWITCH_2 0x02 #define SWITCH_3 0x04 void main(void) { char Temp; while(1) { //Grab a snapshot of the port. Temp = SwitchPort; //This assumes that the internal pull-up resistors //are turned on and the switches go to ground. if ( (Temp & SWITCH_1) == 0 ) { //Do switch one stuf
  12. I have not used the chip you mention, but your problem may be as simple as creating your own variables that represent the port, like: char gpio @ 0x05; //gpio port char trisio @ 0x85; //gpio i/o select char wpu @ 0x95; //gpio weak pull-up select void main(void) { char x; x = gpio; //read the port } Give this a try, hopefully it will help. Jim
  13. 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
  14. 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
  15. This reply is a little late, but it may help someone else... I had this same problem, even with all the latest and greatest stuff, because I didn't install the plugins in the same directory as PicAnt.exe. When I installed them in the correct directory everything was fine. Jim
  • Create New...