+ added write/writeln helpers in the RTL for writing longints/longwords on 16/8-bit CPUs

git-svn-id: branches/i8086@24006 -
This commit is contained in:
nickysn 2013-03-25 23:21:42 +00:00
parent 44ef72e1a4
commit 697de721ef
2 changed files with 61 additions and 0 deletions

View File

@ -358,6 +358,12 @@ procedure fpc_write_text_int64(len : longint;var t : text;i : int64); compilerpr
procedure fpc_write_text_qword_iso(len : longint;var t : text;q : qword); compilerproc;
procedure fpc_write_text_int64_iso(len : longint;var t : text;i : int64); compilerproc;
{$endif CPU64}
{$if defined(CPU16) or defined(CPU8)}
procedure fpc_write_text_longword(len : longint;var t : text;q : longword); compilerproc;
procedure fpc_write_text_longint(len : longint;var t : text;i : longint); compilerproc;
procedure fpc_write_text_longword_iso(len : longint;var t : text;q : longword); compilerproc;
procedure fpc_write_text_longint_iso(len : longint;var t : text;i : longint); compilerproc;
{$endif CPU16 or CPU8}
{$ifndef FPUNONE}
Procedure fpc_Write_Text_Float(rt,fixkomma,Len : Longint;var t : Text;r : ValReal); compilerproc;
Procedure fpc_Write_Text_Float_Iso(rt,fixkomma,Len : Longint;var t : Text;r : ValReal); compilerproc;

View File

@ -893,6 +893,61 @@ end;
{$endif CPU64}
{$if defined(CPU16) or defined(CPU8)}
procedure fpc_write_text_longword(len : longint;var t : text;q : longword); iocheck; compilerproc;
var
s : string;
begin
if (InOutRes<>0) then
exit;
str(q,s);
write_str(len,t,s);
end;
procedure fpc_write_text_longint(len : longint;var t : text;i : longint); iocheck; compilerproc;
var
s : string;
begin
if (InOutRes<>0) then
exit;
str(i,s);
write_str(len,t,s);
end;
procedure fpc_write_text_longword_iso(len : longint;var t : text;q : longword); iocheck; compilerproc;
var
s : string;
begin
if (InOutRes<>0) then
exit;
str(q,s);
{ default value? }
if len=-1 then
len:=11
else if len<length(s) then
len:=length(s);
write_str_iso(len,t,s);
end;
procedure fpc_write_text_longint_iso(len : longint;var t : text;i : longint); iocheck; compilerproc;
var
s : string;
begin
if (InOutRes<>0) then
exit;
str(i,s);
{ default value? }
if len=-1 then
len:=11
else if len<length(s) then
len:=length(s);
write_str_iso(len,t,s);
end;
{$endif CPU16 or CPU8}
{$ifndef FPUNONE}
Procedure fpc_Write_Text_Float(rt,fixkomma,Len : Longint;var t : Text;r : ValReal); iocheck; compilerproc;
var