Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Mac

  • Rank

Contact Methods

  • Website URL
  • ICQ

Profile Information

  • Location
    Michigan, USA

Recent Profile Visitors

888 profile views
  1. Is there a way to duplicate an assembly language macro that I use to store constant strings inline with my code? The putstr() function pulls the return address (the string address in this case) from top-of-stack, sends the string while updating TOS, and returns to the instruction immediately following the inline string. Here's the assembly language version I'm trying to duplicate; putstrg macro string ; in-line rom string call putstr ; inline string print function dt string,0 ; inline string endm ; Here's
  2. Unlimited number of constant offsets with + and - operations can be used in assembly operands. What kind of expressions are you looking for? Regards, Pavel Hi Pavel, Hoping for reasonable operand expression evaluation that you would expect from any decent assembler implementation; Cheerful regards, Mike #define tStep 2 // 1-usec (2 cycle) tStep time .... asm { movlw 2*tStep-2 // 2T minus 2 cycles .... movlw 50/4 // 50 cycles/4 cycle loop time }
  3. We still need to compile all the changes. From the top of my head here are some: Support for multiple projects in a workspace Much better debugger (it can evaluate much more complex expression) Support for multiple plugin instances (minimal changes to plugin API) Optional parallel compilation Build server Optional support for big arrays and data objects(bigger that 256 bytes) Support for bit and bool return types Support for PIC16F1x architecture and instruction set Code generation and compile time are mostly unchanged. We work on a new compiler core that will change those.
  4. Could you use something like this? char fraction() { fract &= 15; fract *= 10; return(fract>>4|"0"); } whole = reading >> 7; fract = (reading >> 3) & 0xF; if (!positive) { serial_printf('-'); } else { serial_printf('+'); } serial_print_dec(whole); serial_printf('.'); puts(fraction()); // "0625", "1250", etc... puts(fraction()); puts(fraction()); puts(fraction());
  5. Using MPLAB v8.5 IDE and BoostC v6.97 and when I add an instruction using the modulo '%' operator I get the following error; Error: Unresolved external function:'__rem_8_8(unsigned char,unsigned char)' Error: Unresolved external function:'__rem_8_8(unsigned char,unsigned char)' Error: Unresolved external function:'__rem_8_8(unsigned char,unsigned char)' Error: Unresolved external function:'__rem_8_8(unsigned char,unsigned char)' Error: Unresolved external function:'__rem_8_8(unsigned char,unsigned char)' Error: Unresolved external symbol, function:__rem_8_8 What other file should
  6. Hi David, Your method worked and so I went back and tried again using MPLAB "project wizard" and that worked as well. Thank you for your time and kind consideration. Kind regards, Mike McLaren, K8LH
  7. Hi edeca, Your article is very nice. Only complaint is your program listing with gray text on black background is very difficult to see. I posted a PIC SPBRG Calculator program many years ago on Forum.Microchip that you might find handy for evaluating which BRGH and BRG16 settings produce the best bit rate error; Revised SPBRG Calculator. Kind regards, Mike, K8LH
  8. Using MPLAB 8.50 IDE with BoostC 6.97 (free/lite) and getting the following errors trying to compile a simple program for 16F1936; // // compiler evaluation for "enhanced" mid-range 16F1936 // #include <system.h> #pragma DATA _CONFIG1, _FOSC_INTOSC&_WDTE_OFF&_IESO_OFF&_FCMEN_OFF #pragma DATA _CONFIG2, _PLLEN_OFF&_LVP_OFF #pragma CLOCK_FREQ 16000000 void main() { osccon = 0b01111010; // 16-MHz INTOSC while(1) { // } } MPLAB generates the following dialog; "Failed to load C:\Development\PIC Projects - Boost C\16F1936 test.COF." And here's w
  9. Gentlemen, is there a way to duplicate the function of this cycle accurate fixed delay assembler macro in BoostC, please? ; ; in-line fixed delay macro, 0..1027 cycles, 14 bit core ; clock equ 8; 8-MHz usecs equ clock/2; cycles/usec multiplier tStep equ 1*usecs; 1T "step" time inDlyCy macro delay; generates 0 to 7 instructions local loop if delay > 3 movlw delay/4-1; loop addlw -1; borrow? (4 cycle loop) bc loop; no, branch, else, fall thru' endif if delay%4 >= 2 goto $+1; delay%4 == 2 or delay%4 == 3 endif if delay%4 & 1 nop; delay%4 == 1 or del
  10. I tried to use LOW(0x1000) and HIGH(0x1000) or 4096%256 and 4096/256 assmebler operands after locating my rom character table at 0x1000 in Flash using #pragma DATA directives and still "go joy". It seems that instead of building a good compiler around a full featured assembler that the assembler was more of an after thought. The assembler lacks any operand expression evaluation, won't use the LOW() and HIGH() operators for example, doesn't allow access to address of labels, and the list goes on... By comparison the assembler in Swordfish BASIC is a good example of what the assembler i
  11. Just wondering if I've run into another assembler shortcoming? Is there any way to use the address of a const rom char "table" in my assembly code? typedef unsigned char u08; // 8-bit #define r08 const rom unsigned char // // rom character array // r08 font[] = { 0b01110000, // "0" 0b10001000, // 0b10011000, // 0b10101000, // 0b11001000, // 0b10001000, // 0b01110000, // 0b00100000, // "1" 0b01100000, // 0b00100000, // 0b00100000, // 0b00100000, // 0b00100000, // 0b01110000 }; // //--< fun
  12. Piece of cake: volatile unsigned short ccpr1 @ 0xFBE; ccpr1 = 2400; Regards, Pavel Ah, thank you...
  13. I'm just looking for the same capability that I get with MCC18. Being able to access register pairs as CCPR1, CCPR2, INDF0, and FSR0 seems very clean and intuitive (to me). Kind regards, Mike
  14. I see a definition for 'ccpr1' in the '2620 header file but I can't seem to use it as a 16-bit 'INT'. What am I doin' wrong Gentlemen? unsigned int match = 2400; ..... ccpr1 = match; // <-- error match <<= 1; //
  • Create New...