Search found 8 matches

by andrixnet
25 Jan 2013 23:13
Forum: mikroC PRO for PIC General
Topic: MikroC device support
Replies: 1
Views: 1111

MikroC device support

I am working a new project that involves PIC10F322 and PIC12F1501. I found a discrepancy between MikroC 5.61 and MikroProg 2.26. MikroProg supports 10F200, 202, 204, 206, 220, 222 but not 322 (which I need). MikroC however cannot create a project with any 10Fxxx PIC because it is simply missing from...
by andrixnet
05 Oct 2012 00:35
Forum: mikroC PRO for PIC General
Topic: bit variables and optimization
Replies: 1
Views: 1069

bit variables and optimization

Consider this code : unsigned short i; i^=0x08; i.B6^=1; with zero level optimization expands to : ;test-def.c,20 :: i^=0x08; 0x001E 0x3008 MOVLW 8 0x001F 0x06A3 XORWF main_i_L0, 1 ;test-def.c,21 :: i.B6^=1; 0x0020 0x1B23 BTFSC main_i_L0, 6 0x0021 0x2827 GOTO L__main3 0x0022 0x2825 GOTO L__main5 0x0...
by andrixnet
25 May 2012 12:58
Forum: mikroC General
Topic: How to make "SWAPF" assembler code
Replies: 5
Views: 3628

Re: How to make "SWAPF" assembler code

Also, this works : char some(char param) { asm { SWAPF FARG_some_param,f } return param; } However, it is not portable enough. I would've liked to write a macro to go around the wasteful swap() as described here . Something that would work if called from anywhere, regardless if it's main() or anothe...
by andrixnet
25 May 2012 12:56
Forum: mikroC Wish List
Topic: swapf() macro
Replies: 4
Views: 6542

Re: swapf() macro

I would like to report a bug in MikroC for PIC.

swap() is documented as a macro, but code is generated as a function with all due overhead, instead of a single SWAPF instruction.
by andrixnet
26 Apr 2012 18:13
Forum: mikroC General
Topic: swapf command in MikroC?
Replies: 2
Views: 1951

Re:

eddyb wrote:

Code: Select all

x=(x<<4&0xF0)|(x>>4&0xF)
Yes, this is the C way of writing it, but compiles to about 29 instructions ...
by andrixnet
26 Apr 2012 18:11
Forum: mikroC Wish List
Topic: swapf() macro
Replies: 4
Views: 6542

Re: swapf() macro

Compiler v4.60 lists this in the help : Swap Prototype char swap(char input); Returns Swapped nibbles of the input byte. Description Function swaps nibbles of the input parameter. This is an “inline” routine; code is generated in the place of the call, so the call doesn’t count against the nested c...
by andrixnet
26 Apr 2012 18:03
Forum: mikroC General
Topic: How to make "SWAPF" assembler code
Replies: 5
Views: 3628

Re: How to make "SWAPF" assembler code

This code does not compile : void main() { char x; x=0x53; asm { SWAPF _x,f } } Compiler says undeclared identified _x By analogy, I tried to use this from help, also suggested here in this thread : if you have a global variable "g_var", that is of type long (i.e. 4 bytes), you are to access it like...
by andrixnet
12 May 2011 17:31
Forum: mikroC PRO for PIC General
Topic: EEPROM Initial values
Replies: 2
Views: 2374

Re: EEPROM Initial values

Under MPASM one could do the following to predefine EEPROM content : ORG 0x2100 DE B'01011010' ; comment 1 DE D'1' ; comment 2 DE 0xAB ; comment 3 Is there a similar way in MikroC to define the contents of the on-board EEPROM? While the EEPROM editor is a neat tool, it does not support comments rega...

Go to advanced search