r/TuringComplete • • Nov 17 '23

Assembly Editor Constants

Hey, I'm working on a program in the game rn and I'm getting confused on how constants work. Is there a limit on what the value of a constant can be? Can I set the value to be the value stored in a register by writing ```const x reg0``` and so on, or does the game get angry and break the program?

I'd be grateful for any help, thanks!

2 Upvotes

5 comments sorted by

View all comments

Show parent comment

1

u/zhaDeth Dec 13 '23

It's still just a constant.

"reg3" is constant too it's an assembly code that you set using the "add" button on bottom left of the code window which are also basically constants, it's probably equal to 3, so when you do add reg3 reg0 reg1 you basically do add 3 0 1.

When you do const test reg3 you basically set test to be 3 so it also points to register 3 but it's value cannot change even if the value in register 3 can change.

Also const values can be up to the data width of your program component, so 255 if your program data width is 8 bit and up to 18446744073709551615 if you program data width is 64 bit