Follow

@neauoire I'm having difficulty reading a file with UF. I run:

4000 dup 1000 fileread
and have no problem
But if I up 1000 to 2000 or some other larger number, I get a working stack underflow.

The file has 9732 total bytes

· · Web · 1 · 0 · 0

@aw I think it's because the read buffer size is not large enough for that much. UF takes 1/3 of uxn's memory, the rest is working memory, it's possible that it runs out of space. It should probably throw a warning, might want to report that.

@neauoire the alternative then would be to read 1 byte at a time? looking to read a file of newline-separated values

@aw yeah, that's what I would do. It's also sort of how the file device is designed.

I'm not sure if you can read uxntal yet, but for example the drifblim assembler walks through files 1 character at a time to assemble a rom: git.sr.ht/~rabbits/drifblim/tr

Sign in to participate in the conversation
Merveilles

Revel in the marvels of the universe. We are a collective of forward-thinking individuals who strive to better ourselves and our surroundings through constant creation. We express ourselves through music, art, games, and writing. We also put great value in play. A warm welcome to any like-minded people who feel these ideals resonate with them.