Bitbreaker
Registered: Oct 2002 Posts: 508 |
ACME fetch immediate values from array/table?
Hi Folx,
anyone an idea how to do the following within acme:
for (a = 0; a < x; a++) {
pos += offsets[a];
}
that would then be:
!for .a, .x {
!set .pos = .pos + ???
}
At the moment i solve the problem like this, but looks rather bloated:
!for .s, .size {
!if .s = 1 { !set .offset = 4 }
!if .s = 2 { !set .offset = 8 }
!if .s = 3 { !set .offset = 12 }
!if .s = 4 { !set .offset = 14 }
!if .s = 5 { !set .offset = 14 }
!if .s = 6 { !set .offset = 16 }
!if .s = 7 { !set .offset = 16 }
!if .s = 8 { !set .offset = 18 }
!if .s = 9 { !set .offset = 18 }
!if .s = 10 { !set .offset = 18 }
!if .s = 11 { !set .offset = 18 }
!if .s = 12 { !set .offset = 16 }
!if .s = 13 { !set .offset = 16 }
!if .s = 14 { !set .offset = 14 }
!if .s = 15 { !set .offset = 14 }
...
sta .bank,y
!set .bank = .bank + .offset
} |