Article View: comp.lang.pascal.borland
Article #111Re: QUICK, Pascal to C translation
From: Marco van de Voort
Date: Fri, 28 Dec 2007 12:18
Date: Fri, 28 Dec 2007 12:18
26 lines
1799 bytes
1799 bytes
["Followup-To:" header set to comp.lang.pascal.borland.]
On 2007-12-28, Andrew Wan <andwan0@googlemail.com> wrote:
> Please can Pascal/C gurrus help me to confirm this:
>
> l := port[$60];
> l = inp( 0x60 );
Assuming it is a dos compiler: yes. inp is not standard C btw.
> keys[l mod 128] := l < 128;
> keys[l & 127] = (l < 128);
Assuming keys isn't an array defined with a negative starting index.
> mem[$0040:$001a] := mem[$0040: $001c]; {Pascal}
> pokeb(0x40, 0x1a, peekb(0x40, 0x1c)); // C
I do not know that statement in a C compiler, but it looks logical.
> port[$20] := $20;
> outp( 0x20, 0x20 );
Also looks ok.
Of course the usual saveguards exist (e.g. direct port I/O is sometimes
problematic on NT class Windows versions like XP)
Technical Details
Message-ID:
<slrnfn9qcv.g6.marcov@snail.stack.nl>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!news.stack.nl!not-for-mailReferences:
<e4302637-2738-4a0e-9413-7422371f9ff5@l32g2000hse.googlegroups.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 111659,477674b152700ba2 X-Google-Thread: 108ebd,477674b152700ba2 X-Google-Attributes: gid111659,gid108ebd,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!news.stack.nl!not-for-mail From: Marco van de Voort <marcov@stack.nl> Newsgroups: comp.lang.pascal.borland, borland.public.turbopascal Subject: Re: QUICK, Pascal to C translation Followup-To: comp.lang.pascal.borland Date: Fri, 28 Dec 2007 12:18:39 +0000 (UTC) Organization: Stack Usenet News Service Lines: 26 Message-ID: <slrnfn9qcv.g6.marcov@snail.stack.nl> References: <e4302637-2738-4a0e-9413-7422371f9ff5@l32g2000hse.googlegroups.com> NNTP-Posting-Host: snail.stack.nl X-Trace: mud.stack.nl 1198844319 30423 2001:610:1108:5010::131 (28 Dec 2007 12:18:39 GMT) X-Complaints-To: abuse@stack.nl NNTP-Posting-Date: Fri, 28 Dec 2007 12:18:39 +0000 (UTC) User-Agent: slrn/0.9.8.1 (FreeBSD)