tsoding / porth

It's like Forth but in Python
627 stars 50 forks source link

x86_64 push only accepts immidiate 32bit #7

Closed RobertBendun closed 3 years ago

RobertBendun commented 3 years ago

Push instruction supports only 8,16 and 32 bit immidiate values. To push 64 bit, value must be stored in register e.g.

mov rax, 8589934592
push rax

Relevant code https://github.com/tsoding/porth/blob/0b4afffec0d8a6db51a685cd3565eca5952e0794/porth.py#L286-L287

rexim commented 3 years ago

@RobertBendun yep, I also ran into this issue recently! Thanks for reporting it!