Fist option, hard option: for your example, btfss KEYVAL,3 goto Value01 btfss KEYVAL,2 goto Value09 goto Value0D ok, if you have more numbers you have to be a little smarter but this is the essence of assembly programming. Second option, more elegant: assuming KEYVAL figures are between 0 and 15, movlw KEYVAL addwf pcl,f retlw h'01' ; response to KEYVAL=0 retlw h'06' ; response to KEYVAL=1 retlw h'02' ; response to KEYVAL=2 retlw h'03' ; response to KEYVAL=3 retlw h'05' ; response to KEYVAL=4 retlw h'04' ; response to KEYVAL=5 retlw h'02' ; response to KEYVAL=6 ... Be careful to have your table in a single page!!! Ciao -------------------- Jeszs Gonzalo Lesn (SPAIN) -------------------- ----- Original Message ----- From: "Aart" To: Sent: Thursday, February 08, 2001 11:51 AM Subject: [PIC]; Small Question about programming. Hello, 1) is any documentation that show's a small program example (not that small as in the datasheet) of to use each mnemonic seperatly? 2) There is a 16F84 connected to a keypad and it has output to 4 leds. I get an input from my keypad in KEYVAL when a butto is pressed, now i want to make the KEYVAL to correspond to the Number pressed. For example: Pressed key KEYVAL Want it to be "1" 0x00 1 "8" 0x09 8 "0" 0x0D 0 How do i do such in assembler? Thx, Aart. -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details. -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.