What is RETW instruction used for in PIC ?

Status
Not open for further replies.

coolchip

Full Member level 2
Joined
Nov 17, 2003
Messages
125
Helped
1
Reputation
2
Reaction score
2
Trophy points
1,298
Activity points
1,109
What is RETW instruction used for in PIC ?

Thanks !
 

RETW in PIC

Strange enough I didn't find it anywhere in the datasheet !!
 

Re: RETW in PIC

I have not come across a RETW instruction... Could it be the RETLW instruction that you're referring to? Or, could it be a pseudo instruction that someone created using the define directive?

Regards, Mike
 

Re: RETW in PIC

Most probably RETLW xx, which means RETURN from a CALL with W loaded with value "xx".

Intended for table read routines, useful for debugging where, depending what was the xx value you knew where the action was passing through after acertain CALL:
 

Re: RETW in PIC

The instruction is RETLW is mostly used when doing look-up tables in PIC assembly. You call the table address with CALL instruction, at the table address you place an instruction that adds an offset to the PCL to get the correct RETLW from the table and return with that value in the W register.
Good Luck
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…