We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I'm having a problem with the memcmp library function. Even though the buffers match, it returns a value that is not 0. Here is the code:
if (sx == app_id[0]) { sx = memcmp((rx1_buf+y),app_id,8); if (sx==0) . . .
;sx = memcmp((rx1_buf+y),app_id,8); ; SOURCE LINE # 207 MOV DPTR,#y?041 MOVX A,@DPTR ADD A,#LOW (rx1_buf) MOV R1,A CLR A ADDC A,#HIGH (rx1_buf) MOV R0,AR1 MOV R4,A MOV R5,#01H MOV R3,#0FFH MOV R2,#HIGH (app_id) MOV R1,#LOW (app_id) MOV R6,#00H MOV R7,#08H LCALL ?C?MEMCMPAMD MOV R7,AR1 ; if (sx==0)
Figured it out. I had prototyped the function by itself without including the string.h header file. Once I added #include <string.h> the line MOV R7,AR1 went away.