Mail Archives: djgpp/1996/05/26/02:49:18
On Sat, 25 May 1996, Jamul wrote:
> init_rs232(); (this is done with inline asm, using the "int" instruction
> - is that bad?)
No, except that I'd suggest to first write it without inline assembly.
The inline assembly facilities of Gcc are very powerful, but dangerous if
misused and use conventions that are quite different from what you see in
other DOS compilers. Initialization is only done once, so why do it in
assembly?
> while(1) {
> if(status port says data_ready)
> data=inportb(buffer port);
> (when it comes time to send something) {
> if(status port says xmission buffer clear)
> outportb(buffer port, data to send);
> }
> }
>
This seems OK, but the bugs can be in the details.
- Raw text -