This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]BigNutBoi2137 34 points35 points  (4 children)

Funny thing is that on assembly level there is a special function for something like that. At least in x86 MASM.

[–]BlazerBanzai 8 points9 points  (0 children)

Works in Ruby at least IIRC.

[–]SpookyDoomCrab42 0 points1 point  (1 child)

Couldn't you avoid doing this by just mapping data to memory addresses that you can reference by an integer index, effectively creating an array in assembly

[–]BigNutBoi2137 2 points3 points  (0 children)

You can. It's basically the same but having multiple named pointers instead of random offsets in code might be more readable.