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
if bit 7 if & 0x80
what is the difference????
Erik
What is the difference ? between
while(0x41&0x80); and //while(0x41&0x80);
check_status is always 0x41!it my magic constant
0x41 is the address, not a constant!
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