On Jul 29, 2005, at 18:58, Amir Karger wrote:
So I think to avoid these problems I need to declare image at the top of every Z-code sub. My question is, is there any cost associated with always declaring this array holding 50-500K ints, other than having one P register always full?
No not at all. just emit the 'image' declaration and the global fetch on top of each subroutine. If image isn't used below, the register occupied by image will even be reused.
You could even avoid the global lookup (if image isn't used), by making .GETWORD a bit smarter:
.macro GET_WORD(RES, IDX) .local pmc image unless_null image , .$ok image = global ".." .local $ok: .RES = image[.IDX] # or some such ... .endm But that's probably not worth the effort. leo