Revision: 1472
Author: [email protected]
Date: Mon Nov 9 23:58:51 2009
Log: jal2.4m fix for large_array.jal
http://code.google.com/p/jallib/source/detail?r=1472
Modified:
/trunk/include/jal/large_array.jal
/trunk/sample/18f452_large_array.jal
=======================================
--- /trunk/include/jal/large_array.jal Fri Nov 6 22:38:43 2009
+++ /trunk/include/jal/large_array.jal Mon Nov 9 23:58:51 2009
@@ -19,13 +19,13 @@
-- Use "alias new_array_name is large_array_1" to rename the array
--
-- Example:
--- const dword ARRAY_SIZE = 600 -- choose number of array
variables
--- const dword ARRAY_VARIABLE_SIZE = 2 -- choose size of variables
(byte*2)
+-- const dword LARGE_ARRAY_SIZE = 600 -- choose number of array
variables
+-- const dword LARGE_ARRAY_VARIABLE_SIZE = 2 -- choose size of
variables (byte*2)
-- include large_array -- include the array library
-- alias test is large_array_1 -- rename/alias the array to test
--
-if ARRAY_VARIABLE_SIZE == 1 then -- if array will be byte*1
+if LARGE_ARRAY_VARIABLE_SIZE == 1 then -- if array will be byte*1
-- create smaller byte arrays
var byte large_array_byte_1h[256]
@@ -35,8 +35,8 @@
var byte large_array_byte_5h[256]
var byte large_array_byte_6h[256]
var byte large_array_byte_7h[256]
- if !(ARRAY_SIZE == (256 * 7)) then -- don't make an array with 0 entries
- var byte large_array_byte_8h[ARRAY_SIZE - (256 * 7)]
+ if !(LARGE_ARRAY_SIZE == (256 * 7)) then -- don't make an array with 0
entries
+ var byte large_array_byte_8h[LARGE_ARRAY_SIZE - (256 * 7)]
end if
var byte large_array_byte_1g[256]
@@ -45,8 +45,8 @@
var byte large_array_byte_4g[256]
var byte large_array_byte_5g[256]
var byte large_array_byte_6g[256]
- if !(ARRAY_SIZE == (256 * 6)) then
- var byte large_array_byte_7g[ARRAY_SIZE - (256 * 6)]
+ if !(LARGE_ARRAY_SIZE == (256 * 6)) then
+ var byte large_array_byte_7g[LARGE_ARRAY_SIZE - (256 * 6)]
end if
var byte large_array_byte_1f[256]
@@ -54,45 +54,45 @@
var byte large_array_byte_3f[256]
var byte large_array_byte_4f[256]
var byte large_array_byte_5f[256]
- if !(ARRAY_SIZE == (256 * 5)) then
- var byte large_array_byte_6f[ARRAY_SIZE - (256 * 5)]
+ if !(LARGE_ARRAY_SIZE == (256 * 5)) then
+ var byte large_array_byte_6f[LARGE_ARRAY_SIZE - (256 * 5)]
end if
var byte large_array_byte_1e[256]
var byte large_array_byte_2e[256]
var byte large_array_byte_3e[256]
var byte large_array_byte_4e[256]
- if !(ARRAY_SIZE == (256 * 4)) then
- var byte large_array_byte_5e[ARRAY_SIZE - (256 * 4)]
+ if !(LARGE_ARRAY_SIZE == (256 * 4)) then
+ var byte large_array_byte_5e[LARGE_ARRAY_SIZE - (256 * 4)]
end if
var byte large_array_byte_1d[256]
var byte large_array_byte_2d[256]
var byte large_array_byte_3d[256]
- if !(ARRAY_SIZE == (256 * 3)) then
- var byte large_array_byte_4d[ARRAY_SIZE - (256 * 3)]
+ if !(LARGE_ARRAY_SIZE == (256 * 3)) then
+ var byte large_array_byte_4d[LARGE_ARRAY_SIZE - (256 * 3)]
end if
var byte large_array_byte_1c[256]
var byte large_array_byte_2c[256]
- if !(ARRAY_SIZE == (256 * 2)) then
- var byte large_array_byte_3c[ARRAY_SIZE - (256 * 2)]
+ if !(LARGE_ARRAY_SIZE == (256 * 2)) then
+ var byte large_array_byte_3c[LARGE_ARRAY_SIZE - (256 * 2)]
end if
var byte large_array_byte_1b[256]
- if !(ARRAY_SIZE == 256) then
- var byte large_array_byte_2b[ARRAY_SIZE - (256)]
+ if !(LARGE_ARRAY_SIZE == 256) then
+ var byte large_array_byte_2b[LARGE_ARRAY_SIZE - (256)]
end if
- if !(ARRAY_SIZE == 0) then
- var byte large_array_byte_1a[ARRAY_SIZE]
+ if !(LARGE_ARRAY_SIZE == 0) then
+ var byte large_array_byte_1a[LARGE_ARRAY_SIZE]
end if
-- get a value from a large byte array
function large_array_1'get(word in address) return byte is
var byte data
- if ARRAY_SIZE > 1792 then
+ if LARGE_ARRAY_SIZE > 1792 then
if address >= 1792 then
data = large_array_byte_8h[address - 1792]
elsif address >= 1536 then
@@ -107,10 +107,10 @@
data = large_array_byte_3h[address - 512]
elsif address >= 256 then
data = large_array_byte_2h[address - 256]
- elsif address >= 0 then
+ else
data = large_array_byte_1h[address - 0]
end if
- elsif ARRAY_SIZE > 1536 then
+ elsif LARGE_ARRAY_SIZE > 1536 then
if address >= 1536 then
data = large_array_byte_7g[address - 1536]
elsif address >= 1280 then
@@ -123,10 +123,10 @@
data = large_array_byte_3g[address - 512]
elsif address >= 256 then
data = large_array_byte_2g[address - 256]
- elsif address >= 0 then
+ else
data = large_array_byte_1g[address - 0]
end if
- elsif ARRAY_SIZE > 1280 then
+ elsif LARGE_ARRAY_SIZE > 1280 then
if address >= 1280 then
data = large_array_byte_6f[address - 1280]
elsif address >= 1024 then
@@ -137,10 +137,10 @@
data = large_array_byte_3f[address - 512]
elsif address >= 256 then
data = large_array_byte_2f[address - 256]
- elsif address >= 0 then
+ else
data = large_array_byte_1f[address - 0]
end if
- elsif ARRAY_SIZE > 1024 then
+ elsif LARGE_ARRAY_SIZE > 1024 then
if address >= 1024 then
data = large_array_byte_5e[address - 1024]
elsif address >= 768 then
@@ -149,37 +149,35 @@
data = large_array_byte_3e[address - 512]
elsif address >= 256 then
data = large_array_byte_2e[address - 256]
- elsif address >= 0 then
+ else
data = large_array_byte_1e[address - 0]
end if
- elsif ARRAY_SIZE > 768 then
+ elsif LARGE_ARRAY_SIZE > 768 then
if address >= 768 then
data = large_array_byte_4d[address - 768]
elsif address >= 512 then
data = large_array_byte_3d[address - 512]
elsif address >= 256 then
data = large_array_byte_2d[address - 256]
- elsif address >= 0 then
+ else
data = large_array_byte_1d[address - 0]
end if
- elsif ARRAY_SIZE > 512 then
+ elsif LARGE_ARRAY_SIZE > 512 then
if address >= 512 then
data = large_array_byte_3c[address - 512]
elsif address >= 256 then
data = large_array_byte_2c[address - 256]
- elsif address >= 0 then
+ else
data = large_array_byte_1c[address - 0]
end if
- elsif ARRAY_SIZE > 256 then
+ elsif LARGE_ARRAY_SIZE > 256 then
if address >= 256 then
data = large_array_byte_2b[address - 256]
- elsif address >= 0 then
+ else
data = large_array_byte_1b[address - 0]
end if
- elsif ARRAY_SIZE > 0 then
- if address >= 0 then
+ elsif LARGE_ARRAY_SIZE > 0 then
data = large_array_byte_1a[address - 0]
- end if
end if
return data
@@ -187,7 +185,7 @@
-- store a value into a large byte array
procedure large_array_1'put (word in address, byte in data) is
- if ARRAY_SIZE > 1792 then
+ if LARGE_ARRAY_SIZE > 1792 then
if address >= 1792 then
large_array_byte_8h[address - 1792] = data
elsif address >= 1536 then
@@ -202,10 +200,10 @@
large_array_byte_3h[address - 512] = data
elsif address >= 256 then
large_array_byte_2h[address - 256] = data
- elsif address >= 0 then
+ else
large_array_byte_1h[address - 0] = data
end if
- elsif ARRAY_SIZE > 1536 then
+ elsif LARGE_ARRAY_SIZE > 1536 then
if address >= 1536 then
large_array_byte_7g[address - 1536] = data
elsif address >= 1280 then
@@ -218,10 +216,10 @@
large_array_byte_3g[address - 512] = data
elsif address >= 256 then
large_array_byte_2g[address - 256] = data
- elsif address >= 0 then
+ else
large_array_byte_1g[address - 0] = data
end if
- elsif ARRAY_SIZE > 1280 then
+ elsif LARGE_ARRAY_SIZE > 1280 then
if address >= 1280 then
large_array_byte_6f[address - 1280] = data
elsif address >= 1024 then
@@ -232,10 +230,10 @@
large_array_byte_3f[address - 512] = data
elsif address >= 256 then
large_array_byte_2f[address - 256] = data
- elsif address >= 0 then
+ else
large_array_byte_1f[address - 0] = data
end if
- elsif ARRAY_SIZE > 1024 then
+ elsif LARGE_ARRAY_SIZE > 1024 then
if address >= 1024 then
large_array_byte_5e[address - 1024] = data
elsif address >= 768 then
@@ -244,41 +242,39 @@
large_array_byte_3e[address - 512] = data
elsif address >= 256 then
large_array_byte_2e[address - 256] = data
- elsif address >= 0 then
+ else
large_array_byte_1e[address - 0] = data
end if
- elsif ARRAY_SIZE > 768 then
+ elsif LARGE_ARRAY_SIZE > 768 then
if address >= 768 then
large_array_byte_4d[address - 768] = data
elsif address >= 512 then
large_array_byte_3d[address - 512] = data
elsif address >= 256 then
large_array_byte_2d[address - 256] = data
- elsif address >= 0 then
+ else
large_array_byte_1d[address - 0] = data
end if
- elsif ARRAY_SIZE > 512 then
+ elsif LARGE_ARRAY_SIZE > 512 then
if address >= 512 then
large_array_byte_3c[address - 512] = data
elsif address >= 256 then
large_array_byte_2c[address - 256] = data
- elsif address >= 0 then
+ else
large_array_byte_1c[address - 0] = data
end if
- elsif ARRAY_SIZE > 256 then
+ elsif LARGE_ARRAY_SIZE > 256 then
if address >= 256 then
large_array_byte_2b[address - 256] = data
- elsif address >= 0 then
+ else
large_array_byte_1b[address - 0] = data
end if
- elsif ARRAY_SIZE > 0 then
- if address >= 0 then
+ elsif LARGE_ARRAY_SIZE > 0 then
large_array_byte_1a[address - 0] = data
- end if
end if
end procedure
-elsif ARRAY_VARIABLE_SIZE == 2 then
+elsif LARGE_ARRAY_VARIABLE_SIZE == 2 then
var word large_array_word_1h[128]
var word large_array_word_2h[128]
var word large_array_word_3h[128]
@@ -286,8 +282,8 @@
var word large_array_word_5h[128]
var word large_array_word_6h[128]
var word large_array_word_7h[128]
- if !(ARRAY_SIZE == (128 * 7)) then
- var word large_array_word_8h[ARRAY_SIZE - (128 * 7)]
+ if !(LARGE_ARRAY_SIZE == (128 * 7)) then
+ var word large_array_word_8h[LARGE_ARRAY_SIZE - (128 * 7)]
end if
var word large_array_word_1g[128]
@@ -296,8 +292,8 @@
var word large_array_word_4g[128]
var word large_array_word_5g[128]
var word large_array_word_6g[128]
- if !(ARRAY_SIZE == (128 * 6)) then
- var word large_array_word_7g[ARRAY_SIZE - (128 * 6)]
+ if !(LARGE_ARRAY_SIZE == (128 * 6)) then
+ var word large_array_word_7g[LARGE_ARRAY_SIZE - (128 * 6)]
end if
var word large_array_word_1f[128]
@@ -305,44 +301,44 @@
var word large_array_word_3f[128]
var word large_array_word_4f[128]
var word large_array_word_5f[128]
- if !(ARRAY_SIZE == (128 * 5)) then
- var word large_array_word_6f[ARRAY_SIZE - (128 * 5)]
+ if !(LARGE_ARRAY_SIZE == (128 * 5)) then
+ var word large_array_word_6f[LARGE_ARRAY_SIZE - (128 * 5)]
end if
var word large_array_word_1e[128]
var word large_array_word_2e[128]
var word large_array_word_3e[128]
var word large_array_word_4e[128]
- if !(ARRAY_SIZE == (128 * 4)) then
- var word large_array_word_5e[ARRAY_SIZE - (128 * 4)]
+ if !(LARGE_ARRAY_SIZE == (128 * 4)) then
+ var word large_array_word_5e[LARGE_ARRAY_SIZE - (128 * 4)]
end if
var word large_array_word_1d[128]
var word large_array_word_2d[128]
var word large_array_word_3d[128]
- if !(ARRAY_SIZE == (128 * 3)) then
- var word large_array_word_4d[ARRAY_SIZE - (128 * 3)]
+ if !(LARGE_ARRAY_SIZE == (128 * 3)) then
+ var word large_array_word_4d[LARGE_ARRAY_SIZE - (128 * 3)]
end if
var word large_array_word_1c[128]
var word large_array_word_2c[128]
- if !(ARRAY_SIZE == (128 * 2)) then
- var word large_array_word_3c[ARRAY_SIZE - (128 * 2)]
+ if !(LARGE_ARRAY_SIZE == (128 * 2)) then
+ var word large_array_word_3c[LARGE_ARRAY_SIZE - (128 * 2)]
end if
var word large_array_word_1b[128]
- if !(ARRAY_SIZE == 128) then
- var word large_array_word_2b[ARRAY_SIZE - (128 * 1)]
+ if !(LARGE_ARRAY_SIZE == 128) then
+ var word large_array_word_2b[LARGE_ARRAY_SIZE - (128 * 1)]
end if
- if !(ARRAY_SIZE == (0)) then
- var word large_array_word_1a[ARRAY_SIZE - (128 * 0)]
+ if !(LARGE_ARRAY_SIZE == (0)) then
+ var word large_array_word_1a[LARGE_ARRAY_SIZE - (128 * 0)]
end if
function large_array_1'get(word in address) return word is
var word data
- if ARRAY_SIZE > 896 then
+ if LARGE_ARRAY_SIZE > 896 then
if address >= 896 then
data = large_array_word_8h[address - 896]
elsif address >= 768 then
@@ -357,10 +353,10 @@
data = large_array_word_3h[address - 256]
elsif address >= 128 then
data = large_array_word_2h[address - 128]
- elsif address >= 0 then
+ else
data = large_array_word_1h[address - 0]
end if
- elsif ARRAY_SIZE > 768 then
+ elsif LARGE_ARRAY_SIZE > 768 then
if address >= 768 then
data = large_array_word_7g[address - 768]
elsif address >= 640 then
@@ -373,10 +369,10 @@
data = large_array_word_3g[address - 256]
elsif address >= 128 then
data = large_array_word_2g[address - 128]
- elsif address >= 0 then
+ else
data = large_array_word_1g[address - 0]
end if
- elsif ARRAY_SIZE > 640 then
+ elsif LARGE_ARRAY_SIZE > 640 then
if address >= 640 then
data = large_array_word_6f[address - 640]
elsif address >= 512 then
@@ -387,10 +383,10 @@
data = large_array_word_3f[address - 256]
elsif address >= 128 then
data = large_array_word_2f[address - 128]
- elsif address >= 0 then
+ else
data = large_array_word_1f[address - 0]
end if
- elsif ARRAY_SIZE > 512 then
+ elsif LARGE_ARRAY_SIZE > 512 then
if address >= 512 then
data = large_array_word_5e[address - 512]
elsif address >= 384 then
@@ -399,37 +395,35 @@
data = large_array_word_3e[address - 256]
elsif address >= 128 then
data = large_array_word_2e[address - 128]
- elsif address >= 0 then
+ else
data = large_array_word_1e[address - 0]
end if
- elsif ARRAY_SIZE > 384 then
+ elsif LARGE_ARRAY_SIZE > 384 then
if address >= 384 then
data = large_array_word_4d[address - 384]
elsif address >= 256 then
data = large_array_word_3d[address - 256]
elsif address >= 128 then
data = large_array_word_2d[address - 128]
- elsif address >= 0 then
+ else
data = large_array_word_1d[address - 0]
end if
- elsif ARRAY_SIZE > 256 then
+ elsif LARGE_ARRAY_SIZE > 256 then
if address >= 256 then
data = large_array_word_3c[address - 256]
elsif address >= 128 then
data = large_array_word_2c[address - 128]
- elsif address >= 0 then
+ else
data = large_array_word_1c[address - 0]
end if
- elsif ARRAY_SIZE > 128 then
+ elsif LARGE_ARRAY_SIZE > 128 then
if address >= 128 then
data = large_array_word_2b[address - 128]
- elsif address >= 0 then
+ else
data = large_array_word_1b[address - 0]
end if
- elsif ARRAY_SIZE > 0 then
- if address >= 0 then
+ elsif LARGE_ARRAY_SIZE > 0 then
data = large_array_word_1a[address - 0]
- end if
end if
return data
@@ -438,7 +432,7 @@
procedure large_array_1'put (word in address, word in data) is
- if ARRAY_SIZE > 896 then
+ if LARGE_ARRAY_SIZE > 896 then
if address >= 896 then --
large_array_word_8h[address - 896] = data
elsif address >= 768 then
@@ -453,10 +447,10 @@
large_array_word_3h[address - 256] = data
elsif address >= 128 then
large_array_word_2h[address - 128] = data
- elsif address >= 0 then
+ else
large_array_word_1h[address - 0] = data
end if
- elsif ARRAY_SIZE > 768 then
+ elsif LARGE_ARRAY_SIZE > 768 then
if address >= 768 then
large_array_word_7g[address - 768] = data
elsif address >= 640 then
@@ -469,10 +463,10 @@
large_array_word_3g[address - 256] = data
elsif address >= 128 then
large_array_word_2g[address - 128] = data
- elsif address >= 0 then
+ else
large_array_word_1g[address - 0] = data
end if
- elsif ARRAY_SIZE > 640 then
+ elsif LARGE_ARRAY_SIZE > 640 then
if address >= 640 then
large_array_word_6f[address - 640] = data
elsif address >= 512 then
@@ -483,10 +477,10 @@
large_array_word_3f[address - 256] = data
elsif address >= 128 then
large_array_word_2f[address - 128] = data
- elsif address >= 0 then
+ else
large_array_word_1f[address - 0] = data
end if
- elsif ARRAY_SIZE > 512 then
+ elsif LARGE_ARRAY_SIZE > 512 then
if address >= 512 then
large_array_word_5e[address - 512] = data
elsif address >= 384 then
@@ -495,43 +489,41 @@
large_array_word_3e[address - 256] = data
elsif address >= 128 then
large_array_word_2e[address - 128] = data
- elsif address >= 0 then
+ else
large_array_word_1e[address - 0] = data
end if
- elsif ARRAY_SIZE > 384 then
+ elsif LARGE_ARRAY_SIZE > 384 then
if address >= 384 then
large_array_word_4d[address - 384] = data
elsif address >= 256 then
large_array_word_3d[address - 256] = data
elsif address >= 128 then
large_array_word_2d[address - 128] = data
- elsif address >= 0 then
+ else
large_array_word_1d[address - 0] = data
end if
- elsif ARRAY_SIZE > 256 then
+ elsif LARGE_ARRAY_SIZE > 256 then
if address >= 256 then
large_array_word_3c[address - 256] = data
elsif address >= 128 then
large_array_word_2c[address - 128] = data
- elsif address >= 0 then
+ else
large_array_word_1c[address - 0] = data
end if
- elsif ARRAY_SIZE > 128 then
+ elsif LARGE_ARRAY_SIZE > 128 then
if address >= 128 then
large_array_word_2b[address - 128] = data
- elsif address >= 0 then
+ else
large_array_word_1b[address - 0] = data
end if
- elsif ARRAY_SIZE > 0 then
- if address >= 0 then
+ elsif LARGE_ARRAY_SIZE > 0 then
large_array_word_1a[address - 0] = data
- end if
end if
end procedure
-elsif ARRAY_VARIABLE_SIZE == 4 then
+elsif LARGE_ARRAY_VARIABLE_SIZE == 4 then
var dword large_array_dword_1h[64]
var dword large_array_dword_2h[64]
var dword large_array_dword_3h[64]
@@ -539,8 +531,8 @@
var dword large_array_dword_5h[64]
var dword large_array_dword_6h[64]
var dword large_array_dword_7h[64]
- if !(ARRAY_SIZE == (64 * 7)) then
- var dword large_array_dword_8h[ARRAY_SIZE - (64 * 7)]
+ if !(LARGE_ARRAY_SIZE == (64 * 7)) then
+ var dword large_array_dword_8h[LARGE_ARRAY_SIZE - (64 * 7)]
end if
var dword large_array_dword_1g[64]
@@ -549,8 +541,8 @@
var dword large_array_dword_4g[64]
var dword large_array_dword_5g[64]
var dword large_array_dword_6g[64]
- if !(ARRAY_SIZE == (64 * 6)) then
- var dword large_array_dword_7g[ARRAY_SIZE - (64 * 6)]
+ if !(LARGE_ARRAY_SIZE == (64 * 6)) then
+ var dword large_array_dword_7g[LARGE_ARRAY_SIZE - (64 * 6)]
end if
var dword large_array_dword_1f[64]
@@ -558,44 +550,44 @@
var dword large_array_dword_3f[64]
var dword large_array_dword_4f[64]
var dword large_array_dword_5f[64]
- if !(ARRAY_SIZE == (64 * 5)) then
- var dword large_array_dword_6f[ARRAY_SIZE - (64 * 5)]
+ if !(LARGE_ARRAY_SIZE == (64 * 5)) then
+ var dword large_array_dword_6f[LARGE_ARRAY_SIZE - (64 * 5)]
end if
var dword large_array_dword_1e[64]
var dword large_array_dword_2e[64]
var dword large_array_dword_3e[64]
var dword large_array_dword_4e[64]
- if !(ARRAY_SIZE == (64 * 4)) then
- var dword large_array_dword_5e[ARRAY_SIZE - (64 * 4)]
+ if !(LARGE_ARRAY_SIZE == (64 * 4)) then
+ var dword large_array_dword_5e[LARGE_ARRAY_SIZE - (64 * 4)]
end if
var dword large_array_dword_1d[64]
var dword large_array_dword_2d[64]
var dword large_array_dword_3d[64]
- if !(ARRAY_SIZE == (64 * 3)) then
- var dword large_array_dword_4d[ARRAY_SIZE - (64 * 3)]
+ if !(LARGE_ARRAY_SIZE == (64 * 3)) then
+ var dword large_array_dword_4d[LARGE_ARRAY_SIZE - (64 * 3)]
end if
var dword large_array_dword_1c[64]
var dword large_array_dword_2c[64]
- if !(ARRAY_SIZE == (64 * 2)) then
- var dword large_array_dword_3c[ARRAY_SIZE - (64 * 2)]
+ if !(LARGE_ARRAY_SIZE == (64 * 2)) then
+ var dword large_array_dword_3c[LARGE_ARRAY_SIZE - (64 * 2)]
end if
var dword large_array_dword_1b[64]
- if !(ARRAY_SIZE == (64)) then
- var dword large_array_dword_2b[ARRAY_SIZE - (64 * 1)]
+ if !(LARGE_ARRAY_SIZE == (64)) then
+ var dword large_array_dword_2b[LARGE_ARRAY_SIZE - (64 * 1)]
end if
- if !(ARRAY_SIZE == (0)) then
- var dword large_array_dword_1a[ARRAY_SIZE]
+ if !(LARGE_ARRAY_SIZE == (0)) then
+ var dword large_array_dword_1a[LARGE_ARRAY_SIZE]
end if
function large_array_1'get(dword in address) return dword is
var dword data
- if ARRAY_SIZE > 448 then
+ if LARGE_ARRAY_SIZE > 448 then
if address >= 448 then
data = large_array_dword_8h[address - 448]
elsif address >= 384 then
@@ -610,10 +602,10 @@
data = large_array_dword_3h[address - 128]
elsif address >= 64 then
data = large_array_dword_2h[address - 64]
- elsif address >= 0 then
+ else
data = large_array_dword_1h[address - 0]
end if
- elsif ARRAY_SIZE > 384 then
+ elsif LARGE_ARRAY_SIZE > 384 then
if address >= 384 then
data = large_array_dword_7g[address - 384]
elsif address >= 320 then
@@ -626,10 +618,10 @@
data = large_array_dword_3g[address - 128]
elsif address >= 64 then
data = large_array_dword_2g[address - 64]
- elsif address >= 0 then
+ else
data = large_array_dword_1g[address - 0]
end if
- elsif ARRAY_SIZE > 320 then
+ elsif LARGE_ARRAY_SIZE > 320 then
if address >= 320 then
data = large_array_dword_6f[address - 320]
elsif address >= 256 then
@@ -640,10 +632,10 @@
data = large_array_dword_3f[address - 128]
elsif address >= 64 then
data = large_array_dword_2f[address - 64]
- elsif address >= 0 then
+ else
data = large_array_dword_1f[address - 0]
end if
- elsif ARRAY_SIZE > 256 then
+ elsif LARGE_ARRAY_SIZE > 256 then
if address >= 256 then
data = large_array_dword_5e[address - 256]
elsif address >= 192 then
@@ -652,44 +644,42 @@
data = large_array_dword_3e[address - 128]
elsif address >= 64 then
data = large_array_dword_2e[address - 64]
- elsif address >= 0 then
+ else
data = large_array_dword_1e[address - 0]
end if
- elsif ARRAY_SIZE > 192 then
+ elsif LARGE_ARRAY_SIZE > 192 then
if address >= 192 then
data = large_array_dword_4d[address - 192]
elsif address >= 128 then
data = large_array_dword_3d[address - 128]
elsif address >= 64 then
data = large_array_dword_2d[address - 64]
- elsif address >= 0 then
+ else
data = large_array_dword_1d[address - 0]
end if
- elsif ARRAY_SIZE > 128 then
+ elsif LARGE_ARRAY_SIZE > 128 then
if address >= 128 then
data = large_array_dword_3c[address - 128]
elsif address >= 64 then
data = large_array_dword_2c[address - 64]
- elsif address >= 0 then
+ else
data = large_array_dword_1c[address - 0]
end if
- elsif ARRAY_SIZE > 64 then
+ elsif LARGE_ARRAY_SIZE > 64 then
if address >= 64 then
data = large_array_dword_2b[address - 64]
- elsif address >= 0 then
+ else
data = large_array_dword_1b[address - 0]
end if
- elsif ARRAY_SIZE > 0 then
- if address >= 0 then
+ elsif LARGE_ARRAY_SIZE > 0 then
data = large_array_dword_1a[address - 0]
- end if
end if
return data
end function
procedure large_array_1'put (dword in address, dword in data) is
- if ARRAY_SIZE > 448 then
+ if LARGE_ARRAY_SIZE > 448 then
if address >= 448 then
large_array_dword_8h[address - 448] = data
elsif address >= 384 then
@@ -704,10 +694,10 @@
large_array_dword_3h[address - 128] = data
elsif address >= 64 then
large_array_dword_2h[address - 64] = data
- elsif address >= 0 then
+ else
large_array_dword_1h[address - 0] = data
end if
- elsif ARRAY_SIZE > 384 then
+ elsif LARGE_ARRAY_SIZE > 384 then
if address >= 384 then
large_array_dword_7g[address - 384] = data
elsif address >= 320 then
@@ -720,10 +710,10 @@
large_array_dword_3g[address - 128] = data
elsif address >= 64 then
large_array_dword_2g[address - 64] = data
- elsif address >= 0 then
+ else
large_array_dword_1g[address - 0] = data
end if
- elsif ARRAY_SIZE > 320 then
+ elsif LARGE_ARRAY_SIZE > 320 then
if address >= 320 then
large_array_dword_6f[address - 320] = data
elsif address >= 256 then
@@ -734,10 +724,10 @@
large_array_dword_3f[address - 128] = data
elsif address >= 64 then
large_array_dword_2f[address - 64] = data
- elsif address >= 0 then
+ else
large_array_dword_1f[address - 0] = data
end if
- elsif ARRAY_SIZE > 256 then
+ elsif LARGE_ARRAY_SIZE > 256 then
if address >= 256 then
large_array_dword_5e[address - 256] = data
elsif address >= 192 then
@@ -746,37 +736,35 @@
large_array_dword_3e[address - 128] = data
elsif address >= 64 then
large_array_dword_2e[address - 64] = data
- elsif address >= 0 then
+ else
large_array_dword_1e[address - 0] = data
end if
- elsif ARRAY_SIZE > 192 then
+ elsif LARGE_ARRAY_SIZE > 192 then
if address >= 192 then
large_array_dword_4d[address - 192] = data
elsif address >= 128 then
large_array_dword_3d[address - 128] = data
elsif address >= 64 then
large_array_dword_2d[address - 64] = data
- elsif address >= 0 then
+ else
large_array_dword_1d[address - 0] = data
end if
- elsif ARRAY_SIZE > 128 then
+ elsif LARGE_ARRAY_SIZE > 128 then
if address >= 128 then
large_array_dword_3c[address - 128] = data
elsif address >= 64 then
large_array_dword_2c[address - 64] = data
- elsif address >= 0 then
+ else
large_array_dword_1c[address - 0] = data
end if
- elsif ARRAY_SIZE > 64 then
+ elsif LARGE_ARRAY_SIZE > 64 then
if address >= 64 then
large_array_dword_2b[address - 64] = data
- elsif address >= 0 then
+ else
large_array_dword_1b[address - 0] = data
end if
- elsif ARRAY_SIZE > 0 then
- if address >= 0 then
- large_array_dword_1a[address - 0] = data
- end if
+ elsif LARGE_ARRAY_SIZE > 0 then
+ large_array_dword_1a[address - 0] = data
end if
end procedure
end if
=======================================
--- /trunk/sample/18f452_large_array.jal Fri Nov 6 22:38:43 2009
+++ /trunk/sample/18f452_large_array.jal Mon Nov 9 23:58:51 2009
@@ -19,8 +19,8 @@
-- Use "alias new_array_name is large_array_1" to rename the array
--
-- Example:
--- const dword ARRAY_SIZE = 600 -- choose number of array
variables
--- const dword ARRAY_VARIABLE_SIZE = 2 -- choose bytes size of variables
+-- const dword LARGE_ARRAY_SIZE = 600 -- choose number of array
variables
+-- const dword LARGE_ARRAY_VARIABLE_SIZE = 2 -- choose bytes size of
variables
-- include large_array -- include the array library
-- alias test is large_array_1 -- rename/alias the array
--
@@ -45,8 +45,8 @@
serial_hw_init()
-- Setup the large array
-const dword ARRAY_SIZE = 1024 -- choose number of array variables
-const dword ARRAY_VARIABLE_SIZE = 1 -- choose size of variables (byte*1)
+const dword LARGE_ARRAY_SIZE = 1024 -- choose number of array
variables
+const dword LARGE_ARRAY_VARIABLE_SIZE = 1 -- choose size of variables
(byte*1)
include large_array -- include the array library
alias test is large_array_1 -- rename/alias the array to test
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---