Tables

Status
Not open for further replies.

AtomSoft

Well-Known Member
Anyone know of any good tutorials on TABLES like for what can you use them and how. (ASM)

The links in the Newcomers is too general and most sites contain the same so similar work.

Maybe we should make a Topic/Sticky on tutorials? Like "How to" instead of main linking sites. You can Link to main site and their tutorial. Like:

Tutorial on Infared:

1. )
2. NIKON D70 IR REMOTE CONTROL By bigmike (HOME)
3. **broken link removed** By Keithicus (**broken link removed**)

This way people find what they are looking for faster. And the authors get their credit.
 
Last edited:
If the manufacture does not have nor refuses to acquiesce detailed applications notes then drop them. No forum should do the job of others. The only true reason why non affiliate forms exist is such plethora is because its posters cannot seem to understand that the manufactures build the device Bible, the source of the Word. Forums are just interpreters of the Word. Newcomers ought to always be directed to the source first. Hence general links spawned in the forums.
 
But these links are to understanding what needs to be learned not everyone who learnes about infrared is a newcomer and needs not to relearn the basics. He/she knows the basics and hence needs information on the appropriate subject not the "device bible". If there is such a bible then everyone would know how to use everything. Not every tutorial teaches everything out there. I was just stating instead of only general tutorial how about we ADD* some not general hence specific tutorials. I never said take off the other tutorials i implied ADD some specific ones.
 
Originally from Nigel:
Code:
String1		clrf	count			;set counter register to zero
Mess1		movf	count, w		;put counter value in W
		call	Xtext			;get a character from the text table
		xorlw	0x00			;is it a zero?
		btfsc	STATUS, Z
		retlw	0x00			;return when finished
		call	LCD_Char
		incf	count, f
		goto	Mess1
Would this be more accurate?

Code:
String1		clrf	count			;set counter register to zero begining of table
Mess1		movf	count, w		;put the value of counts in W
		call	Xtext			;get a character from the Xtext table chr(count)
		xorlw	0x00			;is it a zero? [b]Confused me a bit. Will this test each bit
                                                ;to see if its the same and if so return a 0 and if not a 1?
                                                ;If so why dont we check  W in the next statement?
                                                ;The contents of W are XOR’ed with the 8-bit literal ‘k’.
                                                ;The resultis placed in W.[/b]
		btfsc	STATUS, Z               ;BitTestFileSkipClear Test ALU Status bit Z
		retlw	0x00			;return when finished to where string1 was called.
		call	LCD_Char                ;Display character(s) on LCD
		incf	count, f                ;Get next Char by adding 1 to f (count). I think instead of f
                                                ;can i put like b'00000001' or well 1
		goto	Mess1                   ;Start the loop over
 
Last edited:
XORLW 0x00 exclusive OR's the contents of W with zero, and if W is equal to zero will set the Z flag, so you only need to check the Z flag in the next line.

It also has the added bonus that it doesn't change the contents of W.
 
oh i see so that way we wont have to move the original contents of w into a temp variable and back in w we just set the z flag and jeep original w. Thats cool.
 
AtomSoft said:
oh i see so that way we wont have to move the original contents of w into a temp variable and back in w we just set the z flag and jeep original w. Thats cool.

It's things like that, that make PIC's so fast - in some ways the instruction set is very well designed.
 
yeah its like why do something that we technically dont have to do lol. Saves code size and instruction time.
 
You can also use any of the following,
Code:
	iorlw	0
	andlw	0xff
	addlw	0

You cannot use sublw 0 as this does not do W=W-0, it does W=0-W and so negates W. This tends to catch a lot of people out as the mnemonic suggests it does subtract literal from W.

Mike.
 
Cool i see how the and would work now since we use 0xff its like:

(Y represents the 0xff/0x00/0x00 in AND/XOR/OR respectively)

AND:
X Y | F
-------
0 1 0
1 1 1

XOR:
Xor (difference)
X Y | F
-------
0 0 0
1 0 1

OR:
X Y | F
-------
0 0 0
1 0 1

Would that be correct? Also why ADDLW?
 

Yes, you are correct. The add works because adding zero to W leaves it unchanged but set's the zero flag.

Mike.
 
Assembly seems to getting easier to under stand i learned the meaning of things. The only thing about assembly and well other syntax is the jumps. You can get lost in assembly real quick if there are no comments labels etc. Thanks for the info.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…