Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Turbo Basic - <b>wait wait for port status</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
WAIT                     Wait for Port Status

 WAIT port, n [,m]

    Suspends program execution until a specified bit pattern appears at a
    specified port address.

        port    A numeric expression in the range 0 to 65535; specifies
                the I/O port to test.

         n,m    Integer expressions in the range 0 to 255; they supply the
                test. m defaults to 0.

   -------------------------------------------------------------------------

      Notes:    Turbo Basic gets the value at port, XORs it with m, then
                ANDs it with n. If the result is zero, the process is
                repeated. If the result is nonzero, program execution
                continues with the next statement.

                To test for a 1 at a particular bit position in port, m
                should be omitted and n should have a 1 at the position in
                question. To test for a 0 in port, both n and m should
                have a 1 in the position in question.

                Note that the test is considered positive if any nonzero
                value is returned. Therefore, to test for multiple bit
                positions, use multiple WAIT statements.

                Warning: If port never develops a nonzero value, WAIT can
                put your system into an infinite loop.

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson