Artifact 5f6b3377e2342cff83f0a197a73e6e748045746678701ab5bfaf43f767bba53e:
- File
psl-1983/20-kernel/write-float.red
— part of check-in
[eb17ceb7f6]
at
2020-04-21 19:40:01
on branch master
— Add Reduce 3.0 to the historical section of the archive, and some more
files relating to version sof PSL from the early 1980s. Thanks are due to
Paul McJones and Nelson Beebe for these, as well as to all the original
authors.git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/historical@5328 2bfe0521-f11c-4a00-b80e-6202646ff360 (user: arthurcnorman@users.sourceforge.net, size: 1494) [annotate] [blame] [check-ins using] [more...]
- File
psl-1983/3-1/kernel/20/write-float.red
— part of check-in
[eb17ceb7f6]
at
2020-04-21 19:40:01
on branch master
— Add Reduce 3.0 to the historical section of the archive, and some more
files relating to version sof PSL from the early 1980s. Thanks are due to
Paul McJones and Nelson Beebe for these, as well as to all the original
authors.git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/historical@5328 2bfe0521-f11c-4a00-b80e-6202646ff360 (user: arthurcnorman@users.sourceforge.net, size: 1494) [annotate] [blame] [check-ins using]
% % WRITE-FLOAT.RED - format a floating point number into a string % % Author: Eric Benson % Symbolic Computation Group % Computer Science Dept. % University of Utah % Date: 26 November 1981 % Copyright (c) 1981 University of Utah % % <PSL.KERNEL-20>WRITE-FLOAT.RED.3, 28-Sep-82 15:44:53, Edit by BENSON % Changed DMOVE to 2 moves, so this will run on a KI10 Tenex lap '((!*entry WriteFloat expr 2) % convert float to string % % r1 is string pointer, r2 is pointer to 2 word float % puts characters in string buffer with terminating null char and count % (!*MOVE (reg 1) (reg t1)) % save pointer to string count (!*WPLUS2 (reg 1) (WConst 1)) % move to chars (hrli (reg 1) 8#440700) % make r1 a byte pointer (!*MOVE (reg 1) (reg t2)) % save starting byte pointer (move (reg 3) (Indexed (reg 2) 1)) % load r2 and r3 with the number (move (reg 2) (Indexed (reg 2) 0)) (move (reg 4) (lit (fullword 2#000010100000001000000000010000000000))) % fl%one + fl%pnt + 16 fl%rnd (dfout) (!*JUMP (Label Error)) (!*MOVE (WConst -1) (reg 4)) % count := -1 Count (!*JUMPEQ (Label DoneCounting) (reg 1) (reg t2)) % byte pointers equal? (ibp (reg t2)) (aoja (reg 4) Count) % Count := Count + 1 DoneCounting (!*MOVE (reg 4) (MEMORY (reg t1) (WConst 0))) % deposit count (!*MOVE (WConst 0) (reg 2)) (idpb (reg 4) (reg 1)) % deposit null byte (!*EXIT 0) Error (!*MOVE (QUOTE "Couldn't print float") (reg 1)) (!*JCALL IOError) ); END;