MOV is Turing-complete (2013) [pdf]
11–20 of 29 posts
Re: MOV is Turing-complete (2013) [pdf]
#12I did not understand how mov could be used for comparison. Is a register set to a certain value if the contents are already the same value when it's trying to write?
If X and Y are equal, then you would have written first 0 and then 1 to the same address, so the final read would give you 1.
If X and Y are different, then you would read back the 0 you wrote to address X.
Re: MOV is Turing-complete (2013) [pdf]
#13I did not understand how mov could be used for comparison. Is a register set to a certain value if the contents are already the same value when it's trying to write?
Put a guard value in address X. Write not-guard value to Y. Read X. If the value you just read wasn't the guard value, then Y was the same as X.
Re: MOV is Turing-complete (2013) [pdf]
#14It’s actually a shame that there is no `mov rip, ...` instruction. That would make it truly Turing-complete. ARM has this instruction! (Of course, jmp [...] works just as well, but it isn’t called mov)
MOV -(PC), -(PC)
This is a 1-word self-replicating program that (when run from the topmost RAM address) will clobber entire RAM by copying itself all over it.[1] https://en.wikipedia.org/wiki/PDP-11_architecture#Addressing...
Re: MOV is Turing-complete (2013) [pdf]
#15It’s actually a shame that there is no `mov rip, ...` instruction. That would make it truly Turing-complete. ARM has this instruction! (Of course, jmp [...] works just as well, but it isn’t called mov)
Re: MOV is Turing-complete (2013) [pdf]
#16I did not understand how mov could be used for comparison. Is a register set to a certain value if the contents are already the same value when it's trying to write?
If you are comparing values X and Y, just write 0 to address X and 1 to address Y. Then read address X. If X and Y are equal, then you would have written first 0 and then 1 to the same address, so the final read would give you 1. If X and Y are different, then you would read back the 0 you wrote to address X.
Now, how would you do greater than / less than comparisons?
Re: MOV is Turing-complete (2013) [pdf]
#17I honest to goodness thought this was going to be about the video container format. In retrospect this makes much more snse.
Re: MOV is Turing-complete (2013) [pdf]
#18Re: MOV is Turing-complete (2013) [pdf]
#19Re: MOV is Turing-complete (2013) [pdf]
#20It’s actually a shame that there is no `mov rip, ...` instruction. That would make it truly Turing-complete. ARM has this instruction! (Of course, jmp [...] works just as well, but it isn’t called mov)
Note that Arm64 also doesn't have this kind of direct access to the program counter.