delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/11/03/18:55:29

From: "Jay" <ok11 AT ihatespam DOT sprint DOT ca>
Newsgroups: comp.os.msdos.djgpp
References: <363f3376 DOT 1676539 AT news DOT algonet DOT se>
Subject: Re: Graphics code and asm under djgpp?
Lines: 54
Organization: n/a
X-Newsreader: Microsoft Outlook Express 4.72.3110.5
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Message-ID: <vFM%1.1239$gx1.976270@HME2.newscontent-01.sprint.ca>
Date: Tue, 3 Nov 1998 15:50:46 -0700
NNTP-Posting-Host: 209.103.7.58
X-Complaints-To: abuse AT sprint DOT ca
X-Trace: HME2.newscontent-01.sprint.ca 910137051 209.103.7.58 (Tue, 03 Nov 1998 18:50:51 EDT)
NNTP-Posting-Date: Tue, 03 Nov 1998 18:50:51 EDT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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