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.
Hello i have wrote the above code but i use inline assembly to... is any other better way to get the same result ? i try to read busy flag from a glcd and switch block
void block(unsigned char cs) { bit busy = 1; if(cs == 1) cs1=1; else cs2=1; #pragma asm mov auxr,#0x0e ;disable XRAM from 0x00 to 0xff mov r0,#check_status busy: movx a,@r0 ;read busy flag jb acc.7,busy mov auxr,#0x0c ;enable XRAM #pragma endasm cs1=0; cs2=0; }
thanks a lot
thanks Erik i think i find it and now your AND make sense .
When you use variables in XDATA, the compiler loads the DPTR and then uses the MOVX A,@DPTR or MOVX @DPTR,A instructions. The address range is 64K bytes.
When you use variables in PDATA (which is a 265-byte page of XDATA), the compiler loads the address in R0 or R1 (8-bit register) and uses the MOVX @R0/@R1,A and MOVX A,@R0/@R1 instructions. The address range is 256 bytes.
cheers