ASM och MCP9701

PIC, AVR, Arduino, Raspberry Pi, Basic Stamp, PLC mm.
Användarvisningsbild
PHermansson
EF Sponsor
Inlägg: 4340
Blev medlem: 22 december 2004, 00:46:38
Ort: Särestad Grästorp
Kontakt:

Re: ASM och MCP9701

Inlägg av PHermansson »

Den enklare varianten med tabell:

Kod: Markera allt

	movf	decimals, W	; Lookup and convert value i decimals
	call	dectable
	movwf	decimals

   ; Send ten's
   swapf   decimals, W
   andlw   H'F'
   addlw   H'30'
   call   	lcd_send_data
   
   ; Send one's
   movf 	decimals, W
   andlw   H'F'
   addlw   H'30'
   call   	lcd_send_data

;;Call with byte to retrieve in W (in this case, W in range of 0-3)
dectable
      addwf PCL
dt 0, 25, 50, 75

Skriv svar