??? 06/01/09 06:18 Read: times |
#165703 - Compare Responding to: ???'s previous message |
I managed to write a program that reads the information received from the reader and it works just fine..then i added the comparisson loop like this
Compare:JNB 01h,NO_MATCH ;this bit is set when i've received the tag ID MOV R0,#40h MOV R6,#10h MOV DPTR,#Valid_ID CMP_NXT: CLR A MOVC A,@A+DPTR INC DPTR MOV 3Fh,@R0 ;i use 3Fh as an auxiliary register CJNE A,3Fh,NO_MATCH ;if the content of A<>content of 3Fh then no match INC R0 DJNZ R6,CMP_NXT CLR P2.0 ;if the tag ID =Valid_ID then a LED will glow NO_MATCH: RET but this doesn't work as it should. please tell me what am i doing wrong in this routine |