Модуль для работы с портами микропроцессора с сохранением синтаксиса.
Работает под Win9x.
НЕ работает под WinNT.
//Copyright(c) 1998 Zolotarenko P.V pvz@mail.univ.kiev.ua unit Ports; interface Type TPort=class private procedure Set_(index_:word;value:byte);register; function Get_(index_:word):byte;register; public property Element[index_ :word]:byte read Get_ write Set_ ;default; end; TPortW=class private procedure Set_(index_:word;value:Word);register; function Get_(index_:word):word;register; public property Element[index_ :word]:word read Get_ write Set_ ;default; end; Var Port :TPort; PortW :TportW; implementation procedure TPort.Set_(index_:word;value:byte); begin asmmov dx,index_mov al,valueout dx,alend;end; function TPort.Get_(index_:word):byte; begin asmmov dx,index_in al,dxmov @Result,al end;end; procedure TPortW.Set_(index_:word;value:word); begin asm mov dx,index_mov ax,valueout dx,axend;end; function TPortW.Get_(index_:word):word; begin asm mov dx,index_in ax,dxmov @Result,axend;end; initialization Port:=TPort.Create;PortW:=TPortW.Create; finalization Port.free;PortW.free;end. |