assembly - NASM issue on OSX 64-bit -


i'm learning asm , have small problem. can't "declare" more 1 string in "section.data". i'm trying this:

section .data     string1 db "test1 ", 0;     string2 db "test2 ", 0; section .text     global _test     extern _puts     _test:          lea rdi, [rel string1]          call _puts          lea rdi, [rel string2]          call _puts          ret 

this function supposed print "test1 test2 " on stdout, doesn't work. result is:

test2 

it works last string stored! if know why, please tell me!

if you're using nasm 2.11.08, there issue documented here relative addressing combined multiple entries in data section.

you can 1 (or both) of 2 things certain.

first, can have @ generated assembler code investigate it's actually churning out. that's definitive option since can see cpu running.

second, can test code earlier release of nasm see if problem goes away. if so, that's indirect evidence it's bug in 2.11.08 causing issues.


Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -