was ist neu ¦  programmier tips ¦  indy artikel ¦  intraweb artikel ¦  informationen ¦  links ¦  interviews
 sonstiges ¦  tutorials ¦  Add&Win Gewinnspiel

Tips (1541)

Dateien (137)
Datenbanken (90)
Drucken (35)
Grafik (114)
IDE (21)
Indy (5)
Internet / LAN (130)
IntraWeb (0)
Mathematik (76)
Multimedia (45)
Oberfläche (107)
Objekte/
ActiveX (51)

OpenTools API (3)
Sonstiges (126)
Strings (83)
System (266)
VCL (242)

Tips sortiert nach
Komponente


Tip suchen

Tip hinzufügen

Add&Win Gewinnspiel

Werbung

38 Visitors Online


 
...Daten an den Druckerport ausgeben?
Autor: Ramon Schenkel
[ Tip ausdrucken ]  

Tip Bewertung (4):  
     


procedure Out32(portadresse: Word; wert: Byte);
var
  
val: Byte;
begin
  
val := Byte(wert);
  asm
    
push dx
    mov dx,portadresse
    mov al,val
    out dx,al
    pop dx
  end;
end;

function Inp32(portadresse: Word): Byte;
var
  
val: Byte;
begin
  asm
    
push dx
    mov dx,portadresse
    in al,dx
    mov val,al
    pop dx
  end;
  Inp32 := Byte(val) and $00ff;
end;


// Example/Beispiel:

  
Out32($378, 0)  {= Dataport all 8 Bit Low}
  
Out32($378, (Inp32($378) or 1); {Dataport Bit 1 High}
  
Out32($378, (Inp32($378) and 254);  {Datap. Bit 1, Low}


 

Bewerten Sie diesen Tipp:

dürftig
ausgezeichnet


Copyright © by SwissDelphiCenter.ch
All trademarks are the sole property of their respective owners