DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download
Index: ┃ B T

⟦dc5c3321a⟧ TextFile

    Length: 23114 (0x5a4a)
    Types: TextFile
    Names: »B«

Derivation

└─⟦149519bd4⟧ Bits:30000546 8mm tape, Rational 1000, !projects 93-07-13
    └─ ⟦124ff5788⟧ »DATA« 
        └─⟦this⟧ 
└─⟦a7d1ea751⟧ Bits:30000550 8mm tape, Rational 1000, !users!projects 94_04_11
    └─ ⟦129cab021⟧ »DATA« 
        └─⟦this⟧ 
└─⟦f64eaa120⟧ Bits:30000752 8mm tape, Rational 1000, !projects 93 02 16
    └─ ⟦6f12a12be⟧ »DATA« 
        └─⟦this⟧ 
└─⟦2f6cfab89⟧ Bits:30000547 8mm tape, Rational 1000, !projects 94-01-04
    └─ ⟦d65440be7⟧ »DATA« 
        └─⟦this⟧ 

TextFile

--with Erreur;
with Octet;

with Z80_Defs;
use Z80_Defs;

package body Desassembleur is


    -- TYPES ----------------------------------------------------------------

    type Code_Instruction is
        record
            Mnemo     : Mnemonic;
            Op_Gauche : Operande;
            Op_Droit  : Operande;
        end record;

    -- CONSTANTES -----------------------------------------------------------

    Table_Primaire : constant array (0 .. 255) of Code_Instruction :=
       (16#00# => (Nop, Aucun, Aucun),
        16#01# => (Ld, Bc, Nn),
        16#02# => (Ld, Bc_Indirect, A),
        16#03# => (Inc, Bc, Aucun),
        16#04# => (Inc, B, Aucun),
        16#05# => (Dec, B, Aucun),
        16#06# => (Ld, B, N),
        16#07# => (Rlca, A, Aucun),
        16#08# => (Ex, Af, Af_Prime),
        16#09# => (Add, Hl, Bc),
        16#0A# => (Ld, A, Bc_Indirect),
        16#0B# => (Dec, Bc, Aucun),
        16#0C# => (Inc, C, Aucun),
        16#0D# => (Dec, C, Aucun),
        16#0E# => (Ld, C, N),
        16#0F# => (Rrca, A, Aucun),

        16#10# => (Djnz, Offset_E, Aucun),
        16#11# => (Ld, De, Nn),
        16#12# => (Ld, De_Indirect, A),
        16#13# => (Inc, De, Aucun),
        16#14# => (Inc, D, Aucun),
        16#15# => (Dec, D, Aucun),
        16#16# => (Ld, D, N),
        16#17# => (Rla, A, Aucun),
        16#18# => (Jr, Offset_E, Aucun),
        16#19# => (Add, Hl, De),
        16#1A# => (Ld, A, De_Indirect),  
        16#1B# => (Dec, De, Aucun),
        16#1C# => (Inc, E, Aucun),
        16#1D# => (Dec, E, Aucun),
        16#1E# => (Ld, E, N),
        16#1F# => (Rra, A, Aucun),


        16#20# => (Jr, Nz, Offset_E),
        16#21# => (Ld, Hl, Nn),
        16#22# => (Ld, Nn_Indirect, Hl),
        16#23# => (Inc, Hl, Aucun),
        16#24# => (Inc, H, Aucun),
        16#25# => (Dec, H, Aucun),
        16#26# => (Ld, H, N),
        16#27# => (Daa, Aucun, Aucun),
        16#28# => (Jr, Z, Offset_E),
        16#29# => (Add, Hl, Hl),
        16#2A# => (Ld, Hl, Nn_Indirect),  
        16#2B# => (Dec, Hl, Aucun),
        16#2C# => (Inc, L, Aucun),
        16#2D# => (Dec, L, Aucun),
        16#2E# => (Ld, L, N),
        16#2F# => (Cpl, Aucun, Aucun),


        16#30# => (Jr, Nc, Offset_E),
        16#31# => (Ld, Sp, Nn),
        16#32# => (Ld, Nn_Indirect, A),
        16#33# => (Inc, Sp, Aucun),
        16#34# => (Inc, Hl_Indirect, Aucun),
        16#35# => (Dec, Hl_Indirect, Aucun),
        16#36# => (Ld, Hl_Indirect, N),
        16#37# => (Scf, Aucun, Aucun),
        16#38# => (Jr, Cy, Offset_E),
        16#39# => (Add, Hl, Sp),
        16#3A# => (Ld, A, Nn_Indirect),  
        16#3B# => (Dec, Sp, Aucun),
        16#3C# => (Inc, A, Aucun),
        16#3D# => (Dec, A, Aucun),
        16#3E# => (Ld, A, N),
        16#3F# => (Ccf, Aucun, Aucun),


        16#40# => (Ld, B, B),
        16#41# => (Ld, B, C),
        16#42# => (Ld, B, D),
        16#43# => (Ld, B, E),
        16#44# => (Ld, B, H),
        16#45# => (Ld, B, L),
        16#46# => (Ld, B, Hl_Indirect),
        16#47# => (Ld, B, A),
        16#48# => (Ld, C, B),
        16#49# => (Ld, C, C),
        16#4A# => (Ld, C, D),  
        16#4B# => (Ld, C, E),
        16#4C# => (Ld, C, H),
        16#4D# => (Ld, C, L),
        16#4E# => (Ld, C, Hl_Indirect),
        16#4F# => (Ld, C, A),


        16#50# => (Ld, D, B),
        16#51# => (Ld, D, C),
        16#52# => (Ld, D, D),
        16#53# => (Ld, D, E),
        16#54# => (Ld, D, H),
        16#55# => (Ld, D, L),
        16#56# => (Ld, D, Hl_Indirect),
        16#57# => (Ld, D, A),
        16#58# => (Ld, E, B),
        16#59# => (Ld, E, C),
        16#5A# => (Ld, E, D),  
        16#5B# => (Ld, E, E),
        16#5C# => (Ld, E, H),
        16#5D# => (Ld, E, L),
        16#5E# => (Ld, E, Hl_Indirect),
        16#5F# => (Ld, E, A),



        16#60# => (Ld, H, B),
        16#61# => (Ld, H, C),
        16#62# => (Ld, H, D),
        16#63# => (Ld, H, E),
        16#64# => (Ld, H, H),
        16#65# => (Ld, H, L),
        16#66# => (Ld, H, Hl_Indirect),
        16#67# => (Ld, H, A),
        16#68# => (Ld, L, B),
        16#69# => (Ld, L, C),
        16#6A# => (Ld, L, D),  
        16#6B# => (Ld, L, E),
        16#6C# => (Ld, L, H),
        16#6D# => (Ld, L, L),
        16#6E# => (Ld, L, Hl_Indirect),
        16#6F# => (Ld, L, A),


        16#70# => (Ld, Hl_Indirect, B),
        16#71# => (Ld, Hl_Indirect, C),
        16#72# => (Ld, Hl_Indirect, D),
        16#73# => (Ld, Hl_Indirect, E),
        16#74# => (Ld, Hl_Indirect, H),
        16#75# => (Ld, Hl_Indirect, L),
        16#76# => (Halt, Aucun, Aucun),
        16#77# => (Ld, Hl_Indirect, A),
        16#78# => (Ld, A, B),
        16#79# => (Ld, A, C),
        16#7A# => (Ld, A, D),  
        16#7B# => (Ld, A, E),
        16#7C# => (Ld, A, H),
        16#7D# => (Ld, A, L),
        16#7E# => (Ld, A, Hl_Indirect),
        16#7F# => (Ld, A, A),

        16#80# => (Add, A, B),
        16#81# => (Add, A, C),
        16#82# => (Add, A, D),
        16#83# => (Add, A, E),
        16#84# => (Add, A, H),
        16#85# => (Add, A, L),
        16#86# => (Add, A, Hl_Indirect),
        16#87# => (Add, A, A),
        16#88# => (Adc, A, B),
        16#89# => (Adc, A, C),
        16#8A# => (Adc, A, D),  
        16#8B# => (Adc, A, E),
        16#8C# => (Adc, A, H),
        16#8D# => (Adc, A, L),
        16#8E# => (Adc, A, Hl_Indirect),
        16#8F# => (Adc, A, A),

        16#90# => (Sub, B, Aucun),
        16#91# => (Sub, C, Aucun),
        16#92# => (Sub, D, Aucun),
        16#93# => (Sub, E, Aucun),
        16#94# => (Sub, H, Aucun),
        16#95# => (Sub, L, Aucun),
        16#96# => (Sub, Hl_Indirect, Aucun),
        16#97# => (Sub, A, Aucun),
        16#98# => (Sbc, A, B),
        16#99# => (Sbc, A, C),
        16#9A# => (Sbc, A, D),  
        16#9B# => (Sbc, A, E),
        16#9C# => (Sbc, A, H),
        16#9D# => (Sbc, A, L),
        16#9E# => (Sbc, A, Hl_Indirect),
        16#9F# => (Sbc, A, A),

        16#A0# => (Z80_And, B, Aucun),
        16#A1# => (Z80_And, C, Aucun),
        16#A2# => (Z80_And, D, Aucun),
        16#A3# => (Z80_And, E, Aucun),
        16#A4# => (Z80_And, H, Aucun),
        16#A5# => (Z80_And, L, Aucun),
        16#A6# => (Z80_And, Hl_Indirect, Aucun),
        16#A7# => (Z80_And, A, Aucun),  
        16#A8# => (Z80_Xor, B, Aucun),
        16#A9# => (Z80_Xor, C, Aucun),
        16#AA# => (Z80_Xor, D, Aucun),  
        16#AB# => (Z80_Xor, E, Aucun),
        16#AC# => (Z80_Xor, H, Aucun),
        16#AD# => (Z80_Xor, L, Aucun),
        16#AE# => (Z80_Xor, Hl_Indirect, Aucun),
        16#AF# => (Z80_Xor, A, Aucun),

        16#B0# => (Z80_Or, B, Aucun),
        16#B1# => (Z80_Or, C, Aucun),
        16#B2# => (Z80_Or, D, Aucun),
        16#B3# => (Z80_Or, E, Aucun),
        16#B4# => (Z80_Or, H, Aucun),
        16#B5# => (Z80_Or, L, Aucun),
        16#B6# => (Z80_Or, Hl_Indirect, Aucun),
        16#B7# => (Z80_Or, A, Aucun),
        16#B8# => (Cp, B, Aucun),
        16#B9# => (Cp, C, Aucun),
        16#BA# => (Cp, D, Aucun),  
        16#BB# => (Cp, E, Aucun),
        16#BC# => (Cp, H, Aucun),
        16#BD# => (Cp, L, Aucun),
        16#BE# => (Cp, Hl_Indirect, Aucun),
        16#BF# => (Cp, A, Aucun),

        16#C0# => (Ret, Nz, Aucun),
        16#C1# => (Pop, Bc, Aucun),
        16#C2# => (Jp, Nz, Nn),
        16#C3# => (Jp, Nn, Aucun),
        16#C4# => (Call, Nz, Nn),
        16#C5# => (Push, Bc, Aucun),
        16#C6# => (Add, A, N),
        16#C7# => (Rst, Z80_00h, Aucun),
        16#C8# => (Ret, Z, Aucun),
        16#C9# => (Ret, Aucun, Aucun),
        16#CA# => (Jp, Z, Nn),  
        16#CB# => (Inconnu, Aucun, Aucun), -- 16#cb#
        16#CC# => (Call, Z, Nn),
        16#CD# => (Call, Nn, Aucun),
        16#CE# => (Adc, A, N),
        16#CF# => (Rst, Z80_08h, Aucun),

        16#D0# => (Ret, Nc, Aucun),
        16#D1# => (Pop, De, Aucun),
        16#D2# => (Jp, Nc, Nn),
        16#D3# => (Z80_Out, N_Indirect, A),
        16#D4# => (Call, Nc, Nn),
        16#D5# => (Push, De, Aucun),
        16#D6# => (Sub, N, Aucun),
        16#D7# => (Rst, Z80_10h, Aucun),
        16#D8# => (Ret, Cy, Aucun),
        16#D9# => (Exx, Aucun, Aucun),
        16#DA# => (Jp, Cy, Nn),  
        16#DB# => (Z80_In, A, N_Indirect),
        16#DC# => (Call, Cy, Nn),
        16#DD# => (Inconnu, Aucun, Aucun), --16#dd#
        16#DE# => (Sbc, A, N),
        16#DF# => (Rst, Z80_18h, Aucun),

        16#E0# => (Ret, Po, Aucun),
        16#E1# => (Pop, Hl, Aucun),
        16#E2# => (Jp, Po, Nn),
        16#E3# => (Ex, Sp_Indirect, Hl),
        16#E4# => (Call, Po, Nn),
        16#E5# => (Push, Hl, Aucun),
        16#E6# => (Z80_And, N, Aucun),
        16#E7# => (Rst, Z80_20h, Aucun),
        16#E8# => (Ret, Pe, Aucun),
        16#E9# => (Jp, Hl, Aucun),
        16#EA# => (Jp, Pe, Nn),  
        16#EB# => (Ex, De, Hl),
        16#EC# => (Call, Pe, Nn),
        16#ED# => (Inconnu, Aucun, Aucun),   --16#ed#
        16#EE# => (Z80_Xor, N, Aucun),
        16#EF# => (Rst, Z80_28h, Aucun),

        16#F0# => (Ret, P, Aucun),
        16#F1# => (Pop, Af, Aucun),
        16#F2# => (Jp, P, Nn),
        16#F3# => (Di, Aucun, Aucun),
        16#F4# => (Call, P, Nn),
        16#F5# => (Push, Af, Aucun),
        16#F6# => (Z80_Or, N, Aucun),
        16#F7# => (Rst, Z80_30h, Aucun),
        16#F8# => (Ret, M, Aucun),
        16#F9# => (Ld, Sp, Hl),
        16#FA# => (Jp, M, Nn),  
        16#FB# => (Ei, Aucun, Aucun),
        16#FC# => (Call, M, Nn),
        16#FD# => (Inconnu, Aucun, Aucun), --16#fd#
        16#FE# => (Cp, N, Aucun),
        16#FF# => (Rst, Z80_38h, Aucun));


    Table_Ed : constant array (0 .. 255) of Code_Instruction :=
       (16#00# .. 16#3F# => (Inconnu, Aucun, Aucun),

        16#40#           => (Z80_In, B, C_Indirect),  
        16#41#           => (Z80_Out, C_Indirect, B),
        16#42#           => (Sbc, Hl, Bc),
        16#43#           => (Ld, Nn_Indirect, Bc),
        16#44#           => (Neg, Aucun, Aucun),
        16#45#           => (Retn, Aucun, Aucun),
        16#46#           => (Im, Z80_0, Aucun),
        16#47#           => (Ld, I, A),
        16#48#           => (Z80_In, C, C_Indirect),
        16#49#           => (Z80_Out, C_Indirect, C),
        16#4A#           => (Adc, Hl, Bc),
        16#4B#           => (Ld, Bc, Nn_Indirect),
        16#4C#           => (Inconnu, Aucun, Aucun),
        16#4D#           => (Reti, Aucun, Aucun),
        16#4E#           => (Inconnu, Aucun, Aucun),
        16#4F#           => (Ld, R, A),

        16#50#           => (Z80_In, D, C_Indirect),
        16#51#           => (Z80_Out, C_Indirect, D),
        16#52#           => (Sbc, Hl, De),
        16#53#           => (Ld, Nn_Indirect, De),
        16#54#           => (Inconnu, Aucun, Aucun),
        16#55#           => (Inconnu, Aucun, Aucun),  
        16#56#           => (Im, Z80_1, Aucun),
        16#57#           => (Ld, A, I),
        16#58#           => (Z80_In, E, C_Indirect),
        16#59#           => (Z80_Out, C_Indirect, E),
        16#5A#           => (Adc, Hl, De),
        16#5B#           => (Ld, De, Nn_Indirect),
        16#5C#           => (Inconnu, Aucun, Aucun),
        16#5D#           => (Inconnu, Aucun, Aucun),
        16#5E#           => (Im, Z80_2, Aucun),
        16#5F#           => (Ld, A, R),

        16#60#           => (Z80_In, H, C_Indirect),
        16#61#           => (Z80_Out, C_Indirect, H),
        16#62#           => (Sbc, Hl, Hl),
        16#63#           => (Inconnu, Aucun, Aucun),
        16#64#           => (Inconnu, Aucun, Aucun),
        16#65#           => (Inconnu, Aucun, Aucun),
        16#66#           => (Inconnu, Aucun, Aucun),
        16#67#           => (Rrd, A, Hl_Indirect),
        16#68#           => (Z80_In, L, C_Indirect),
        16#69#           => (Z80_Out, C_Indirect, L),
        16#6A#           => (Adc, Hl, Hl),
        16#6B#           => (Inconnu, Aucun, Aucun),
        16#6C#           => (Inconnu, Aucun, Aucun),
        16#6D#           => (Inconnu, Aucun, Aucun),
        16#6E#           => (Inconnu, Aucun, Aucun),
        16#6F#           => (Rld, A, Hl_Indirect),

        16#70#           => (Inconnu, Aucun, Aucun),
        16#71#           => (Inconnu, Aucun, Aucun),
        16#72#           => (Sbc, Hl, Sp),
        16#73#           => (Ld, Nn_Indirect, Sp),
        16#74#           => (Inconnu, Aucun, Aucun),
        16#75#           => (Inconnu, Aucun, Aucun),
        16#76#           => (Inconnu, Aucun, Aucun),
        16#77#           => (Inconnu, Aucun, Aucun),
        16#78#           => (Z80_In, A, C_Indirect),
        16#79#           => (Z80_Out, C_Indirect, A),
        16#7A#           => (Adc, Hl, Sp),
        16#7B#           => (Ld, Sp, Nn_Indirect),
        16#7C#           => (Inconnu, Aucun, Aucun),
        16#7D#           => (Inconnu, Aucun, Aucun),
        16#7E#           => (Inconnu, Aucun, Aucun),
        16#7F#           => (Inconnu, Aucun, Aucun),

        16#80# .. 16#9F# => (Inconnu, Aucun, Aucun),


        16#A0#           => (Ldi, De_Indirect, Hl_Indirect),
        16#A1#           => (Cpi, Hl_Indirect, Aucun),
        16#A2#           => (Ini, Hl_Indirect, C_Indirect),
        16#A3#           => (Outi, C_Indirect, Hl_Indirect),
        16#A4#           => (Inconnu, Aucun, Aucun),
        16#A5#           => (Inconnu, Aucun, Aucun),
        16#A6#           => (Inconnu, Aucun, Aucun),
        16#A7#           => (Inconnu, Aucun, Aucun),
        16#A8#           => (Ldd, De_Indirect, Hl_Indirect),
        16#A9#           => (Cpd, Hl_Indirect, Aucun),
        16#AA#           => (Ind, Hl_Indirect, C_Indirect),
        16#AB#           => (Outd, C_Indirect, Hl_Indirect),
        16#AC#           => (Inconnu, Aucun, Aucun),
        16#AD#           => (Inconnu, Aucun, Aucun),
        16#AE#           => (Inconnu, Aucun, Aucun),
        16#AF#           => (Inconnu, Aucun, Aucun),


        16#B0#           => (Ldir, De_Indirect, Hl_Indirect),
        16#B1#           => (Cpir, Hl_Indirect, Aucun),
        16#B2#           => (Inir, Hl_Indirect, C_Indirect),
        16#B3#           => (Otir, C_Indirect, Hl_Indirect),
        16#B4#           => (Inconnu, Aucun, Aucun),
        16#B5#           => (Inconnu, Aucun, Aucun),
        16#B6#           => (Inconnu, Aucun, Aucun),
        16#B7#           => (Inconnu, Aucun, Aucun),
        16#B8#           => (Lddr, De_Indirect, Hl_Indirect),
        16#B9#           => (Cpdr, Hl_Indirect, Aucun),
        16#BA#           => (Indr, Hl_Indirect, C_Indirect),
        16#BB#           => (Otdr, C_Indirect, Hl_Indirect),
        16#BC#           => (Inconnu, Aucun, Aucun),
        16#BD#           => (Inconnu, Aucun, Aucun),
        16#BE#           => (Inconnu, Aucun, Aucun),
        16#BF#           => (Inconnu, Aucun, Aucun),

        16#C0# .. 16#FF# => (Inconnu, Aucun, Aucun)

        );


    -- VARIABLES ------------------------------------------------------------

    Ed                  : Boolean              := False;
    Cb                  : Boolean              := False;
    Dd                  : Boolean              := False;
    Fd                  : Boolean              := False;
    Decodage_Complet    : Boolean              := False;
    Donnee_Lue          : Boolean              := False;
    Nb_Octet_Donnee     : Natural range 0 .. 2 := 0;  
    Instruction_Decodee : Instruction          := (Inconnu, Aucun, Aucun, 0);


    -- PROCEDURES -----------------------------------------------------------

    function Decode_Avec_Table_Ed (Code : Octet.T_Octet) return Boolean;
    function Decode_Cb (Code : Octet.T_Octet) return Boolean;
    function Decode_Avec_Table_Primaire (Code : Octet.T_Octet) return Boolean;
    function Test_Operande (Op_Gauche_Ou_Droit : Operande) return Operande;
    function Test_Operande_Cb (Op_Entree : Operande) return Operande;

    ---------------------------------------

    function Instruction_Trouvee return Instruction is
    begin
        if Decodage_Complet then
            return Instruction_Decodee;
        else
            --  Erreur.Detectee (1);
            null;
        end if;
    end Instruction_Trouvee;

    ---------------------------------------

    function Instruction_En_Texte return String is separate;


    ---------------------------------------

    -- function Instruction_En_Texte_Bis return String is separate;

    ---------------------------------------

    function Traiter_Code (Code : Octet.T_Octet) return Boolean is
    begin
        if Decodage_Complet then
            Decodage_Complet    := False;
            Ed                  := False;
            Cb                  := False;
            Dd                  := False;
            Fd                  := False;
            Nb_Octet_Donnee     := 0;
            Donnee_Lue          := False;
            Instruction_Decodee := (Inconnu, Aucun, Aucun, 0);
        end if;

        case Nb_Octet_Donnee is

            when 0 =>
                case Code is
                    when 16#ED# =>
                        if Cb then
                            Decodage_Complet := Decode_Cb (Code);
                        else
                            Ed := True;
                        end if;

                    when 16#CB# =>
                        if Cb then
                            Decodage_Complet := Decode_Cb (Code);
                        end if;
                        Cb := True;

                    when 16#DD# =>
                        if Cb then
                            Decodage_Complet := Decode_Cb (Code);
                        else
                            Dd := True;
                        end if;

                    when 16#FD# =>
                        if Cb then
                            Decodage_Complet := Decode_Cb (Code);
                        else
                            Fd := True;
                        end if;

                    when others =>
                        if Ed then
                            Decodage_Complet := Decode_Avec_Table_Ed (Code);
                        elsif Cb then
                            Decodage_Complet := Decode_Cb (Code);
                        else
                            Decodage_Complet :=
                               Decode_Avec_Table_Primaire (Code);
                        end if;
                end case;

            when 1 =>
                Instruction_Decodee.Donnee :=
                   Instruction_Decodee.Donnee + Mot.T_Mot (Code);
                Nb_Octet_Donnee            := 0;
                Decodage_Complet           := True;

            when 2 =>
                Instruction_Decodee.Donnee := Mot.T_Mot (Code) * 256;
                Nb_Octet_Donnee            := 1;
        end case;

        return Decodage_Complet;

    end Traiter_Code;


    ---------------------------------

    function Decode_Avec_Table_Ed (Code : Octet.T_Octet) return Boolean is

    begin

        Instruction_Decodee.Mnemo     := Table_Ed (Code).Mnemo;
        Instruction_Decodee.Op_Gauche :=
           Test_Operande (Table_Ed (Code).Op_Gauche);
        Instruction_Decodee.Op_Droit  :=
           Test_Operande (Table_Ed (Code).Op_Droit);

        return (Nb_Octet_Donnee = 0);

    end Decode_Avec_Table_Ed;


    ---------------------------------

    function Decode_Cb (Code : Octet.T_Octet) return Boolean is

        -- constantes -------------------------

        Tab_Registre : constant array (0 .. 7) of Operande :=
           (B, C, D, E, H, L, Hl_Indirect, A);
        Tab_Decalage : constant array (0 .. 7) of Mnemonic :=
           (Rlc, Rrc, Rl, Rr, Sla, Sra, Inconnu, Srl);
        Tab_Bit      : constant array (0 .. 7) of Operande :=
           (Bit_0, Bit_1, Bit_2, Bit_3, Bit_4, Bit_5, Bit_6, Bit_7);
        Tab_Mnemo    : constant array (0 .. 3) of Mnemonic :=
           (Inconnu, Bit, Res, Set);

    begin

        if ((Dd or Fd) and (not Donnee_Lue)) then  -- reste donnee + code a lire
            Instruction_Decodee.Donnee := Mot.T_Mot (Code);
            Donnee_Lue                 := True;
        else
            if (Code <= 16#3F#) then
                Instruction_Decodee.Mnemo     := Tab_Decalage (Code / 8);
                Instruction_Decodee.Op_Gauche :=
                   Test_Operande_Cb (Tab_Registre (Code mod 8));
            else
                Instruction_Decodee.Mnemo     := Tab_Mnemo (Code / 64);
                Instruction_Decodee.Op_Gauche := Tab_Bit ((Code mod 64) / 8);  
                Instruction_Decodee.Op_Droit  :=
                   Test_Operande_Cb (Tab_Registre (Code mod 8));
            end if;  
            Decodage_Complet := True;
        end if;  
        return Decodage_Complet;

    end Decode_Cb;


    ---------------------------------

    function Decode_Avec_Table_Primaire (Code : Octet.T_Octet) return Boolean is

    begin  
        Instruction_Decodee.Mnemo     := Table_Primaire (Code).Mnemo;
        Instruction_Decodee.Op_Gauche := Test_Operande
                                            (Table_Primaire (Code).Op_Gauche);
        Instruction_Decodee.Op_Droit  := Test_Operande
                                            (Table_Primaire (Code).Op_Droit);  
        return (Nb_Octet_Donnee = 0);

    end Decode_Avec_Table_Primaire;


    ---------------------------------

    function Test_Operande (Op_Gauche_Ou_Droit : Operande) return Operande is
        Op_Sortie : Operande := Op_Gauche_Ou_Droit;
    begin

        case Op_Gauche_Ou_Droit is

            when Nn | Nn_Indirect =>
                Nb_Octet_Donnee := 2;

            when N | N_Indirect | Offset_E =>
                Nb_Octet_Donnee := Nb_Octet_Donnee + 1;

            when Hl =>
                if Dd then
                    Op_Sortie := Ix;
                elsif Fd then
                    Op_Sortie := Iy;
                end if;

            when Hl_Indirect =>
                if Instruction_Decodee.Mnemo = Jp then
                    if Dd then
                        Op_Sortie := Ix_Indirect;
                    elsif Fd then
                        Op_Sortie := Iy_Indirect;
                    end if;
                else
                    if Dd then
                        Op_Sortie       := Ix_Plus_D_Indirect;
                        Nb_Octet_Donnee := Nb_Octet_Donnee + 1;
                    elsif Fd then
                        Op_Sortie       := Iy_Plus_D_Indirect;
                        Nb_Octet_Donnee := Nb_Octet_Donnee + 1;
                    end if;
                end if;

            when others =>
                null;

        end case;
        return Op_Sortie;

    end Test_Operande;


    ---------------------------------

    function Test_Operande_Cb (Op_Entree : Operande) return Operande is
        Op_Sortie : Operande := Op_Entree;
    begin
        if Op_Entree = Hl_Indirect then
            if Dd then
                Op_Sortie := Ix_Plus_D_Indirect;
            elsif Fd then
                Op_Sortie := Iy_Plus_D_Indirect;
            end if;
        end if;
        return Op_Sortie;

    end Test_Operande_Cb;


end Desassembleur;