Revision: 1668
Author: [email protected]
Date: Sun Feb 14 11:46:40 2010
Log: fixed validation on bit_array
http://code.google.com/p/jallib/source/detail?r=1668
Modified:
/trunk/include/jal/bit_array_1.jal
=======================================
--- /trunk/include/jal/bit_array_1.jal Sat Feb 13 09:40:29 2010
+++ /trunk/include/jal/bit_array_1.jal Sun Feb 14 11:46:40 2010
@@ -19,17 +19,17 @@
-- alias test is bit_array_1 -- rename/alias the array to test
-- create a byte array to hold the bits
-const byte _bit_array_1_calc1 = BIT_ARRAY_1_SIZE / 8
-const byte _bit_array_1_calc2 = _bit_array_1_calc1 * 8
-const byte _bit_array_1_calc3 = BIT_ARRAY_1_SIZE - _bit_array_1_calc1
+const byte _BIT_ARRAY_1_CALC1 = BIT_ARRAY_1_SIZE / 8
+const byte _BIT_ARRAY_1_CALC2 = _BIT_ARRAY_1_CALC1 * 8
+const byte _BIT_ARRAY_1_CALC3 = BIT_ARRAY_1_SIZE - _BIT_ARRAY_1_CALC1
-const word _bit_array_1_array_size = (BIT_ARRAY_1_SIZE / 8)+ 1
-if _bit_array_1_array_size <= 255 then
+const word _BIT_ARRAY_1_ARRAY_SIZE = (BIT_ARRAY_1_SIZE / 8)+ 1
+if _BIT_ARRAY_1_ARRAY_SIZE <= 255 then
var byte bit_array_1_byte_array[(BIT_ARRAY_1_SIZE / 8)+ 1]
else
- const dword large_array_1_SIZE = _bit_array_1_array_size --
choose number of array variables
- const dword large_array_1_VARIABLE_SIZE = 1 -- choose size of
variables (byte)
+ const dword LARGE_ARRAY_1_SIZE = _BIT_ARRAY_1_ARRAY_SIZE --
choose number of array variables
+ const dword LARGE_ARRAY_1_VARIABLE_SIZE = 1 -- choose size of
variables (byte)
include large_array_1 -- include the array
library
alias bit_array_1_byte_array is large_array_1
end if
@@ -50,7 +50,7 @@
var bit bit5 at holder : 5
var bit bit6 at holder : 6
var bit bit7 at holder : 7
-
+
if bit_address == 0 then -- set the correct bit in the byte
bit0 = data
elsif bit_address == 1 then
@@ -70,7 +70,7 @@
end if
bit_array_1_byte_array[byte_address] = holder -- save the new byte to
the byte array
-
+
end procedure
--
----------------------------------------------------------------------------
@@ -120,7 +120,7 @@
var word byte_array_location
var byte bit_location
var word calc_bit_location
-
+
-- find the byte location
byte_array_location = address / 8
-- find the bit location
@@ -129,7 +129,7 @@
bit_location = val[0]
-- write the bit
_bit_array_1_set_byte(byte_array_location, bit_location, data)
-
+
end procedure
--
----------------------------------------------------------------------------
@@ -141,7 +141,7 @@
var word byte_array_location
var byte bit_location
var word calc_bit_location
-
+
-- find the byte location
byte_array_location = address / 8
-- find the bit location
--
You received this message because you are subscribed to the Google Groups
"jallib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/jallib?hl=en.