From: "ken" Newsgroups: comp.os.msdos.djgpp References: <363f3376 DOT 1676539 AT news DOT algonet DOT se> Subject: Re: Graphics code and asm under djgpp? Date: Sun, 8 Nov 1998 02:29:45 -1000 Lines: 74 X-Newsreader: Microsoft Outlook Express 4.72.3110.5 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 X-NNTP-Posting-Host: 204.210.109.117 Message-ID: <364421ac.0@news.hawaii.rr.com> X-NNTP-Posting-Host: 204.210.96.14 NNTP-Posting-Host: 204.210.96.14 X-Trace: 7 Nov 1998 10:25:41 -0800, 204.210.96.14 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com In this case it is actually simpler... void retrace(void) { while ((inportb(0x3da) & 0x80) != 0); while ((inportb(0x3da) & 0x80) == 0); } this can be placed in macro etc... but even 386 will be fast enough with a function imo. Jay wrote in message ... >Here's the answer to your first one: >Because DJGPP doesn't accept the Intel asm syntax, you have to write it in >AT&T syntax. Therefore: > >mov dx,3DAh >l1: > in al,dx > and al,08h > jnz l1 >l2: > in al,dx > and al,08h > jz l2 > >becomes >asm(" > movw $0x3da, %dx; >l1: > inb %dx, %al; > andb $0x8, %al; > jnz l1; >l2: > inb %dx, %al; > andb $0x8, %al; > jz l2; >); > >The 2nd one, look up the faq at the DJGPP website on mode 13h. They'll tell >you every thing there. > >tbelius AT algonet DOT se wrote in message <363f3376 DOT 1676539 AT news DOT algonet DOT se>... >>I need help with 2 things: >> >>1. I need to convert this asm code for waiting for the vertical >>retrace converted to a function that djgpp accepts. >>I am trying to learn asm but i havnt come so long >>that i can do it myself. I did notice one thing thow. >>Are the in al,dx instructions valid? The lx and dx >>regs are of different size right? >>What does the in intruction do anyway? >>Can you use this function under windows? >> >>mov dx,3DAh >>l1: >> in al,dx >> and al,08h >> jnz l1 >>l2: >> in al,dx >> and al,08h >> jz l2 >> > >