C icon with asm code
Moderator: Benj
- Bachman
- Posts: 116
- Joined: Sun Sep 07, 2014 11:37 am
- Location: Hungary
- Has thanked: 9 times
- Been thanked: 53 times
Re: C icon with asm code
Because nothing to optimise on a simple instruction and doesn't matter, what you're using, C or ASM.
or
or
Code: Select all
_asm
sleep
_endasm
Code: Select all
asm("sleep");
Code: Select all
_asm sleep _endasm
- psf
- Posts: 45
- Joined: Mon Jun 25, 2007 9:44 pm
- Location: Italia
- Has thanked: 6 times
- Been thanked: 2 times
Re: C icon with asm code
_asm
movlw 0x88
movwf _intcon
movlw 0x06
movwf _ioc
sleep
nop
_endasm
809: _asm
^ (195) expression syntax
EXAMPLE.c:
921: mainendloop: goto mainendloop;
^ (374) missing basic type; int assumed (warning)
^ (314) ";" expected
922: }
^ (285) no identifier in declaration
^ (374) missing basic type; int assumed (warning)
^ (314) ";" expected
(908) exit status = 1
movlw 0x88
movwf _intcon
movlw 0x06
movwf _ioc
sleep
nop
_endasm
809: _asm
^ (195) expression syntax
EXAMPLE.c:
921: mainendloop: goto mainendloop;
^ (374) missing basic type; int assumed (warning)
^ (314) ";" expected
922: }
^ (285) no identifier in declaration
^ (374) missing basic type; int assumed (warning)
^ (314) ";" expected
(908) exit status = 1
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: C icon with asm code
Hello
With Flowcode 7 and above XC8 compiler is used instead of BoostC
Therefore, what works with V6 assembly won't work with V7+
For example SFR must be in upper case.
In your case you can try
nop and sleep are not directly assembly, therefore and should also work.
What target device are you using?
With Flowcode 7 and above XC8 compiler is used instead of BoostC
Therefore, what works with V6 assembly won't work with V7+
For example SFR must be in upper case.
In your case you can try
Code: Select all
#asm
movlw 0x88
movwf INTCON
movlw 0x06
movwf IOC
sleep
nop
#endasm
Code: Select all
NOP
Code: Select all
SLEEP
What target device are you using?
Martin
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: C icon with asm code
That's great.
Thank you for letting us know.
The advantages of XC8 are compile speed and regularly updating with newer targets.
Thank you for letting us know.
The advantages of XC8 are compile speed and regularly updating with newer targets.
Martin