PDA

View Full Version : Word In Asm



HBFR
- 20th February 2006, 21:14
TRISB=%00000000 '0 all out
led0 var portB.0
comptval VAR BYTE
val1 VAR BYTE


init:
low led0
comptval=0
val1=255
start:
comptval=comptval+1
asm

readval
movwf _val1
test
bcf status,2
movf _comptval,0
xorwf _val1,0
btfss status,2
goto _start
bsf _led0

endasm
pause 500
goto start

I try to do the same with word comptval var word and val1 var word in ASM

No idea to do in asm to work with more than 8 bits

Can you help me

BB

sougata
- 22nd February 2006, 01:36
Hi,

MYWORD var WORD

lowerbyte in asm = _MYWORD
higherbyte in asm = _MYWORD + 1

Hope this helps.

Regards

Sougata