I am struggling understand why anyone would have thought that these instructions were needed. The manuals go through a lot of mumbo jumbo
about implied binary points which I understand well enough. But what is
the point of instructions that only make allowances for a single binary point? It seems to me that if one is going to have to scale numbers in
this fashion you are most likely going to need more than 1 binary point
and you will have to keep track of the scaling yourself in any case.
Either that or just use floating point.
I'm perplexed.
Steve B
Look at the code FTN generates when converting REAL to INTEGER (or vice versa), it makes use of something along those lines.-a You can then check the equivalent for Double Precision.
I had to do this for a piece of MASM coding around 41 years ago so my
memory of the exact code generated is more than sketchy.
On 2/23/26 12:22, R Daneel Olivaw wrote:
Look at the code FTN generates when converting REAL to INTEGER (or
vice versa), it makes use of something along those lines.-a You can
then check the equivalent for Double Precision.
I had to do this for a piece of MASM coding around 41 years ago so my
memory of the exact code generated is more than sketchy.
Ah! I can kind of see where that would be useful in that situation. Not being a mathematician I would have to do some serious thinking to
completely wrap my head around it.
Whenever I have to convert between floating point and integer or vice
versa I usually end up doing a bunch of floating point arithmetic to
make it happen. I can see where being able to use integer instructions
would be a lot faster.
Thanks
On 2/23/26 12:22, R Daneel Olivaw wrote:
Look at the code FTN generates when converting REAL to INTEGER (or
vice versa), it makes use of something along those lines.-a You can
then check the equivalent for Double Precision.
I had to do this for a piece of MASM coding around 41 years ago so my
memory of the exact code generated is more than sketchy.
Ah! I can kind of see where that would be useful in that situation. Not being a mathematician I would have to do some serious thinking to
completely wrap my head around it.
Whenever I have to convert between floating point and integer or vice
versa I usually end up doing a bunch of floating point arithmetic to
make it happen. I can see where being able to use integer instructions
would be a lot faster.
Well I cheated back then - "FTN has to do it and whatever it does will
be bombproof, so @FTN,L (on a tiny subroutine) is the way to go".
My comment in the MASM routine became legendary, "I don't know why this works but it does so leave it alone".
Whenever I have to convert between floating point and integer or vice
versa I usually end up doing a bunch of floating point arithmetic to
make it happen. I can see where being able to use integer instructions
would be a lot faster.
For conversion from integer to FP, there are the load and convert to floating and double load and convert to floating.-a Two instructions one
to preload the offset of the exponent, then one to do the conversion.
For FP to int, there is there is the floating expand and load
instruction that helps a lot.
Stephen Boyd wrote:
On 2/23/26 12:22, R Daneel Olivaw wrote:
Look at the code FTN generates when converting REAL to INTEGER (or
vice versa), it makes use of something along those lines.-a You can
then check the equivalent for Double Precision.
I had to do this for a piece of MASM coding around 41 years ago so my
memory of the exact code generated is more than sketchy.
Ah! I can kind of see where that would be useful in that situation.
Not being a mathematician I would have to do some serious thinking to
completely wrap my head around it.
Whenever I have to convert between floating point and integer or vice
versa I usually end up doing a bunch of floating point arithmetic to
make it happen. I can see where being able to use integer instructions
would be a lot faster.
Thanks
Well I cheated back then - "FTN has to do it and whatever it does will
be bombproof, so @FTN,L (on a tiny subroutine) is the way to go".
My comment in the MASM routine became legendary, "I don't know why this works but it does so leave it alone".
On 2/23/26 15:27, R Daneel Olivaw wrote:
Stephen Boyd wrote:
On 2/23/26 12:22, R Daneel Olivaw wrote:
Look at the code FTN generates when converting REAL to INTEGER (or
vice versa), it makes use of something along those lines.-a You can
then check the equivalent for Double Precision.
I had to do this for a piece of MASM coding around 41 years ago so
my memory of the exact code generated is more than sketchy.
Ah! I can kind of see where that would be useful in that situation.
Not being a mathematician I would have to do some serious thinking to
completely wrap my head around it.
Whenever I have to convert between floating point and integer or vice
versa I usually end up doing a bunch of floating point arithmetic to
make it happen. I can see where being able to use integer
instructions would be a lot faster.
Thanks
Well I cheated back then - "FTN has to do it and whatever it does will
be bombproof, so @FTN,L (on a tiny subroutine) is the way to go".
My comment in the MASM routine became legendary, "I don't know why
this works but it does so leave it alone".
I found another use for MF. Converting Fieldata to binary. Like the
Fortran code mentioned above I don't really know why this works but I
tried it and it does.
Convert the 6 fieldata numerals in A0 to binary in A1.
-a-a-a-a-a-a-a AND-a-a-a-a A0,(0171717171717).-a-a STRIP OFF 'ZONE' BITS
-a-a-a-a-a-a-a AND-a-a-a-a A1,(-0,0,-0,0,-0,0).-a EXTRACT ALTERNATE DIGITS
-a-a-a-a-a-a-a MF-a-a-a-a-a A2,(54*/29).
-a-a-a-a-a-a-a AN-a-a-a-a-a A1,A2.-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a 3 PAIRS OF DIGITS CONVERTED
-a-a-a-a-a-a-a AND-a-a-a-a A1,(0,-0,0).
-a-a-a-a-a-a-a MF-a-a-a-a-a A2,((1*/12-100)*/23).
-a-a-a-a-a-a-a AN-a-a-a-a-a A1,A2.-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a RIGHT 4 DIGITS NOW DONE
-a-a-a-a-a-a-a AND-a-a-a-a A1,(-0,0,0).
-a-a-a-a-a-a-a MF-a-a-a-a-a A2,((1*/24-10000)*/11).
-a-a-a-a-a-a-a AN-a-a-a-a-a A1,A2.-a-a-a-a-a-a-a-a-a-a-a-a-a-a-a DONE. RESULT IN A1, ORIGINAL IN A0.
I found this at http://fourmilab.org/documents/univac/cute-tricks.html
Steve B
On 3/9/26 14:47, R Daneel Olivaw wrote:
I found this at http://fourmilab.org/documents/univac/cute-tricks.html
Steve B
That link is bad, it's cute_tricks and not cute-tricks.-a Oh, and https.
Some of those tricks are really outdated - 13, 14 and 19 in particular
(19 assumes non-write-protected I-Banks).-a Ascii versions of some of
the others would be useful.
Sorry about the link. PEBKAC. (Problem exists between keyboard and chair).
Absolutely some of the tricks are outdated. The page was posted by a
fellow reminiscing about his time working on an 1108.
Steve B
Stephen Boyd wrote:
On 3/9/26 14:47, R Daneel Olivaw wrote:
I found this at http://fourmilab.org/documents/univac/cute-tricks.html >>>>
Steve B
That link is bad, it's cute_tricks and not cute-tricks.-a Oh, and https. >>> Some of those tricks are really outdated - 13, 14 and 19 in
particular (19 assumes non-write-protected I-Banks).-a Ascii versions
of some of the others would be useful.
Sorry about the link. PEBKAC. (Problem exists between keyboard and
chair).
Absolutely some of the tricks are outdated. The page was posted by a
fellow reminiscing about his time working on an 1108.
The fun one was #14: "(Note: this will not work beyond Exec level 31!)".
My first Univac job was at the start of 1979, on an 1106 running (I
think) Exec 33.
I was wondering why the coding referenced R14 as address 0136, but 0136
is the Exec's R14 (which is protected) while the User R14 is at 0116.
#14 worked in Exec levels 31 and prior because the Exec kept the TAL
(Type and Level) of whatever was currently executing in Exec R14, which could be read, but not written, by a user program.-a The Type of a demand run was 4 versus 6 for a batch run.-a But in Exec 33, when TIP was integrated into the Exec, the definition was changed such that the type
of a TIP transaction was 4, and demand was changed to 6, the same as
batch, so the trick no longer worked.-a BTW, since TAL, and ER14 usage
was internal to Exec, the change was not documented, and this broke
programs that relied on it.
Stephen Fuld wrote:
#14 worked in Exec levels 31 and prior because the Exec kept the TAL
(Type and Level) of whatever was currently executing in Exec R14,
which could be read, but not written, by a user program.-a The Type of
a demand run was 4 versus 6 for a batch run.-a But in Exec 33, when TIP
was integrated into the Exec, the definition was changed such that the
type of a TIP transaction was 4, and demand was changed to 6, the same
as batch, so the trick no longer worked.-a BTW, since TAL, and ER14
usage was internal to Exec, the change was not documented, and this
broke programs that relied on it.
The values are in A4 when a program starts.
04 is Demand
05 is Deadline Batch
06 is Batch
On 3/12/2026 1:53 AM, R Daneel Olivaw wrote:
Stephen Fuld wrote:
#14 worked in Exec levels 31 and prior because the Exec kept the TAL
(Type and Level) of whatever was currently executing in Exec R14,
which could be read, but not written, by a user program.-a The Type of
a demand run was 4 versus 6 for a batch run.-a But in Exec 33, when
TIP was integrated into the Exec, the definition was changed such
that the type of a TIP transaction was 4, and demand was changed to
6, the same as batch, so the trick no longer worked.-a BTW, since TAL,
and ER14 usage was internal to Exec, the change was not documented,
and this broke programs that relied on it.
The values are in A4 when a program starts.
04 is Demand
05 is Deadline Batch
06 is Batch
Yes, that is explained in the "trick".-a-a But as also explained there, if you are writing say a subroutine library that might be called by either
a batch or demand program, A4 was probably used by that program long
ago, so you can't depend on it any more.
Stephen Fuld wrote:
On 3/12/2026 1:53 AM, R Daneel Olivaw wrote:
Stephen Fuld wrote:
#14 worked in Exec levels 31 and prior because the Exec kept the TAL
(Type and Level) of whatever was currently executing in Exec R14,
which could be read, but not written, by a user program.-a The Type
of a demand run was 4 versus 6 for a batch run.-a But in Exec 33,
when TIP was integrated into the Exec, the definition was changed
such that the type of a TIP transaction was 4, and demand was
changed to 6, the same as batch, so the trick no longer worked.
BTW, since TAL, and ER14 usage was internal to Exec, the change was
not documented, and this broke programs that relied on it.
The values are in A4 when a program starts.
04 is Demand
05 is Deadline Batch
06 is Batch
Yes, that is explained in the "trick".-a-a But as also explained there,
if you are writing say a subroutine library that might be called by
either a batch or demand program, A4 was probably used by that program
long ago, so you can't depend on it any more.
A volatile register can be overwritten?-a Amazing.
UCSINITREG$ is the UCS call, I think ER DMGC$ also returns that value
for BM programs although that is from my memory and it may well be incorrect.-a I'm also not sure if both calls return those TIP values, one may not.
Btw, I think @ACOB saves those A4/A5 values in some fixed place before
it does anything else - its Supplimentary Reference should say something about register usage.
I found this at http://fourmilab.org/documents/univac/cute-tricks.html
Steve B
That link is bad, it's cute_tricks and not cute-tricks.-a Oh, and https.
Some of those tricks are really outdated - 13, 14 and 19 in particular
(19 assumes non-write-protected I-Banks).-a Ascii versions of some of the others would be useful.
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 65 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 06:39:52 |
| Calls: | 862 |
| Files: | 1,311 |
| D/L today: |
921 files (14,318M bytes) |
| Messages: | 264,702 |