What is the most efficient way to check the value of a register ?

Steve311

Member
Hi All, What is the most efficient way to check the value of a register? Something like this?

Thanks



Code:
Determine_Value
	movlw	0xFF	
	movwf	Value_Counter
Determine_Value_Loop
	subwf	RegisterX, w
	btfsc	STATUS, Z
	goto	Done
	decf	Value_Counter
	goto	Determine_Value_Loop
Done
	movf	Value_Counter, w
	movwf	ValueX
	return
 
SKPZ (branch if value=register)

I never use these pseudo instructions (macros?)

It seems the kind of thing that some people adopt and others don't.
 
They were originally supported in MPASM if I remember right, as "easier to remember" mnemonics than the hardware "BTFSS STATUS,Z".

SKPZ, SKPNZ, SKPC, and SKPNC are very handy!
 
Yes, I met them when starting with the 16C57.
 
We sound like the old-timers club... My first PICstart dev kit was a 16b that came with a blue screen DOS MPASM and 16C57.

Ahh the good old days when we would code ADC by having an external RC on the PIC pin, pulling the input pin low, then timing how long it took for the pin voltage to go high... Or working with one of those really pricy PIC14 series that actually had ADC built in! I've still got a 28pin PIC14 gold window chip around somewhere.
 
We sound like the old-timers club... My first PICstart dev kit was a 16b that came with a blue screen DOS MPASM and 16C57.

The PICStart was a 'modern' programmer

It was a LONG time before MicroChip brought out Windows versions of their software - which was why WinPicProg was the worlds first Windows PIC programmer software (by a considerable margin).
 
Do you remember the PICstart16b Nigel? it was a little bare PCB with a 18pin ZIF socket, a DB9 serial plug and 4 rubber feet stuck to the bottom. And a null modem cable to connect it. I got mine somewhere around 1990? if memory serves me right. That was a long time before they released the pretty PICstart in the cream plastic case.
 

Yes, I remember the 16b - although I could never afford one
 
Not only do I remember them, I still have the full set.

**broken link removed**

Mike.
 
Last edited:
Yes, I remember the 16b - although I could never afford one

I don't remember it being that pricy, but I think I bought during some Australian release magazine special. It's such a long time ago now.

Nice going Pommie! I don't remember the black PICstart Plus, but I have a standard cream one fromt he late 90's that saw many years use.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…