Jump to content
Halfi

[pascal] - Przerwania, I Zapis Do Pliku

Recommended Posts

ostatnio zaciekawili mnie przerwania niestety bez glebszej lektury przystapilem do tworzenia, oto efekty:

 

------------------------------------------//----------------------------------------------

 

unit Zegarek;

 

interface

 

uses crt,dos;

 

procedure znak(x,y:integer;ch:char);

 

procedure zegar;interrupt;

 

 

 

implementation

 

procedure Znak(x,y:integer;ch:char);

begin

Mem[$B800:120*(y-1)+x*2-2]:=Ord(Ch);

end;

 

procedure Zegar;

var

h,m,s,s100 :word;

st,st1 :string;

begin

 

gettime(h,m,s,s100);

str(h,st);

if length(st) = 1 then

begin

st1:=st;

st:='0';

st:=st+st1;

end;

Znak(69,2,'[');

Znak(70,2,st[1]);

ZNak(71,2,st[2]);

Znak(72,2,'h');

str(m,st);

if length(st) = 1 then

begin

st1:=st;

st:='0';

st:=st+st1;

end;

Znak(73,2,st[1]);

ZNak(74,2,st[2]);

Znak(75,2,'m');

str(s,st);

if length(st) = 1 then

begin

st1:=st;

st:='0';

st:=st+st1;

end;

Znak(76,2,st[1]);

ZNak(77,2,st[2]);

Znak(78,2,'s');

 

 

str(s100,st);

if length(st) = 1 then

begin

st1:=st;

st:='0';

st:=st+st1;

end;

Znak(79,2,st[1]);

ZNak(80,2,st[2]);

Znak(82,2,']');

end;

 

end.

 

------------------------------------------//----------------------------------------

 

wywoluje go w glownym programie poleceniem SetIntVec($1C,@Zegar);

 

wszystko dziala swietnie, ale napotkalem problem przy odczycie i zapiscie do pliku, gdy wskakuje przerwanie zegarka to wywala sie caly turbo pascal, i tu moje pytanie jak pogodzic ze soba te 2 rzeczy ?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...