Some additional instructions for 1456 object code.
William Overington
Copyright 2000 William Overington
In the course of applying 1456 object code there have been a number of occasions where I have felt that some particular additional instruction would be particularly helpful and that that helpfulness might usefully be applied more generally. These instructions have been added at various times and now seems an appropriate place to document them into the system. These are the instructions m, &m, d, &d, &R, &A, &i, &e, &N, &T, &b, i and o.
The m and d instructions arose because sometimes it happens that the data for subtraction and division are in the wrong order for convenient usage.
The m command, which may be memorized as "minus", is simply "minus" the value of a subtraction. The result is still in the ad1456 register, but the result is zero minus the value that would have been produced if the ordinary subtraction using the - command had been performed. The d command, which may be memorized as "divide", is simply the reciprocal of the result that would have been produced by the / command. Versions for integers have also been provided as the &m and &d commands.
Boolean logic in the 1456 object code system is performed using integers. There is no 1456 boolean type. The reason for this is that in so many 1456 programming situations one needs to add integer data depending upon the state of a boolean variable, that it seems easier to have the data already as an integer and that, had there been separate boolean registers then these would have needed to have been loaded from bi1456 anyway. There are six logic commands. After each of them, ai1456 will have either the value of 0 or 1. The argument or arguments for each of them are 0 or any other integer. The &R command regularizes the ai1456 register as either 0 or 1. The &R command is a function acting on the value in ai1456 and placing its result in ai1456. If the value in ai1456 is 0 then it will remain at 0, otherwise it will be set to 1. This is to help with data being used as logical flags. The &N command is a function acting on the value in ai1456 and placing its result in ai1456. If the value in ai1456 is 0 then it will become 1, otherwise it will be set to 0. It is the logical NOT command. The &A command carries out a logical AND on ai1456 and bi1456. The result is placed in ai1456. The &i command carries out an inclusive OR on ai1456 and bi1456. The result is placed in ai1456. The &e command carries out an exclusive OR on ai1456 and bi1456. The result is placed in ai1456. The &T command both carries out a logic test on ai1456 setting linkflag1456 to false if ai1456 contains a 0 and setting linkflag1456 to true otherwise; and rationalizes ai1456 to either 0 or 1. Should a 1456 programmer wish to set linkflag1456 on the basis of treating ai1456 as a logical state yet not wish for the value in the ai1456 register to be altered, then he or she may use the 1456 software 0&F to achieve that effect. The linkflag1456 will be set to true if ai1456 is not equal to 0 and set to false otherwise, yet not alter the value in the ai1456 register.
Although there is not a boolean type as such, the action code 35 for the eutodraw table is added, so that a control code within the range 3500 to 3599 will draw on the screen the word false or the word true dependent upon the value in ai1456 being either 0 or otherwise repectively. This use of the eutodraw table does not affect the value contained in the ai1456 register.
The &b command is a command that is useful in entering data into the eutodraw table. The ai1456 register has one hundred times the value of the bi1456 register added to it. Suppose for example that an integer is stored in a given place, say mi1456[87], and it has a value of 0 if a rectangle is to be drawn unfilled and a value of 1 if it is to be drawn filled. Suppose that as part of the setting up of the drawing of the rectangle in the eutodraw table one has 107&w$C in order to draw an unfilled magenta rectangle. One could have 107&w87&<&b$C in order to draw the rectangle unfilled or filled depending upon the value stored in mi1456[87].
The commands i and o give the sinh and cosh functions. These are included because I found it desirable to add them as internal functions of the 1456 engine during the programming of the sine and cosine functions of a complex variable, which are detailed in a later document, and so I thought that I might as well make them available for use in 1456 object code for real arguments as well. The first letters of the names sinh and cosh, namely s and c, are already in use for the sine and cosine commands, so I have chosen to use the second letters of sinh and cosh, namely i and o, as easily memorizable commands for sinh and cosh.
The table below summarizes these additional instructions.
m |
ad1456 takes the value of bd1456 - ad1456
&m
|
ai1456 takes the value of bi1456 - ai1456
|
d
|
ad1456 takes the value of bd1456/ad1456
|
&d
|
ai1456 takes the value of bi1456/ai1456
|
&R
|
if ai1456=0, then ai1456 takes the value of 0, otherwise ai1456 takes the value 1
|
&N
|
if ai1456=0, then ai1456 takes the value of 1, otherwise ai1456 takes the value 0
|
&A
|
logical AND on ai1456 and bi1456
|
&i
|
logical inclusive OR on ai1456 and bi1456
|
&e
|
logical exclusive OR on ai1456 and bi1456
|
&T
|
logical test on ai1456 and rationalizes ai1456 as 0 or 1.
|
&b
|
ai1456 takes the value of the ai1456 + (100*bi1456)
|
i
|
ad1456 takes the value of the hyberbolic sine of ad1456, that is the sinh function
|
o
|
ad1456 takes the value of the hyberbolic cosine of ad1456, that is the cosh function
| |
1456 object code
Copyright 2000 William Overington