DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400

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

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦bb7a57f6e⟧ TextFile

    Length: 23153 (0x5a71)
    Types: TextFile
    Notes: R1k Text-file segment

Derivation

└─⟦8527c1e9b⟧ Bits:30000544 8mm tape, Rational 1000, Arrival backup of disks in PAM's R1000
    └─ ⟦cfc2e13cd⟧ »Space Info Vol 2« 
        └─⟦7623a8d30⟧ 
            └─⟦this⟧ 

TextFile

package MACHINE_CODE is

  -- Description for the MC68000, MC68010, CPU32, MC68020, MC68030, MC68040,
  -- MC68851, and MC68881/MC68882.

  pragma suppress(ALL_CHECKS);
  pragma suppress(EXCEPTION_TABLES);
  pragma not_elaborated;

  type opcode is (
    abcd, abcd_b, add_b, add_w, add_l, adda_w, adda_l, addi_b, addi_w, addi_l,
    addq_b, addq_w, addq_l, addx_b, addx_w, addx_l, and_b, and_w, and_l, andi_b,
    andi_w, andi_l, asl_b, asl_w, asl_l, asr_b, asr_w, asr_l, bcc, bcs, beq,
    bge, bgt, bhi, ble, bls, blt, bmi, bne, bpl, bvc, bvs, bchg_b, bchg_l,
    bclr_b, bclr_l, bfchg, bfclr, bfexts, bfextu, bfffo, bfins, bfset, bftst,
    bgnd, bkpt, bra, bset_b, bset_l, bsr, btst_b, btst_l, callm, cas_b, cas_w,
    cas_l, cas2_w, cas2_l, chk_w, chk_l, chk2_b, chk2_w, chk2_l, cinvl, cinvp,
    cinva, cpushl, cpushp, cpusha, clr_b, clr_w, clr_l, cmp_b, cmp_w, cmp_l,
    cmpa_w, cmpa_l, cmpi_b, cmpi_w, cmpi_l, cmpm_b, cmpm_w, cmpm_l, cmp2_b,
    cmp2_w, cmp2_l, dbcc, dbcs, dbeq, dbf, dbge, dbgt, dbhi, dble, dbls, dblt,
    dbmi, dbne, dbpl, dbt, dbvc, dbvs, divs_w, divs_l, divsl_l, divu_w, divu_l,
    divul_l, eor_b, eor_w, eor_l, eori_b, eori_w, eori_l, exg, exg_l, ext_w,
    ext_l, extb_l, illegal, jmp, jsr, lea, lea_l, link_w, link_l, lpstop, lsl_b,
    lsl_w, lsl_l, lsr_b, lsr_w, lsr_l, move16, move_b, move_w, move_l, movea_w,
    movea_l, movec, movec_l, movem_w, movem_l, movep_w, movep_l, moveq, moveq_l,
    moves_b, moves_w, moves_l, muls_w, muls_l, mulu_w, mulu_l, nbcd, nbcd_b,
    neg_b, neg_w, neg_l, negx_b, negx_w, negx_l, nop, not_b, not_w, not_l, or_b,
    or_w, or_l, ori_b, ori_w, ori_l, pack, pea, pea_l, reset, rol_b, rol_w,
    rol_l, ror_b, ror_w, ror_l, roxl_b, roxl_w, roxl_l, roxr_b, roxr_w, roxr_l,
    rtd, rte, rtm, rtr, rts, sbcd, sbcd_b, scc, scs, seq, sf, sge, sgt, shi,
    sle, sls, slt, smi, sne, spl, st, svc, svs, scc_b, scs_b, seq_b, sf_b,
    sge_b, sgt_b, shi_b, sle_b, sls_b, slt_b, smi_b, sne_b, spl_b, st_b, svc_b,
    svs_b, stop, sub_b, sub_w, sub_l, suba_w, suba_l, subi_b, subi_w, subi_l,
    subq_b, subq_w, subq_l, subx_b, subx_w, subx_l, swap, swap_w, tas, tas_b,
    tbls_b, tbls_w, tbls_l, tblsn_b, tblsn_w, tblsn_l, tblu_b, tblu_w, tblu_l,
    tblun_b, tblun_w, tblun_l, trap, trapcc, trapcs, trapeq, trapf, trapge,
    trapgt, traphi, traple, trapls, traplt, trapmi, trapne, trappl, trapt,
    trapvc, trapvs, trapcc_w, trapcs_w, trapeq_w, trapf_w, trapge_w, trapgt_w,
    traphi_w, traple_w, trapls_w, traplt_w, trapmi_w, trapne_w, trappl_w,
    trapt_w, trapvc_w, trapvs_w, trapcc_l, trapcs_l, trapeq_l, trapf_l,
    trapge_l, trapgt_l, traphi_l, traple_l, trapls_l, traplt_l, trapmi_l,
    trapne_l, trappl_l, trapt_l, trapvc_l, trapvs_l, trapv, tst_b, tst_w, tst_l,
    unlk, unpk, pbbs, pbbc, pbls, pblc, pbss, pbsc, pbas, pbac, pbws, pbwc,
    pbis, pbic, pbgs, pbgc, pbcs, pbcc, pdbbs, pdbbc, pdbls, pdblc, pdbss,
    pdbsc, pdbas, pdbac, pdbws, pdbwc, pdbis, pdbic, pdbgs, pdbgc, pdbcs, pdbcc,
    pflusha, pflush, pflushan, pflushn, pflushs, pflushr, ploadr, ploadw,
    pmove_b, pmove_w, pmove_l, pmove_q, pmovefd_w, pmovefd_l, pmovefd_q,
    prestore, psave, psbs, psbc, psls, pslc, psss, pssc, psas, psac, psws, pswc,
    psis, psic, psgs, psgc, pscs, pscc, psbs_b, psbc_b, psls_b, pslc_b, psss_b,
    pssc_b, psas_b, psac_b, psws_b, pswc_b, psis_b, psic_b, psgs_b, psgc_b,
    pscs_b, pscc_b, ptestr, ptestw, ptrapbs, ptrapbc, ptrapls, ptraplc, ptrapss,
    ptrapsc, ptrapas, ptrapac, ptrapws, ptrapwc, ptrapis, ptrapic, ptrapgs,
    ptrapgc, ptrapcs, ptrapcc, ptrapbs_w, ptrapbc_w, ptrapls_w, ptraplc_w,
    ptrapss_w, ptrapsc_w, ptrapas_w, ptrapac_w, ptrapws_w, ptrapwc_w, ptrapis_w,
    ptrapic_w, ptrapgs_w, ptrapgc_w, ptrapcs_w, ptrapcc_w, ptrapbs_l, ptrapbc_l,
    ptrapls_l, ptraplc_l, ptrapss_l, ptrapsc_l, ptrapas_l, ptrapac_l, ptrapws_l,
    ptrapwc_l, ptrapis_l, ptrapic_l, ptrapgs_l, ptrapgc_l, ptrapcs_l, ptrapcc_l,
    pvalid, pvalid_l, fabs_b, fabs_w, fabs_l, fabs_s, fabs_d, fabs_x, fabs_p,
    fsabs_b, fsabs_w, fsabs_l, fsabs_s, fsabs_d, fsabs_x, fsabs_p, fdabs_b,
    fdabs_w, fdabs_l, fdabs_s, fdabs_d, fdabs_x, fdabs_p, facos_b, facos_w,
    facos_l, facos_s, facos_d, facos_x, facos_p, fsadd_b, fsadd_w, fsadd_l,
    fsadd_s, fsadd_d, fsadd_x, fsadd_p, fdadd_b, fdadd_w, fdadd_l, fdadd_s,
    fdadd_d, fdadd_x, fdadd_p, fadd_b, fadd_w, fadd_l, fadd_s, fadd_d, fadd_x,
    fadd_p, fasin_b, fasin_w, fasin_l, fasin_s, fasin_d, fasin_x, fasin_p,
    fatan_b, fatan_w, fatan_l, fatan_s, fatan_d, fatan_x, fatan_p, fatanh_b,
    fatanh_w, fatanh_l, fatanh_s, fatanh_d, fatanh_x, fatanh_p, fbeq, fbne,
    fbgt, fbngt, fbge, fbnge, fblt, fbnlt, fble, fbnle, fbgl, fbngl, fbgle,
    fbngle, fbogt, fbule, fboge, fbult, fbolt, fbuge, fbole, fbugt, fbogl,
    fbueq, fbor, fbun, fbf, fbt, fbsf, fbst, fbseq, fbsne, fcmp_b, fcmp_w,
    fcmp_l, fcmp_s, fcmp_d, fcmp_x, fcmp_p, fcos_b, fcos_w, fcos_l, fcos_s,
    fcos_d, fcos_x, fcos_p, fcosh_b, fcosh_w, fcosh_l, fcosh_s, fcosh_d,
    fcosh_x, fcosh_p, fdbeq, fdbne, fdbgt, fdbngt, fdbge, fdbnge, fdblt, fdbnlt,
    fdble, fdbnle, fdbgl, fdbngl, fdbgle, fdbngle, fdbogt, fdbule, fdboge,
    fdbult, fdbolt, fdbuge, fdbole, fdbugt, fdbogl, fdbueq, fdbor, fdbun, fdbf,
    fdbt, fdbsf, fdbst, fdbseq, fdbsne, fdiv_b, fdiv_w, fdiv_l, fdiv_s, fdiv_d,
    fdiv_x, fdiv_p, fsdiv_b, fsdiv_w, fsdiv_l, fsdiv_s, fsdiv_d, fsdiv_x,
    fsdiv_p, fddiv_b, fddiv_w, fddiv_l, fddiv_s, fddiv_d, fddiv_x, fddiv_p,
    fetox_b, fetox_w, fetox_l, fetox_s, fetox_d, fetox_x, fetox_p, fetoxm1_b,
    fetoxm1_w, fetoxm1_l, fetoxm1_s, fetoxm1_d, fetoxm1_x, fetoxm1_p, fgetexp_b,
    fgetexp_w, fgetexp_l, fgetexp_s, fgetexp_d, fgetexp_x, fgetexp_p, fgetman_b,
    fgetman_w, fgetman_l, fgetman_s, fgetman_d, fgetman_x, fgetman_p, fint_b,
    fint_w, fint_l, fint_s, fint_d, fint_x, fint_p, fintrz_b, fintrz_w,
    fintrz_l, fintrz_s, fintrz_d, fintrz_x, fintrz_p, flog10_b, flog10_w,
    flog10_l, flog10_s, flog10_d, flog10_x, flog10_p, flog2_b, flog2_w, flog2_l,
    flog2_s, flog2_d, flog2_x, flog2_p, flogn_b, flogn_w, flogn_l, flogn_s,
    flogn_d, flogn_x, flogn_p, flognp1_b, flognp1_w, flognp1_l, flognp1_s,
    flognp1_d, flognp1_x, flognp1_p, fmod_b, fmod_w, fmod_l, fmod_s, fmod_d,
    fmod_x, fmod_p, fsmove_b, fsmove_w, fsmove_l, fsmove_s, fsmove_d, fsmove_x,
    fsmove_p, fdmove_b, fdmove_w, fdmove_l, fdmove_s, fdmove_d, fdmove_x,
    fdmove_p, fmove_b, fmove_w, fmove_l, fmove_s, fmove_d, fmove_x, fmove_p,
    fmovecr_x, fmovem_l, fmovem_x, fsmul_b, fsmul_w, fsmul_l, fsmul_s, fsmul_d,
    fsmul_x, fsmul_p, fdmul_b, fdmul_w, fdmul_l, fdmul_s, fdmul_d, fdmul_x,
    fdmul_p, fmul_b, fmul_w, fmul_l, fmul_s, fmul_d, fmul_x, fmul_p, fsneg_b,
    fsneg_w, fsneg_l, fsneg_s, fsneg_d, fsneg_x, fsneg_p, fdneg_b, fdneg_w,
    fdneg_l, fdneg_s, fdneg_d, fdneg_x, fdneg_p, fneg_b, fneg_w, fneg_l, fneg_s,
    fneg_d, fneg_x, fneg_p, fnop, frem_b, frem_w, frem_l, frem_s, frem_d,
    frem_x, frem_p, frestore, fsave, fscale_b, fscale_w, fscale_l, fscale_s,
    fscale_d, fscale_x, fscale_p, fseq, fsne, fsgt, fsngt, fsge, fsnge, fslt,
    fsnlt, fsle, fsnle, fsgl, fsngl, fsgle, fsngle, fsogt, fsule, fsoge, fsult,
    fsolt, fsuge, fsole, fsugt, fsogl, fsueq, fsor, fsun, fsf, fst, fssf, fsst,
    fsseq, fssne, fseq_b, fsne_b, fsgt_b, fsngt_b, fsge_b, fsnge_b, fslt_b,
    fsnlt_b, fsle_b, fsnle_b, fsgl_b, fsngl_b, fsgle_b, fsngle_b, fsogt_b,
    fsule_b, fsoge_b, fsult_b, fsolt_b, fsuge_b, fsole_b, fsugt_b, fsogl_b,
    fsueq_b, fsor_b, fsun_b, fsf_b, fst_b, fssf_b, fsst_b, fsseq_b, fssne_b,
    fsgldiv_b, fsgldiv_w, fsgldiv_l, fsgldiv_s, fsgldiv_d, fsgldiv_x, fsgldiv_p,
    fsglmul_b, fsglmul_w, fsglmul_l, fsglmul_s, fsglmul_d, fsglmul_x, fsglmul_p,
    fsin_b, fsin_w, fsin_l, fsin_s, fsin_d, fsin_x, fsin_p, fsincos_b,
    fsincos_w, fsincos_l, fsincos_s, fsincos_d, fsincos_x, fsincos_p, fsinh_b,
    fsinh_w, fsinh_l, fsinh_s, fsinh_d, fsinh_x, fsinh_p, fssqrt_b, fssqrt_w,
    fssqrt_l, fssqrt_s, fssqrt_d, fssqrt_x, fssqrt_p, fdsqrt_b, fdsqrt_w,
    fdsqrt_l, fdsqrt_s, fdsqrt_d, fdsqrt_x, fdsqrt_p, fsqrt_b, fsqrt_w, fsqrt_l,
    fsqrt_s, fsqrt_d, fsqrt_x, fsqrt_p, fssub_b, fssub_w, fssub_l, fssub_s,
    fssub_d, fssub_x, fssub_p, fdsub_b, fdsub_w, fdsub_l, fdsub_s, fdsub_d,
    fdsub_x, fdsub_p, fsub_b, fsub_w, fsub_l, fsub_s, fsub_d, fsub_x, fsub_p,
    ftan_b, ftan_w, ftan_l, ftan_s, ftan_d, ftan_x, ftan_p, ftanh_b, ftanh_w,
    ftanh_l, ftanh_s, ftanh_d, ftanh_x, ftanh_p, ftentox_b, ftentox_w,
    ftentox_l, ftentox_s, ftentox_d, ftentox_x, ftentox_p, ftrapeq, ftrapne,
    ftrapgt, ftrapngt, ftrapge, ftrapnge, ftraplt, ftrapnlt, ftraple, ftrapnle,
    ftrapgl, ftrapngl, ftrapgle, ftrapngle, ftrapogt, ftrapule, ftrapoge,
    ftrapult, ftrapolt, ftrapuge, ftrapole, ftrapugt, ftrapogl, ftrapueq,
    ftrapor, ftrapun, ftrapf, ftrapt, ftrapsf, ftrapst, ftrapseq, ftrapsne,
    ftrapeq_w, ftrapne_w, ftrapgt_w, ftrapngt_w, ftrapge_w, ftrapnge_w,
    ftraplt_w, ftrapnlt_w, ftraple_w, ftrapnle_w, ftrapgl_w, ftrapngl_w,
    ftrapgle_w, ftrapngle_w, ftrapogt_w, ftrapule_w, ftrapoge_w, ftrapult_w,
    ftrapolt_w, ftrapuge_w, ftrapole_w, ftrapugt_w, ftrapogl_w, ftrapueq_w,
    ftrapor_w, ftrapun_w, ftrapf_w, ftrapt_w, ftrapsf_w, ftrapst_w, ftrapseq_w,
    ftrapsne_w, ftrapeq_l, ftrapne_l, ftrapgt_l, ftrapngt_l, ftrapge_l,
    ftrapnge_l, ftraplt_l, ftrapnlt_l, ftraple_l, ftrapnle_l, ftrapgl_l,
    ftrapngl_l, ftrapgle_l, ftrapngle_l, ftrapogt_l, ftrapule_l, ftrapoge_l,
    ftrapult_l, ftrapolt_l, ftrapuge_l, ftrapole_l, ftrapugt_l, ftrapogl_l,
    ftrapueq_l, ftrapor_l, ftrapun_l, ftrapf_l, ftrapt_l, ftrapsf_l, ftrapst_l,
    ftrapseq_l, ftrapsne_l, ftst_b, ftst_w, ftst_l, ftst_s, ftst_d, ftst_x,
    ftst_p, ftwotox_b, ftwotox_w, ftwotox_l, ftwotox_s, ftwotox_d, ftwotox_x,
    ftwotox_p
  );

  type size is (
    byte, word, long);

  type operand is private;

  type operand_seq is array (positive range <>) of operand;
  n: positive;

  --
  --  Instruction formats.
  --

  type code_0 (op: opcode) is
    record
      null;
    end record;

  type code_1 (op: opcode) is
    record
      oprnd_1: operand;
    end record;

  type code_2 (op: opcode) is
    record
      oprnd_1: operand;
      oprnd_2: operand;
    end record;

  type code_3 (op: opcode) is
    record
      oprnd_1: operand;
      oprnd_2: operand;
      oprnd_3: operand;
    end record;

  type code_4 (op: opcode) is
    record
      oprnd_1: operand;
      oprnd_2: operand;
      oprnd_3: operand;
      oprnd_4: operand;
    end record;

  type code_6 (op: opcode) is
    record
      oprnd_1: operand;
      oprnd_2: operand;
      oprnd_3: operand;
      oprnd_4: operand;
      oprnd_5: operand;
      oprnd_6: operand;
    end record;

  --
  --  Data formats.
  --

  type data_1 (sz: size) is
    record
      oprnd_1: operand;
    end record;

  type data_n (sz: size) is
    record
      oprnd_n: operand_seq (1..n);
    end record;

  --
  --  Call formats.
  --

  type call_0 is
    record
      subp: operand;
    end record;

  type call_1 is
    record
      subp:    operand;
      oprnd_1: operand;
    end record;

  type call_n is
    record
      subp:    operand;
      oprnd_n: operand_seq (1..n);
    end record;

  --
  --  Registers.
  --

  d0: constant operand;
  d1: constant operand;
  d2: constant operand;
  d3: constant operand;
  d4: constant operand;
  d5: constant operand;
  d6: constant operand;
  d7: constant operand;

  a0: constant operand;
  a1: constant operand;
  a2: constant operand;
  a3: constant operand;
  a4: constant operand;
  a5: constant operand;
  a6: constant operand;
  a7: constant operand;

  sp: constant operand;

  -- Floating point registers.
  fp0: constant operand;
  fp1: constant operand;
  fp2: constant operand;
  fp3: constant operand;
  fp4: constant operand;
  fp5: constant operand;
  fp6: constant operand;
  fp7: constant operand;

  -- Status and Control registers.
  pc  : constant operand;
  sr  : constant operand;
  ccr : constant operand;
  sfc : constant operand;
  dfc : constant operand;
  cacr: constant operand;
  usp : constant operand;
  vbr : constant operand;
  caar: constant operand;
  msp : constant operand;
  isp : constant operand;

  -- Floating-point status registers.
  fpcr : constant operand;
  fpsr : constant operand;
  fpiar: constant operand;

  --  Suppresed registers.
  zd0: constant operand;
  zd1: constant operand;
  zd2: constant operand;
  zd3: constant operand;
  zd4: constant operand;
  zd5: constant operand;
  zd6: constant operand;
  zd7: constant operand;

  za0: constant operand;
  za1: constant operand;
  za2: constant operand;
  za3: constant operand;
  za4: constant operand;
  za5: constant operand;
  za6: constant operand;
  za7: constant operand;

  zpc: constant operand;

  --  MC68851 registers.
  crp : constant operand;
  drp : constant operand;
  srp : constant operand;
  tc  : constant operand;
  pcsr: constant operand;
  psr : constant operand;
  cal : constant operand;
  val : constant operand;
  sccr: constant operand;
  ac  : constant operand;
  bad0: constant operand;
  bad1: constant operand;
  bad2: constant operand;
  bad3: constant operand;
  bad4: constant operand;
  bad5: constant operand;
  bad6: constant operand;
  bad7: constant operand;
  bac0: constant operand;
  bac1: constant operand;
  bac2: constant operand;
  bac3: constant operand;
  bac4: constant operand;
  bac5: constant operand;
  bac6: constant operand;
  bac7: constant operand;

  mmusr: constant operand;  -- MC68030 psr
  tt0  : constant operand;  -- MC68030
  tt1  : constant operand;  -- MC68030

  itt0 : constant operand;  -- MC68040
  itt1 : constant operand;  -- MC68040
  dtt0 : constant operand;  -- MC68040
  dtt1 : constant operand;  -- MC68040
  urp  : constant operand;  -- MC68040

  nc   : constant operand;  -- MC68040 CINV/CPUSH no cache
  dc   : constant operand;  -- MC68040 CINV/CPUSH data cache
  ic   : constant operand;  -- MC68040 CINV/CPUSH instruction cache
  bc   : constant operand;  -- MC68040 CINV/CPUSH data & instruction cache

  --
  --  MC68881 on-chip ROM offsets.
  --

  pi:       constant := 16#00#;
  log10_2:  constant := 16#0B#;
  e:        constant := 16#0C#;
  log2_e:   constant := 16#0D#;
  log10_e:  constant := 16#0E#;
  zero:     constant := 16#0F#;
  ln_2:     constant := 16#30#;
  ln_10:    constant := 16#31#;
  tenE0:    constant := 16#32#;
  tenE1:    constant := 16#33#;
  tenE2:    constant := 16#34#;
  tenE4:    constant := 16#35#;
  tenE8:    constant := 16#36#;
  tenE16:   constant := 16#37#;
  tenE32:   constant := 16#38#;
  tenE64:   constant := 16#39#;
  tenE128:  constant := 16#3A#;
  tenE256:  constant := 16#3B#;
  tenE512:  constant := 16#3C#;
  tenE1024: constant := 16#3D#;
  tenE2048: constant := 16#3E#;
  tenE4096: constant := 16#3F#;

  --
  --  Addressing modes.
  --

  function W return size renames word;
  function L return size renames long;

  function indr (
      addr_reg: operand)
    return operand;

    -- Assembler Notation:
    --   (An)
    --
    -- Description:
    --   The address of the operand is in the address register specified
    --   by the register field.

  function incr (
      addr_reg: operand)
    return operand;

    -- Assembler Notation:
    --   (An)+
    --
    -- Description:
    --   The address of the operand is in the address register specified
    --   by the register field.  After the operand address is used, it is
    --   incremented by one, two, or four depending upon whether the size
    --   of the operand is byte, word, or long word.  If the address register
    --   is the stack pointer and the operand size is byte, the address is
    --   incremented by two rather than one to keep the stack pointer on a
    --   word boundary.

  function decr (
      addr_reg: operand)
    return operand;

    -- Assembler Notation:
    --   -(An)
    --
    -- Description:
    --   The address of the operand is in the address register specified
    --   by the register field.  Before the operand address is used, it is
    --   decremented by one, two, or four depending upon whether the size
    --   of the operand is byte, word, or long word.  If the address register
    --   is the stack pointer and the operand size is byte, the address is
    --   decremented by two rather than one to keep the stack pointer on a
    --   word boundary.

  function disp (
      reg: operand;
      int: integer)
    return operand;

  function disp (
      reg: operand;
      lab: operand)
    return operand;

    -- Assembler Notation:
    --   d(An)
    --   d(PC)
    --
    -- Description:
    --   The address of the operand is the sum of the address in the address
    --   register or PC and the sign-extended 16-bit displacement.

  function index (
      reg:        operand;
      int:        integer;
      index_reg:  operand;
      index_size: size;
      scale:      integer := 1)
    return operand;

  function index (
      reg:        operand;
      lab:        operand;
      index_reg:  operand;
      index_size: size;
      scale:      integer := 1)
    return operand;

    -- Assembler Notation:
    --   d(An, Rn.SIZE*SCALE)
    --   d(PC, Rn.SIZE*SCALE)
    --
    -- Description:
    --   The address of the operand is the sum of the address in the address
    --   register or PC, the 8-bit displacement, and the contents of the
    --   index register (possibly scaled).

  function memory (
      pre_mem: operand;
      od:      integer := 0)
    return operand;

    -- Assembler Notation:
    --   ([bd,An,Ri.SIZE{*SCALE}],od)
    --   ([bd,PC,Ri.SIZE{*SCALE}],od)
    --
    -- Description:
    --   The address of the operand is the sum of the pre_mem and a sign-
    --   extended outer displacement value od.  pre_mem is the sum of the
    --   contents of the address register An (or ZAn), the base displacement,
    --   and the contents of the index register Ri (or ZRi).

  function memory (
      post_mem:   operand;
      index_reg:  operand;
      index_size: size;
      scale:      integer := 1;
      od:         integer := 0)
    return operand;

    -- Assembler Notation:
    --   ([bd,An],od,Ri.SIZE{*SCALE})
    --   ([bd,PC],od,Ri.SIZE{*SCALE})
    --
    -- Description:
    --   The address of the operand is the sum of the post_mem, the contents
    --   of the index register Ri (or ZRi), and the outer displacement value
    --   od.  post_mem is the sum of the base displacement and the contents
    --   of the the base register An (or ZAn).

  function absol (
      addr:      integer;
      addr_size: size)
    return operand;

    -- Assembler Notation:
    --   xxx.W
    --   xxx.L
    --
    -- Description:
    --   The address of the operand is given.

  function immed (
      val: integer)
    return operand;

  function immed (
      val: float)
    return operand;

  function immed (
      val: character)
    return operand;

  function "+" (
      right: integer)
    return operand;

  function "-" (
      right: integer)
    return operand;

  function "+" (
      right: float)
    return operand;

  function "-" (
      right: float)
    return operand;

  function "/" (
      left : operand;
      right: operand)
    return operand;

    -- Assembler Notation:
    --   <list>
    --
    -- Description:
    --   A list of any combination of registers to form a mask.
    --   May only be used in the 'movem' and 'fmovem' instructions.

  function ext (
      name: string;
      disp: integer := 0)
    return operand;

    -- Assembler Notation:
    --   name
    --
    -- Description:
    --   The name denotes an external symbol.  The displacement is added to
	--   the value of name.

  function "-" (
      left, right: operand)
    return operand;

    -- Description:
    --   Calculates the difference between two labels.

