grafX2/cfg/KEYS.PAS
Adrien Destugues 306a004e36 First upload of the code.
git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@2 416bcca6-2ee7-4201-b75f-2eb2f807beb1
2007-04-14 20:18:30 +00:00

63 lines
855 B
Plaintext

var
Touche:word;
procedure Get_Key; assembler;
asm
mov Touche,0
mov ah,11h
int 16h
jz @Get_input_Pas_de_touche
mov ah,10h
int 16h
mov byte ptr[Touche],ah
mov ah,02h
int 16h
and al,00001111b
mov ah,al
and ah,00000001b
shr al,1
or al,ah
mov byte ptr[Touche+1],al
@Get_input_Pas_de_touche:
end;
const HEXA_ORDER:string='0123456789ABCDEF';
function Byte2Hexa(Valeur:byte):string;
var Temp:string;
begin
Temp:='';
while length(Temp)<2 do
begin
Temp:=HEXA_ORDER[(Valeur mod 16)+1]+Temp;
Valeur:=Valeur div 16;
end;
Byte2Hexa:=Temp;
end;
BEGIN
repeat
Get_Key;
if (Touche<>0)
then write('(',hi(Touche),',',Byte2Hexa(lo(Touche)),') ');
until Touche=$0001;
END.