Mail Archives: djgpp/2001/05/26/18:45:19
"Rafal Maj" <maj_rafal AT poczta DOT onet DOT pl> writes:
> Hi,
> where can I find some FAQ or DOCs to learn how to translate typical asm code
> to asm syntax that I can use in .cc file for DJGPP ?
> And can someone be so nice to spend some time and write lilte .cc file that
> will use folowing code :
> ======[snip]=======
> WaitVRT proc near
>
> push ax
> push dx
> mov dx,3DAh
> WaitVRT1: in al,dx
> test al,8
> jz WaitVRT1
> WaitVRT2: in al,dx
> test al,8
> jnz WaitVRT2
> pop dx
> pop ax
> ret
>
> WaitVRT endp
You don't need assembly for this. All you are doing is reading from a
port, waiting until a certain bit becomes set and then until it
becomes clear.
#include <pc.h>
void waitvrt(void)
{
while (!(inportb(0x3da) & 8)) ;
while (inportb(0x3da) & 8) ;
}
--
Nate Eldredge
neldredge AT hmc DOT edu
- Raw text -