Created
April 11, 2013 15:37
-
-
Save kmcallister/5364432 to your computer and use it in GitHub Desktop.
maze
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # gcc -nostdlib -o maze maze.s && ./maze | |
| .globl _start | |
| _start: | |
| xor %edi, %edi | |
| inc %edi | |
| mov %rsp, %rsi | |
| go: | |
| movl $0xb195e2, (%rsi) | |
| rdtsc | |
| ## We use the lowest bit of the cycle counter | |
| ## as a coin flip. Shift here first to get | |
| ## different patterns, e.g. | |
| # shr $17, %eax | |
| and $1, %al | |
| add %al, 2(%rsi) | |
| mov %edi, %eax | |
| xor %edx, %edx | |
| mov $3, %dl | |
| syscall | |
| jmp go |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment