Dumb flsave question November 03, 2012 09:33PM |
Registered: 11 years ago Posts: 7 |
#option echo off #option only on // only load functions that don't already exists dim i dim a(256) function aa() for i=0 to 255 a(i)=i print format$(" % 4d", i) if (i%8) = 7 print "\n" endif next endfand as you would expect, when it runs, it produces the following output:
flsave(a)but that just throws a couple of errors:
ok flsave("a") fFunctions 3
Bytes to save=336
Next free_flash=9d018000
This does appear to save something related to the array a(), as after a reset, I can do a
print a(99)and get a value of zero returned - I was hoping to get 99 back. Whereas when I perform an flclear(1) and the chip reboots, the
Re: Dumb flsave question November 04, 2012 09:54AM |
Admin Registered: 11 years ago Posts: 351 |
Re: Dumb flsave question November 04, 2012 12:32PM |
Registered: 11 years ago Posts: 7 |
System cold start --------- Hardware Detect ---------- ====================================== | machineBASIC Version 2.06 | Saves 0 | | MBCHIPMX1 Serial# 201222065 | | | Documentation www.doc.byvac.com | | Library www.mbasic.byvac.com | | | | Copyright Jim Spence 2012 | ====================================== ok [06][06] lines loaded 16 ok a 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 ok flsave("") Functions 3 Bytes to save=376 Next free_flash=9d018000 ok fltell Page size 1024 Flash start 0x9d017c00 Current start 0x9d018000 Current free space, bytes 32764 Save number 1 ok reset [c8] Text input Buffer 83 allocated Baud 115200 System cold start Curent save 1 --------- Hardware Detect ---------- ====================================== | machineBASIC Version 2.06 | Saves 1 | | MBCHIPMX1 Serial# 201222065 | | | Documentation www.doc.byvac.com | | Library www.mbasic.byvac.com | | | | Copyright Jim Spence 2012 | ====================================== ok print a(99) 0I changed the size of the array from 256 to 128, so that (with the overheads) it would fit into a single 1KB page.
Re: Dumb flsave question November 04, 2012 02:09PM |
Admin Registered: 11 years ago Posts: 351 |
constant a${1,2,3,4,5 / 6,7,8}This will be useful for fonts and the like. It is available for the MX3 now but needs more testing on the MX1.
Re: Dumb flsave question November 10, 2012 12:57PM |
Registered: 11 years ago Posts: 7 |