delphi & assembler

variabel out 32
===============
function Inp32(alamat:word):byte; stdcall;external'ace.dll';
procedure Out32(alamat:word;data:byte):byte;stdcall;external'ace.dll';


variabel tempo
==============
procedure tempo(lama:word);
var temp:dword;
begin
temp:=GetTickCount;
repeat
Application.ProcessMessages;
until(GetTickCount-temp)>=lama
end;


logika port $378
================
1,2,4,8,16,32,64,128,255

pengulangan
===========
var i:integer;
begin
for i:=1 to 3 do
begin

a
f | g | b

e | | c
d

exit
====

application.terminate;


input
=====

procedure TForm1.Timer3Timer(Sender: TObject);
begin
begin
If (label4.Caption='1') or (label4.Caption='127')
or (label4.Caption='65')or (label4.Caption='255')
or (label4.Caption='')then
begin
L1.Brush.Color:=clred;
end
else
L1.Brush.Color:=clwhite
end;


* assembler
===========
function portin(alamat:word):byte;assembler;
var
data:byte;
begin
asm
mov dx,alamat
in al,dx
mov data,al
end;
portin:=data;
end;

procedure portOut(alamat:word;data:byte);
begin
asm
mov dx,alamat
mov al,data
out dx,al
end;
end;
0 Responses

Posting Komentar

abcs