CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Can't understand assembly?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Lykos1986



Joined: 26 Nov 2005
Posts: 68

View user's profile Send private message

Can't understand assembly?
PostPosted: Wed Jul 17, 2013 10:18 am     Reply with quote

Hi! I was creating a little bit of code and I wanted to use assembly language in different section of my firmware.

It seems that CCS (version 4.140) can't understand this code! For example I am writing:
Code:

   #asm
   mov.w #0x766,0x0002
   mov.w #0x55,0x0004
   mov.w 0x0004,[0x0002]
   mov.w #0xaa,0x0006
   mov.w 0x0006,[0x0002]
   ...

   #endasm


And I am getting:
Error 95 ... Expecting an opcode mnemonic mov
at the first line of my assembly code!

I was searching the forum and it seems that a few users are saying that this problem will be fixed in a latter version of CCS. But that was 2 years ago!

Any help here?
temtronic



Joined: 01 Jul 2010
Posts: 9165
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Jul 17, 2013 11:01 am     Reply with quote

It doesn't like the ...

mov.w ........... opcode.

I checked the 18F46k22 instruction set and mov.w is not there so you should tell us which PIC you're using.
It may be a valid opcode for your PIC that the compiler can't figure out due to a bug?


hth
jay
Lykos1986



Joined: 26 Nov 2005
Posts: 68

View user's profile Send private message

PostPosted: Wed Jul 17, 2013 11:30 am     Reply with quote

I am using the 24F32KA304.

Basically I haven't used assembly language for more than 6 years now.
But because I am using MpLab (with CCS compiler plugin) I've compile a CCS example and then looked at the Disassembly Listing provided from the MpLab in order to understand what is going on with a problem I am facing.

The Disassembly Listing was using exactly this type of assembly language that it is diferent from the one I've learned for the PIC microcontrollers. Then I download a couple of manuals and start learning this instruction set believing that this is the correct one for PICs nowadays.

It seams that this instruction set is more for x86 architectures... but somehow it is the one that MpLab understands.
temtronic



Joined: 01 Jul 2010
Posts: 9165
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Jul 17, 2013 2:47 pm     Reply with quote

Sorry, I don't use the 24 series PICs so I'm not familiar with their opcodes, but if 'mov.w' is correct, then it sounds more like a bug in the compiler version you're using.
Someone that use the 24s probably knows..
Ttelmah



Joined: 11 Mar 2010
Posts: 19349

View user's profile Send private message

PostPosted: Wed Jul 17, 2013 3:29 pm     Reply with quote

It isn't.
The PCD manual will list the opcodes. mov, and mov.d. Not mov.w.
Though CCS doesn't use Microchip assembler, the data sheet also does not give mov.w. Only the PIC33 chips have this instruction.

Best Wishes
Lykos1986



Joined: 26 Nov 2005
Posts: 68

View user's profile Send private message

PostPosted: Wed Jul 17, 2013 4:16 pm     Reply with quote

If only the PIC33 chips have these instructions why the Disassembly Listing of a 24F PIC with CCS compiler is using only those instruction (mov.w) from top to bottom?
Ttelmah



Joined: 11 Mar 2010
Posts: 19349

View user's profile Send private message

PostPosted: Thu Jul 18, 2013 12:40 am     Reply with quote

They use mov.w as the displayed mnemonic for mov.d. I know it is insane. Look at the list in the manual for the supported instructions.
This happens with the other chips as well. The 'asm' they generate, can not be typed in as 'input assembler'.....
You could close to what you seem to want by just word definitions and C.

Best Wishes
Lykos1986



Joined: 26 Nov 2005
Posts: 68

View user's profile Send private message

PostPosted: Thu Jul 18, 2013 6:14 am     Reply with quote

Ok, I will try the old good assembly instructions and hopefully I will have good results.

Many thanks for your answers and your help!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group