mirror of
https://github.com/irmen/prog8.git
synced 2025-02-04 02:30:19 +00:00
doc about range step value has to be a constant
This commit is contained in:
parent
5268b05060
commit
ae6eeadf54
@ -450,7 +450,8 @@ from the starting value to (and including) the ending value::
|
||||
<start> downto <end> [ step <step> ]
|
||||
|
||||
You an provide a step value if you need something else than the default increment which is one (or,
|
||||
in case of downto, a decrement of one). Because a step of minus one is so common you can just use
|
||||
in case of downto, a decrement of one). Unlike the start and end values, the step value must be a constant.
|
||||
Because a step of minus one is so common you can just use
|
||||
the downto variant to avoid having to specify the step as well::
|
||||
|
||||
0 to 7 ; range of values 0, 1, 2, 3, 4, 5, 6, 7
|
||||
@ -729,6 +730,7 @@ for loop
|
||||
The loop variable must be a byte or word variable, and it must be defined separately first.
|
||||
The expression that you loop over can be anything that supports iteration (such as ranges like ``0 to 100``,
|
||||
array variables and strings) *except* floating-point arrays (because a floating-point loop variable is not supported).
|
||||
Remember that a step value in a range must be a constant value.
|
||||
|
||||
You can use a single statement, or a statement block like in the example below::
|
||||
|
||||
|
@ -58,6 +58,7 @@ Libraries:
|
||||
|
||||
Optimizations:
|
||||
|
||||
- treat every scalar variable decl with initialization value, as const by default, unless the variable gets assigned to somewhere (or has its address taken, or is @shared)
|
||||
- VariableAllocator: can we think of a smarter strategy for allocating variables into zeropage, rather than first-come-first-served?
|
||||
for instance, vars used inside loops first, then loopvars, then uwords used as pointers, then the rest
|
||||
- various optimizers skip stuff if compTarget.name==VMTarget.NAME. Once 6502-codegen is done from IR code,
|
||||
|
@ -179,7 +179,7 @@ processchunk_call jsr $ffff ; modified
|
||||
cx16.r3 = address
|
||||
while size {
|
||||
ubyte readsize = 255
|
||||
if size < 255
|
||||
if msb(size)==0
|
||||
readsize = lsb(size)
|
||||
cx16.r2 = cx16.macptr(readsize, bonkbuffer, false) ; can't macptr directly to bonk ram
|
||||
cx16.rombank(bonk)
|
||||
|
Loading…
x
Reference in New Issue
Block a user