Mercurial > hg > index.cgi
diff src/defs.s @ 100:6db72a92ff7a
Make value accumulator descriptions consistent and make usage consistent
author | William Astle <lost@l-w.ca> |
---|---|
date | Mon, 23 Oct 2023 22:46:55 -0600 |
parents | 663d8e77b579 |
children | 5d5472b11ccd |
line wrap: on
line diff
--- a/src/defs.s Mon Oct 23 20:23:28 2023 -0600 +++ b/src/defs.s Mon Oct 23 22:46:55 2023 -0600 @@ -13,24 +13,22 @@ linebuffsize equ 0x100 ; the line input buffer (256 bytes) stringstacknum equ 20 ; number of entries on the anonymous string descriptor stack ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -; Data structure used for calculations. Calculations are handled via structurs called value accumulators. A value +; Data structure used for calculations. Calculations are handled via structures called value accumulators. A value ; accumulator consists of a data type flag (at the end of the structure) and a data area whose layout varies based ; on the actual data type. The layouts for each value type are described below. ; ; A value type that is NULL (not set to anything) has type 0 (valtype_none) and the rest should be zero. ; -; A value accumulator has the following structure for floating point: +; A value accumulator has the following structure for floating point, which holds a packed floating point value: ; Offset Length Contents -; 0 1 fp exponent -; 1 4 fp mantissa -; 5 1 fp sign +; 0 1 fp exponent and sign +; 1 5 fp mantissa ; 6 1 value type ; ; A value accumulator has the following structure for integers: ; Offset Length Contents -; 0 1 *unsued* -; 1 4 integer value (two's complement) -; 5 1 *unused* +; 0 4 integer value (two's complement) +; 4 2 *unused* ; 6 1 value type ; ; A value accumulator has the following structure for a string: @@ -62,13 +60,12 @@ ; Value accumulator structure definitions; note that the actual value data must be first and any ; incidental meta data must follow val.value equ 0 ; offset of the value stored in the accumulator -val.fpsexp equ val.value ; floating point exponent +val.fpsexp equ val.value ; floating point exponent (and sign) val.fpssig equ val.fpsexp+1 ; floating point significand -val.fpssign equ val.fpssig+5 ; floating point sign val.int equ val.value ; integer offset val.strlen equ val.value+str.len ; string length offset val.strptr equ val.value+str.ptr ; string data pointer (low word) -val.type equ val.value+val.fpssign+1 ; use the largest of the data types here +val.type equ 6 ; use the largest of the data type sizes here val.size equ val.type+1 ; size of a value accumulator ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ifdef COCO3