home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.pascal.borland      Borland Pascal was actually pretty neat      2,978 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 2,593 of 2,978   
   Marco van de Voort to Andrew Wan   
   Re: QUICK, Pascal to C translation   
   28 Dec 07 12:18:39   
   
   464a6d5a   
   XPost: borland.public.turbopascal   
   From: marcov@stack.nl   
      
   ["Followup-To:" header set to comp.lang.pascal.borland.]   
   On 2007-12-28, Andrew Wan  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)   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca