Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Assembly codes question (keypad)

Status
Not open for further replies.

daredave

Newbie level 3
Joined
Feb 16, 2010
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
philippines
Activity points
1,316
Good day sir! can anyone explain me how these codes work in a more detailed way? specially the "keytable"? and what does "dt" stands for? I really need to fully understand these set of codes.. thank you all!:D

Code:
ram_start	EQU 0x0c
keycode		EQU ram_start+5
rowcnt		EQU ram_start+6
colcnt		EQU ram_start+7

Code:
keytable	
		movf keycode, W
		addwf PCL, F
		dt 0x60
		dt "123a"
		dt "456b"
		dt "789c"
		dt "*0#d"

keyscan		
		clrf keycode
		movlw 4
		movwf rowcnt

		movlw 0xfe
		tris PORTA

rowscan	movlw 0xa0
		call udelay
		swapf PORTB, W
		movwf colstatus

		movlw 4
		movwf colcnt

colscan	incf keycode, F
		rrf colstatus, F
		btfss STATUS, C
		goto keytable 

		decfsz colcnt, F
		goto colscan

		bsf STATUS, C

		bsf STATUS, RP0
		rlf TRISA, F 
		bcf STATUS, RP0

		decfsz rowcnt, F
		goto rowscan
		retlw 0
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top