Problem with PIC24FJ32GA002

Status
Not open for further replies.

Diver300

Well-Known Member
Most Helpful Member
I have come across a problem with a PIC24FJ32GA002.

I need to rotate a bit into a 64 bit number. The 64 bit number is held in four 16 bit registers, with w3 pointing to the least significant one.

So I wrote:-

Code:
        repeat       #3
	rlc		[w3], [w3--]

That worked in the simulator but seems rotate in only zeros, when in the real PIC.

So I changed it to:-

Code:
        rlc		[w3], [w3--]
	rlc		[w3], [w3--]
	rlc		[w3], [w3--]
	rlc		[w3], [w3--]

Which seems to work fine.

Is there anything wrong with using the repeat command in this way?
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…