REM Calculates large hexidecimal values.
DIM x AS DOUBLE
DIM z1 AS DOUBLE
DIM z2 AS DOUBLE
DIM z3 AS DOUBLE
DIM z4 AS DOUBLE
CLS
'x = 2 * 1024 ^ 3 - 1 ' fat32 long = 7fff ffffh
'PRINT "fat32 long="; x; "is hex:";
x = 4 * 1024 ^ 3 - 1 ' extended fat32 long = ffff ffffh
PRINT "extended fat32 long="; x; "is hex:";
z1 = x - INT(x / &H100) * &H100 ' 0000 00ff
x = x - z1: x = x / &H100
z2 = x - INT(x / &H100) * &H100 ' 0000 ff00
x = x - z2: x = x / &H100
z3 = x - INT(x / &H100) * &H100 ' 00ff 0000
x = x - z3: x = x / &H100
z4 = x ' ff00 0000
x = x - z4: x = x / &H100 ' x should now equal zero.
PRINT RIGHT$("00" + HEX$(z4), 2);
PRINT RIGHT$("00" + HEX$(z3), 2); " ";
PRINT RIGHT$("00" + HEX$(z2), 2);
PRINT RIGHT$("00" + HEX$(z1), 2); " ";
x = 0
x = z1 + z2 * &H100 + z3 * &H100 * &H100 + z4 * &H100 * &H100 * &H100
PRINT "("; x; ")"' should equal original definition

