主题:[讨论]jichang近来,有问题
这是你的程序,但我没看见时间啊
Uses Dos, Crt;
Const
days : array [0..6] of String[9] =
('Sun','Mon','Tue','Wed','Thu','Fri','Sat');
Var
Int1CSave : Pointer;
i : Integer;
Function IntToStr(n:word):string;
Var
s : String;
Begin
s := '';
Repeat
s := chr( ord('0')+n mod 10 ) + s;
n := n div 10;
Until n = 0;
IntToStr := s;
End;
{$F+,S-,W-}
Procedure TimerHandler; interrupt;
Var
s : String;
y, m, d, dow : Word;
hh,mm,ss,hun : Word;
x1, y1 : word;
Begin
GetDate(y,m,d,dow);
s := IntToStr(y) + '-' + IntToStr(m div 10 ) +
IntToStr(m mod 10 ) + '-'+ IntToStr(d div 10 ) +
IntToStr(d mod 10 );
s := s + ' '+ days[dow];
GetTime(hh,mm,ss,hun);
s := s+' '+IntToStr(hh div 10)+IntToStr(hh mod 10)+':'+
IntToStr(mm div 10)+IntToStr(mm mod 10)+':'+
IntToStr(ss div 10)+IntToStr(ss mod 10);
x1 := Wherex;
y1 := Wherey;
Window(1,1,80,1);
Gotoxy(30,1);
TextColor(Red+8);
Write('Timer ISR Demo');
Gotoxy(50,1);
Write(s);
Window(1,2,80,25);
Textcolor(7);
Gotoxy(x1,y1);
End;
{$F-,S+}
Begin
ClrScr;
Window(1,2,80,25);
GetIntVec($1C,Int1CSave);
SetIntVec($1C,Addr(TimerHandler));
(*** Your Code here. **********)
For i:=1 to 1000 do
Begin
write(i:5);
delay(10);
End;
Writeln;
Writeln('Programmed by j.t.Chang. Press ENTER...');
Readln;
(******************************)
SetIntVec($01C,Int1CSave);
End.
Uses Dos, Crt;
Const
days : array [0..6] of String[9] =
('Sun','Mon','Tue','Wed','Thu','Fri','Sat');
Var
Int1CSave : Pointer;
i : Integer;
Function IntToStr(n:word):string;
Var
s : String;
Begin
s := '';
Repeat
s := chr( ord('0')+n mod 10 ) + s;
n := n div 10;
Until n = 0;
IntToStr := s;
End;
{$F+,S-,W-}
Procedure TimerHandler; interrupt;
Var
s : String;
y, m, d, dow : Word;
hh,mm,ss,hun : Word;
x1, y1 : word;
Begin
GetDate(y,m,d,dow);
s := IntToStr(y) + '-' + IntToStr(m div 10 ) +
IntToStr(m mod 10 ) + '-'+ IntToStr(d div 10 ) +
IntToStr(d mod 10 );
s := s + ' '+ days[dow];
GetTime(hh,mm,ss,hun);
s := s+' '+IntToStr(hh div 10)+IntToStr(hh mod 10)+':'+
IntToStr(mm div 10)+IntToStr(mm mod 10)+':'+
IntToStr(ss div 10)+IntToStr(ss mod 10);
x1 := Wherex;
y1 := Wherey;
Window(1,1,80,1);
Gotoxy(30,1);
TextColor(Red+8);
Write('Timer ISR Demo');
Gotoxy(50,1);
Write(s);
Window(1,2,80,25);
Textcolor(7);
Gotoxy(x1,y1);
End;
{$F-,S+}
Begin
ClrScr;
Window(1,2,80,25);
GetIntVec($1C,Int1CSave);
SetIntVec($1C,Addr(TimerHandler));
(*** Your Code here. **********)
For i:=1 to 1000 do
Begin
write(i:5);
delay(10);
End;
Writeln;
Writeln('Programmed by j.t.Chang. Press ENTER...');
Readln;
(******************************)
SetIntVec($01C,Int1CSave);
End.