Why is the XOR operation not toggling the player variable in my x86 assembly tic-tac-toe game?

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
GitHub
Tricky-tac-toey/assembly/game.asm at main · Marveeamasi/Tricky-tac-...
Tic-tac-toe game built with low level , for performance optimization - Marveeamasi/Tricky-tac-toey
attachment 0
2 Replies
Marvee Amasi
Marvee Amasi4mo ago
there's a segmentation fault in this line from label update_draw:
mov [rbx], cl
mov [rbx], cl
I can't get what i am doing wrong
Marvee Amasi
Marvee Amasi4mo ago
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
change_player:
mov si, player
xor byte[si], 1
ret
Does not change the variable player, the value is always 0
Want results from more Discord servers?
Add your server