Dans zcc096/test/hello.c, il y a des macros pour accéder aux ports d'entrée/sortie :
#define inb(p) asm("\tld\tbc,#" #p "\n\tin\ta,(c)\n")
#define outb(p) asm("\tld\tbc,#" #p "\n\tout\t(c),a\n")
#define outpi(p,v) asm("\tld\ta,#" #v "\n"); outb(p)
Donc, en réécrivant le code traduit par Brunni :
void NMI() {
char commande = inb(0x00);
if (commande != 0) {
if (commande & 0x80)
result = NMI_ProcessFM(commande);
else
result = NMI_ProcessADPCM(commande);
}
// Acknowledge?
outpi(0x0c, result);
}
Reste à savoir comment on définit une NMI.