Become a leader in the IoT community!
Join our community of embedded and IoT practitioners to contribute experience, learn new skills and collaborate with other developers with complementary skillsets.
Join our community of embedded and IoT practitioners to contribute experience, learn new skills and collaborate with other developers with complementary skillsets.
I am working on a text based tic-tac-toe game for some users, using x86 assembly on an Intel Core i7 12700K systems running Ubuntu 22.04. I’m using NASM assembler and GNU Linker for development.
I am beginning to have an issue with the `change_player` function. The code attempts to toggle the player variable between “0” and “1” using XOR, **but the value remains unchanged**.
What is causing the player variable to not be modified as expected?
Are there any issues with memory access or data manipulation in the change_player function?
What are the recommended approaches for managing player turns please ?
https://github.com/Marveeamasi/Tricky-tac-toey/blob/main/assembly/game.asm
I have edited the code adding and committed it , but strangely, I’ve found out that the `change_player` label isn’t changing anything, in fact it looks like that my entire code is not modifying the variables of the section data.
“`
change_player:
mov si, player
xor byte[si], 1
ret “`
Does not change the variable player, the value is always **0**
CONTRIBUTE TO THIS THREAD