comp.lang.ada
 help / color / mirror / Atom feed
From: "Philippe Bourzeix" <philippe.bourzeix@free.fr>
Subject: Parallel Port
Date: 2000/03/19
Date: 2000-03-19T00:00:00+00:00	[thread overview]
Message-ID: <172B4.2690$wl2.12638330@nnrp4.proxad.net> (raw)

I have already asked some questions, but i would like to know why this
program works on Alsys and not on objectada :

with Text_Io;
with System;
with Unchecked_Conversion;
use Text_Io, System;

procedure Lcd is
    -------------------------------------
    -- Definition du type bit et octet --
    -------------------------------------
    type Bit is new Boolean;
    for Bit'Size use 1;
    type Octet is array (1..8) of Bit;
    pragma Pack (Octet);
    -----------------------------
    -- fonction de convertion  --
    -----------------------------
    subtype Entier_8_bits is Short_Short_Integer;
    package Es_Entier_8_bits is new Text_Io.Integer_Io(Entier_8_bits);
    use Es_Entier_8_bits;
    function Octet_Entier is new Unchecked_Conversion (Octet,Entier_8_bits);
    function Entier_Octet is new Unchecked_Conversion (Entier_8_bits,Octet);
    function Integer_Address is new Unchecked_Conversion (Integer,Address);
    ------------------------------
    -- Clause sur les addresses --
    ------------------------------
    Registre_1, Registre_2, Registre_3 : Octet ;
    for Registre_1 use at Integer_Address(16#378#); -- Parallel port address
    for Registre_2 use at Integer_Address(16#379#);
    for Registre_3 use at Integer_Address(16#37A#);
        -------------------
        -- Fonctions LCD --
        -------------------
    function Dico (Caractere : in Character) return Octet is
    begin
        return Entier_Octet(Character'Pos(Caractere));
    end Dico;
    procedure Ecrire (Caractere : in Character) is
    begin
        Registre_1:=Dico(Caractere);
        Registre_2:=Entier_Octet(2#0000_0000#);
        Registre_3:=Entier_Octet(2#0000_0000#);
    end Ecrire;
    procedure Ligne_Suivante is
    begin
        null;
    end Ligne_Suivante;
    procedure Verif is
    begin
        Put_Line("registre 1 =" &
Entier_8_bits'Image(Octet_Entier(Registre_1)));
        Put_Line("registre 2 =" &
Entier_8_bits'Image(Octet_Entier(Registre_2)));
        Put_Line("registre 3 =" &
Entier_8_bits'Image(Octet_Entier(Registre_3)));
    end Verif;


    begin
        Verif;
        Ecrire('A');
        Put_Line("Ordre d'ecriture : A");
        Verif;
        Ecrire('a');
        Put_Line("Ordre d'ecriture : a");
        Verif;
end Lcd;






             reply	other threads:[~2000-03-19  0:00 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-19  0:00 Philippe Bourzeix [this message]
2000-03-19  0:00 ` Parallel Port Ed Falis
2000-03-20  0:00   ` Philippe BOURZEIX
2000-03-20  0:00     ` Gautier
2000-03-20  0:00       ` Jerry van Dijk
2000-03-20  0:00         ` Gautier
2000-03-19  0:00 ` Dale Stanbrough
2000-03-20  0:00   ` Philippe BOURZEIX
2000-03-21  0:00 ` Philippe BOURZEIX
2000-03-21  0:00   ` tmoran
  -- strict thread matches above, loose matches on Subject: below --
2001-01-17  9:18 PARALLEL PORT Szymar
2000-03-05  0:00 Parallel port Philippe Bourzeix
2000-03-05  0:00 ` Jerry van Dijk
2000-03-06  0:00   ` Philippe BOURZEIX
2000-03-06  0:00     ` Philippe Bourzeix
2000-03-06  0:00     ` Ted Dennison
2000-03-06  0:00       ` Gisle S�lensminde
2000-03-06  0:00         ` Ted Dennison
2000-03-06  0:00         ` Philippe Bourzeix
2000-03-08  0:00           ` Gisle S�lensminde
2000-03-06  0:00       ` tmoran
2000-03-06  0:00         ` Philippe Bourzeix
2000-03-07  0:00           ` tmoran
2000-03-05  0:00 ` Tarjei Tj�stheim Jensen
replies disabled

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