Logo recovery Italia Numero Verde Recovery Italia
  Home  |  Recupero Dati  |  Listino Prezzi  |  Soluzioni Storage  |  Software  |  News  |  Contatti
Recupero Dati
Recupero Dati Hard Disk
Recupero dati Raid
Recupero dati Server
Recupero dati NAS
Recupero dati Camera Bianca
Oggi abbiamo recuperato
Listino Prezzi
Listino recupero dati
Procedura Recupero Dati
Tecnologia
Centro Diagnosi Recovery Italia
Libreria tecnica
DataSheets
Software Recupero Dati
Corsi e Training on Line
Azienda
Contatti
Laboratorio
Sedi ufficiali
Centri Autorizzati
Clienti

Lettura di un byte unsigned da registro

l’ applicazione tipica di tale funzione è la lettura dello stato di registro (che tratteremo in un altro articolo dettagliatamente)

Da notare il codice asm incapsulato nella funzione C e l’ utilizzo della macro (decisamente obsoleta) MK_FP.






unsigned char pio_inbyte( unsigned int addr )

{
unsigned int regAddr;
unsigned char uc;
unsigned char far * ucp;

regAddr = pio_reg_addrs[ addr ];
if ( pio_memory_seg )
{
ucp = (unsigned char far *) MK_FP( pio_memory_seg, regAddr );
uc = * ucp;
}
else
{
// uc = (unsigned char) inportb( regAddr );

// READ THIS: If you get a compile error on the following
// statement you are trying to use BASM (the assembler
// built into Borland C). BASM can not assemble 386
// instructions. You must use Borland TASM as is shown
// in the EXAMPLE1.MAK or EXAMPLE2.MAK "make files".

asm .386

asm push ax
asm push dx

asm mov dx,regAddr

asm in al,dx
asm mov uc,al

asm pop dx
asm pop ax

}
pio_last_read[ addr ] = uc;
trc_llt( addr, uc, TRC_LLT_INB );
return uc;
}


Valid HTML 4.01 Transitional CSS Valido! Level A conformance icon, W3C-WAI Web Content Accessibility Guidelines 1.0