whats new ¦  programming tips ¦  indy articles ¦  intraweb articles ¦  informations ¦  links ¦  interviews ¦  misc ¦  forum
 kylix ¦  tutorials ¦  online shop ¦  photos ¦  Add&Win Game

Tips (1565)

Database (91)
Files (139)
Forms (113)
Graphic (116)
IDE (21)
Indy (5)
Internet / LAN (133)
IntraWeb (0)
Kylix (10)
Math (77)
Misc (128)
Multimedia (46)
Objects/
ActiveX (51)

OpenTools API (3)
Printing (35)
Strings (83)
System (268)
VCL (246)

Top15

Tips sort by
component


Search Tip

Add new Tip

Add&Win Game

Advertising

37 Visitors Online


SwissDelphiCenter is a Borland Technology Partner
 
...write data to the printer port?
Autor: Ramon Schenkel
[ Print tip ]  

Tip Rating (0):  
     


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}


 

Rate this tip:

poor
very good


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