private

  --
  --  Implementation specific.
  --

  for size use (byte=> 8, word=> 16, long=> 32);

  type operand is new integer;

  d0: constant operand :=  0;
  d1: constant operand :=  1;
  d2: constant operand :=  2;
  d3: constant operand :=  3;
  d4: constant operand :=  4;
  d5: constant operand :=  5;
  d6: constant operand :=  6;
  d7: constant operand :=  7;

  a0: constant operand :=  8;
  a1: constant operand :=  9;
  a2: constant operand := 10;
  a3: constant operand := 11;
  a4: constant operand := 12;
  a5: constant operand := 13;
  a6: constant operand := 14;
  a7: constant operand := 15;

  sp: constant operand := a7;

  fp0: constant operand := 16;
  fp1: constant operand := 17;
  fp2: constant operand := 18;
  fp3: constant operand := 19;
  fp4: constant operand := 20;
  fp5: constant operand := 21;
  fp6: constant operand := 22;
  fp7: constant operand := 23;

  pc   : constant operand := 24;
  sr   : constant operand := 25;
  ccr  : constant operand := 26;
  sfc  : constant operand := 27;
  dfc  : constant operand := 28;
  cacr : constant operand := 29;
  usp  : constant operand := 30;
  vbr  : constant operand := 31;
  caar : constant operand := 32;
  msp  : constant operand := 33;
  isp  : constant operand := 34;
  fpcr : constant operand := 35;
  fpsr : constant operand := 36;
  fpiar: constant operand := 37;

  zd0: constant operand := 38;
  zd1: constant operand := 38;
  zd2: constant operand := 38;
  zd3: constant operand := 38;
  zd4: constant operand := 38;
  zd5: constant operand := 38;
  zd6: constant operand := 38;
  zd7: constant operand := 38;

  za0: constant operand := 38;
  za1: constant operand := 38;
  za2: constant operand := 38;
  za3: constant operand := 38;
  za4: constant operand := 38;
  za5: constant operand := 38;
  za6: constant operand := 38;
  za7: constant operand := 38;

  zpc: constant operand := 39;

  crp : constant operand := 40;
  drp : constant operand := 41;
  srp : constant operand := 42;
  tc  : constant operand := 43;
  pcsr: constant operand := 44;
  psr : constant operand := 45;
  cal : constant operand := 46;
  val : constant operand := 47;
  sccr: constant operand := 48;
  ac  : constant operand := 49;
  bad0: constant operand := 50;
  bad1: constant operand := 51;
  bad2: constant operand := 52;
  bad3: constant operand := 53;
  bad4: constant operand := 54;
  bad5: constant operand := 55;
  bad6: constant operand := 56;
  bad7: constant operand := 57;
  bac0: constant operand := 58;
  bac1: constant operand := 59;
  bac2: constant operand := 60;
  bac3: constant operand := 61;
  bac4: constant operand := 62;
  bac5: constant operand := 63;
  bac6: constant operand := 64;
  bac7: constant operand := 65;

  tt0  : constant operand := 66;
  tt1  : constant operand := 67;

  itt0 : constant operand := 68;
  itt1 : constant operand := 69;
  dtt0 : constant operand := 70;
  dtt1 : constant operand := 71;
  urp  : constant operand := 72;
  mmusr: constant operand := 73;

  nc   : constant operand := 76;  -- MC68040 CINV/CPUSH no cache
  dc   : constant operand := 77;  -- MC68040 CINV/CPUSH data cache
  ic   : constant operand := 78;  -- MC68040 CINV/CPUSH instruction cache
  bc   : constant operand := 79;  -- MC68040 CINV/CPUSH data & instruction cache

end MACHINE_CODE;

pragma Built_in (MACHINE_CODE)