
      WAIT_LCD:
            SETB EN ;Start LCD command
            CLR RS ;It's a command
            SETB RW ;It's a read command
            MOV DATA,#0FFh ;Set all pins to FF initially
            MOV A,DATA ;Read the return value
            JB ACC.7,WAIT_LCD ;If bit 7 high, LCD still busy
            CLR EN ;Finish the command
            CLR RW ;Turn off RW for future commands
            RET
