The unsignedinteger class defines all the methods needed to handle address, hexadecimal values, bitwise and mask computations. The unsignedinteger class is a subclass of the scalar class. Internally, an unsignedinteger is defined as a C/C++ type long long, ie always 64 bits as well on an ILP32 CPU than on a LP64 CPU. Only bit operations, addition and subtraction are allowed. The unsignedinteger value itself is stored in the car part of a wwlisp cell, beginning at the lowest address, and cannot be seen completely by the carvalue function on a 32 bits machine. unsignedinteger are printed in hexadecimal, and hexadecimal values, when read, are stored as unsignedinteger. |
Function Type | subr |
Arguments | an unsignedinteger, an unlimited number of integers |
Return Value | an unsignedinteger |
Description | returns the result of the successive addition of the second argument to the first, the third to the result, the fourth to the result, and so on |
Example | (+ 0x0 32) => 0x20 |
Function Type | subr |
Arguments | an unsignedinteger, an unlimited number of integers |
Return Value | an unsignedinteger |
Description | returns the result of the successive subtraction of the second argument from the first, the third from the result, the fourth from the result, and so on |
Example | (- 0x0 32) =>0xffffffe0 |
Function Type | subr |
Arguments | an unsignedinteger, an unlimited number of unsignedintegers, floats or integers |
Return Value | t or nil |
Description | returns t if the series of arguments is strictly increasing |
Example | (< 0x1 2 3.0) => t |
Function Type | subr |
Arguments | an unsignedinteger, an unsignedinteger, float or integer |
Return Value | t or nil |
Description | returns t if the values of the arguments are numerically equal |
Example | (= 0x1 1.0) => t |
Function Type | subr |
Arguments | an unsignedinteger, an unlimited number of unsignedintegers, floats or integers |
Return Value | t or nil |
Description | returns t if the series of arguments is strictly decreasing |
Example | (> 0x3 2 1.0) => t |
Function Type | subr |
Arguments | an unsignedinteger object |
Return Value | a string |
Description | returns a string containing the base64 translation of the unsignedinteger; the length is fixed to 11 characters for the 64 bits unsignedintegers; endianity is unchanged |
Example | (base64 0) => "AAAAAAAAAAA" |
Function Type | subr |
Arguments | an unsignedinteger |
Return Value | a binary block |
Description | returns a binary block of 8 bytes length containg the unsigned integer byte pattern; the result depends on the endianness of the CPU |
Example | (ord(binary 0xff)) => (255 0 0 0 0 0 0 0) |
Function Type | subr |
Arguments | an unsignedinteger, an unsignedinteger, an unlimited number of unsignedinteger |
Return Value | an unsignedinteger |
Description | returns an unsignedinteger which is the result of the bitwise 'and' of the second argument on the first, then of the third on the result and so on; |
Example | (bit-and 0xff 0xff0) => 0xf0 |
Function Type | subr |
Arguments | an unsignedinteger, an unsignedinteger, an unlimited number of unsignedinteger |
Return Value | an unsignedinteger |
Description | makes an unsignedinteger which is the result of the bitwise 'and' of the second argument on the first, then of the third on the result and so on; the final result is inverted before to be returned |
Example | (bit-nand 0xff 0xff0) => 0xffffff0f |
Function Type | subr |
Arguments | an unsignedinteger, an unsignedinteger, an unlimited number of unsignedinteger |
Return Value | an unsignedinteger |
Description | makes an unsignedinteger which is the result of the bitwise 'or' of the second argument on the first, then of the third on the result and so on; the final result is inverted before to be returned |
Example | (bit-nor 0xff 0xff0) => 0xfffff000 |
Function Type | subr |
Arguments | an unsignedinteger |
Return Value | an unsignedinteger |
Description | returns an unsignedinteger where all the bits of the unsignedinteger given as argument are inverted |
Example | (bit-not 0xf) => 0xfffffff0 |
Function Type | subr |
Arguments | an unsignedinteger, an unsignedinteger, an unlimited number of unsignedinteger |
Return Value | an unsignedinteger |
Description | returns an unsignedinteger which is the result of the bitwise 'or' of the second argument on the first, then of the third on the result and so on; |
Example | (bit-or 0xff 0xff0) => 0xfff |
Function Type | subr |
Arguments | an unsignedinteger, an integer |
Return Value | an unsignedinteger |
Description | returns an unsignedinteger which is a copy of the first argument where all the bits are shifted to the left by a number always positive given as second argument; the greatest shift allowed is one bit less than the size of the unsignedinteger |
Example | (bit-shift-left 0x1 31) => 0x80000000 |
Function Type | subr |
Arguments | an unsignedinteger, an integer |
Return Value | an unsignedinteger |
Description | returns an unsignedinteger which is a copy of the first argument where all the bits are shifted to the right by a number always positive given as second argument; the greatest shift allowed is one bit less than the size of the unsignedinteger |
Example | (bit-shift-right 0x80000000 31) => 0x1 |
Function Type | subr |
Arguments | an unsignedinteger, an unsignedinteger, an unlimited number of unsignedinteger |
Return Value | an unsignedinteger |
Description | returns an unsignedinteger which is the result of the bitwise 'xor' of the second argument on the first, then of the third on the result and so on; |
Example | (bit-xor 0xff 0xff0 0xf) => 0xf00 |
Function Type | subr |
Arguments | none |
Return Value | an integer |
Description | returns an integer initialized at zero; never use directly integer-constructor, but do it always through make-instance or implicit creation |
Example | (make-instance unsignedinteger) => 0x0 |
Function Type | subr |
Arguments | an unsignedinteger |
Return Value | a float |
Description | returns a float containg the value which was stored in the unsignedinteger |
Example | (float 0xff) => 255.000000 |
Function Type | subr |
Arguments | an unsignedinteger |
Return Value | a string |
Description | returns a string containing the formatted value of the object passed as argument; is the default formatter of the class |
Example | (format 0xff) => "0xff" |
Function Type | subr |
Arguments | an unsignedinteger object |
Return Value | a string |
Description | returns a string containing the hexadecimal translation of the unsignedinteger; the length is variable with the leading zeroes suppressed; endianity is MSB: most significant bits are on the left; |
Example | (hexadecimal 240) => "f0" |
Function Type | subr |
Arguments | an unsignedinteger |
Return Value | an integer |
Description | returns an signed integer containing the positive or negative integer value of the argument; the maximum and minimum values are defined by the architecture of the CPU: either 32 or 64 bits, and how the sign is represented |
Example | (integer 0x80000000) => -2147483648 |
Function Type | subr |
Arguments | an unsignedinteger |
Return Value | a string |
Description | returns a string containing the edited value of the unsignedinteger given as argument |
Example | (string 0x0) => "0x0" |
Function Type | subr |
Arguments | an unsignedinteger |
Return Value | an unsignedinteger |
Description | returns the argument; needed when converting an argument which can be integer or unsignedinteger |
Example | (unsignedinteger x) |
Function Type | subr |
Arguments | an unsignedinteger |
Return Value | t or nil |
Description | returns t if the argument is 0x0, nil otherwise |
Example | (zerop x) |