•  Back 
  •  AES-Bindings 
  •  Index 
  •  Tree View 
  •  Cross references 
  •  Help page 
  •  Show info about hypertext 
  •  View a new file 
Topic       : TOS - das Betriebssystem
Author      : 
Version     : tos.hyp (5. März 2013)
Subject     : Programmieren/Atari
Nodes       : 3001
Index Size  : 93602
HCP-Version : 5
Compiled on : Atari
@charset    : atarist
@lang       : 
@default    : Titel
@help       : 
@options    : +g -i -s +x +zz -t4
@width      : 70
View Ref-File8.2.9.1  Beispiel-Binding für AES-Funktionen                       TOS

Die Funktion 'crys_if' (Crystal Interface) sorgt für die Besetzung des 
control-Arrays, und macht den eigentlichen AES-Aufruf. Dazu bedient 
sie sich einer Tabelle, in der für jede einzelne AES-Funktion die 
Werte für control[1], control[2] und control[3] vermerkt sind.

AESPB c;

int16_t crys_if (int16_t opcode)
{
  int16_t i, *paesb;

  control[0] = opcode;
  paespb = &ctrl_cnts[ (opcode-10)*3 ];

  for (i = 1; i < 4; i++)
    control[i] = *paespb++;

  aes (c);
  return (int_out[0]);

} /* crys_if */

Die dabei verwendete Tabelle könnte beispielsweise folgendermaßen 
aufgebaut sein:

.GLOBAL ctrl_cnts
.DATA

ctrl_cnts: .dc.b     0,  1,  0       ; appl_init
           .dc.b     2,  1,  1       ; appl_read
           .dc.b     2,  1,  1       ; appl_write
            ...
            ...
            ...

.END

Querverweis: AES-Bindings   GEM