jordan%ucbarpa@ucb-vax.ARPA (Jordan Hayes on ttyp2) (03/18/85)
Does anyone know how to do port I/O in MBASIC (5.21 or similar) -- you can't just open a device as a file... I have read the documentation for OUT and IN, but how do you know which 'port-address' to use, or find the status of the port ? Any help appreciated... /jordan ------------ ARPA: jordan@ucbvax.ARPA UUCP: ..!ucbvax!jordan
ABN.ISCAMS@USC-ISID.ARPA (03/19/85)
Jordan, When I absolutely had to (on this Morrow Decision of mine), I used the MBASIC INP and OUT to work with the Morrow ports. Mine is weird because you must poke (well, OUT) a value to one location to flip the I/O board to that port "family", and THEN INP another location to check port status (doing various masking for ready condition), and THEN OUT a third location to shoot the port! Ugh! If you have source code for your BIOS, check the CONIN and CONOUT, LISTOUT, PUNOUT, etc. They all deal with ports in, out, ready/busy, and you can pick up the AND masking values there. (Also the addresses.) All my port addresses are low (less than 80H, naturally), and can be addressed as integers, so INP and OUT work fine. However anything heavy going on (lots of fast changing status), and BASIC is just too slow to do that INP/OUTing very well. Now if I were only more knowledgeable on interfacing machine language programs with MBASIC... Much rather do the tricky stuff there and hand values to and from the ML segment. Hope this was some help. Regards, David Kirschbaum Toad Hall (ABN.ISCAMS@USC-ISID)