If you want to write it generically, use STAGE
WriteAttachment
SG S0
MOVE 0 V99
FILEOPEN OnSuccess JMP S1
SG S1
FILEWRITE SL[V99] OnSuccess JMP S2
SG S2
INC V99
STRGE V99 87 (index is 0..86)
EXIT // this exits IMMEDIATELY
// if got this far, JMP back to S1 with new V99 index
JMP S1