comp.lang.ada
 help / color / mirror / Atom feed
* pascal to Ada
@ 2001-02-14 19:29 Munir Albeelbisi
  2001-02-14 21:30 ` Pascal Obry
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Munir Albeelbisi @ 2001-02-14 19:29 UTC (permalink / raw)


is there any pascal to Ada converter





^ permalink raw reply	[flat|nested] 14+ messages in thread
* Pascal to ADA
@ 2003-11-17 10:12 Tilman Gloetzner
  2003-11-17 10:24 ` Vinzent 'Gadget' Hoefler
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Tilman Gloetzner @ 2003-11-17 10:12 UTC (permalink / raw)


Hello,

1) what is a effecient way of rewriting the following code fragement in ADA
?  With the absolute keyword, Pascal  effectively casts
N, M, and R from a 4 byte integer type to an array of 4 bytes by an address
access.  I guess to implement the same mechanism in
ADA is not in line with ADA's philosophy.

2) How do I mask out bits in a (unsigned) number type, as logical operators
work only on booleans ?

Thank you,

Tilman

----------------------------------------------------------------
PROCEDURE Add32(N:LONGINT;M:LONGINT;VAR R:LONGINT) ;
VAR
     _N : ARRAY[0..3] OF BYTE ABSOLUTE N ;
     _M : ARRAY[0..3] OF BYTE ABSOLUTE M ;
     _R : ARRAY[0..3] OF BYTE ABSOLUTE R ;
     A  : BYTE ;
     B  : WORD ;
     C  : WORD ; { Carry }
BEGIN
     R := 0 ;
     C := 0 ;
     FOR A := 0 TO 3 DO BEGIN
         B := _N[A] + _M[A] + C ;
         _R[A] := B AND $FF ;
         C := B SHR 8 ;
     END ;
END  ;





^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2003-11-20 12:24 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-02-14 19:29 pascal to Ada Munir Albeelbisi
2001-02-14 21:30 ` Pascal Obry
2001-02-15 12:22   ` Marc A. Criley
2001-02-15 17:31     ` Pascal Obry
2001-02-15 10:43 ` David C. Hoos, Sr.
2001-02-15 17:21 ` Randy Brukardt
  -- strict thread matches above, loose matches on Subject: below --
2003-11-17 10:12 Pascal to ADA Tilman Gloetzner
2003-11-17 10:24 ` Vinzent 'Gadget' Hoefler
2003-11-17 10:44 ` Marius Amado Alves
2003-11-17 11:41 ` Ole-Hjalmar Kristensen
     [not found] ` <1069065860.2826.11.camel@localhost.localdomain>
2003-11-17 13:17   ` Marius Amado Alves
2003-11-17 14:42 ` Steve
2003-11-17 23:14   ` tmoran
2003-11-20 12:24 ` Lutz Donnerhacke

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox