delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/11/07/15:30:07

From: "ken" <browns001 AT hawaii DOT rr DOT com>
Newsgroups: comp.os.msdos.djgpp
References: <363f3376 DOT 1676539 AT news DOT algonet DOT se> <vFM%1.1239$gx1 DOT 976270 AT HME2 DOT newscontent-01 DOT sprint DOT ca>
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
>>
>
>


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019