Last active
September 3, 2022 14:07
-
-
Save 3outeille/ab274bfdbb65b0946ff33fde39e7c8ae to your computer and use it in GitHub Desktop.
register sum weird results
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
extern exit | |
global _start | |
section .data | |
a: dd -76, -84, -84, -132 | |
b: dw 406, 406, 406, 406 | |
section .text | |
_start: | |
movdqa xmm0, [a] | |
pmovsxwd xmm2, [b] | |
paddq xmm0, xmm2 | |
;Expected: 330, 322, 322, 274 | |
;Results: 330, 323, 322, 275 | |
call exit |
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
all: | |
nasm -f elf64 main.asm | |
gcc -g -nostartfiles -no-pie -o main main.o | |
debug: | |
echo "dashboard -output /dev/pts/0\nb _start\nrun >> gdb-log.txt 2>&1\nlayout asm\ndashboard assembly\ndashboard source\ndashboard threads\nset logging file gdb-log.txt\nset logging on\nset trace-commands on\nrecord\n" > gdb-commands.txt | |
gdb -x gdb-commands.txt main | |
clean: | |
rm *.o main gdb-commands.txt gdb-log.txt .gdb_history | |
.PHONY: | |
clean asm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment