Should the two specified portions of memory overlap, the
effect of the command is to ‘rotate’ the contents of a section
of memory. The memory section which is rotated is determined
by: (i) the lower of the two start addresses, (ii) the higher
of the two start addresses, plus the specified length, minus
The memory addresses at the two limits are included in
the rotation. Rotation occurs in a downwards direction with
the overflow from the lowest address being wrapped around to
the highest address.
AAAA – start address of the first portion of memory.
BBBB – start address of the second portion of memory.
CCCC – length of memory (bytes) to be exchanged.
Decimal to hexadecimal conversion
Converts a decimal integer in the range minus 32768 to
plus 65535 to hexadecimal.
If the number to be converted is negative, a minus sign
should be typed immediately before the first digit of the
decimal number. The number itself may only contain the digits
0 through 9.
The result of the conversion to hexadecimal is displayed
on the first screen line following the command letter. The
result is always displayed as a four digit hexadecimal number.
In addition, if the value can be represented by a single byte,
a two digit hexadecimal number is also displayed on the same
line. Note: If a positive value is entered, it should be
remembered that hexadecimal equivalents which start with a
digit greater than 7, may also be interpreted as negative
The decimal number to be converted is supplied on the
same line as the ‘d” command. The value may be preceded by
spaces and is terminated either by the first following space
or by the end of the line, whichever occurs first.
Values from the NAS-SYS arguments are not used by this
command. Also, values which are entered on the command line
are not placed into the NAS-SYS arguments (ARG1 through
ARG10). However, NUMV is set to the hexadecimal value and
NUMN is set to the number of decimaligits entered.
-AAAAA – decimal number for conversion in the range –32768
The actual conversion is quite straightforward. The
routine examines the decimal digits from left to right. The
result register is initially set to zero. The next digit is
then added to the ‘result’ and, unless it is the rightmost
digit, a copy of the ‘result’ is added to the ‘result’
further nine times (i.e. multiplication by ten). This process
is repeated until all of the input digits have been processed.
As the arithmetic is all done in hexadecimal, the result is in