|
When we try to translate x = 2 into a vm command it becomes
push constant 2
pop local x
but what about string constants? str = "hello world"
My best guess is that one of the OS libraries dynamically creates a string object and then set str to point to that string object.
//numbers and chars treated the same
push constant 'h'
push constant 'e'
...
push constant '\0'
call String.Maker <num_char> pop local str
it would really help me if someone could clarify and maybe where in the book I can find it. If you say chapter 12 then that is why I didn't know...cause I'm on chapter 11.
|