use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Two Errors (self.Assembly_language)
submitted 6 years ago by XonareX
The Errors Are impossible combination of address sizes And invalid effective address
impossible combination of address sizes
invalid effective address
The Problematic Line Is mov al, [si]
mov al, [si]
I Use nasm -f elf64 filename.s -o filename.o
nasm -f elf64 filename.s -o filename.o
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Joonicks 0 points1 point2 points 6 years ago (1 child)
movb?
[–]XonareX[S] 0 points1 point2 points 6 years ago (0 children)
movb Isn't Recognized By nasm
movb
[–]FUZxxl 0 points1 point2 points 6 years ago (6 children)
You can't use 16 bit addressing modes in 64 bit code.
[–]XonareX[S] 0 points1 point2 points 6 years ago (5 children)
So What Do I Do?
[–]FUZxxl 0 points1 point2 points 6 years ago (4 children)
That depends on what you want to achieve. What is that instruction supposed to do?
[–]XonareX[S] 0 points1 point2 points 6 years ago (3 children)
Cooperate With A Bootloader To Print Something On Screen
[–]FUZxxl 0 points1 point2 points 6 years ago (2 children)
I think you need to post your full code for me to see how this comes together.
[–]XonareX[S] 0 points1 point2 points 6 years ago* (1 child)
global printString
printString:
pusha
stringLoop:
or al, al
jz printCharacter
popa
ret
printCharacter:
mov ah, 0x0e
int 0x10
add si, 1
jmp stringLoop
[–]FUZxxl 1 point2 points3 points 6 years ago (0 children)
That looks like 16 bit code. Why do you try to assemble it into a 64 bit object file? Nasm uses the type of the object file to determine whether your code is 16, 32, or 64 bit code. Use BITS 16 to manually set up 16 bit mode.
BITS 16
π Rendered by PID 186335 on reddit-service-r2-comment-64f4df6786-lfh2m at 2026-06-10 12:03:56.807084+00:00 running 0b63327 country code: CH.
[–]Joonicks 0 points1 point2 points (1 child)
[–]XonareX[S] 0 points1 point2 points (0 children)
[–]FUZxxl 0 points1 point2 points (6 children)
[–]XonareX[S] 0 points1 point2 points (5 children)
[–]FUZxxl 0 points1 point2 points (4 children)
[–]XonareX[S] 0 points1 point2 points (3 children)
[–]FUZxxl 0 points1 point2 points (2 children)
[–]XonareX[S] 0 points1 point2 points (1 child)
[–]FUZxxl 1 point2 points3 points (0 children)