home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power Programming
/
powerprogramming1994.iso
/
progtool
/
tex
/
webtp55.arc
/
ASMDEMO.WEB
< prev
next >
Wrap
Text File
|
1989-11-29
|
925b
|
39 lines
% This is ASMDEMO.WEB
% Simple demo to show the inline-assembler in Tangle TP55
% 29-Nov-89 Peter Sawatzki
%
% Tangle instructions:
% TANGLE ASMDEMO /c
% ^---- include comments
%
@* TANGLE TP55 Test
@d Asm(#)==inline(@[#@])
@d NoOp==Asm(nop)
@d IntOff==Asm(cli)
@d IntOn==Asm(sti)
@d Keyboard==int $16
@p program InlTest;
var
Key: Word;
begin
WriteLn('This Program is a silly test for Tangle Inline/TP55');
NoOp; {just for fun}
IntOff;
IntOn;
Write('Press a key: ');
Asm(mov ah,0/ {subfunction 0, read char}
Keyboard/ {keyboard - read char from buffer}
mov [>Key],ax);
WriteLn(' -> ',Char(Lo(Key)),' ScanCode: ',Hi(Key));
Write('Another key to quit:');
Asm(lp: mov ah,1/ {wait for keystroke}
Keyboard/
jz lp/ {loop, if no key pressed}
mov ah,0/
Keyboard); {discard key}
end.