assembly - yasm: Expected `,' with immediate value -


given following assembly program:

bits 64 mov rax, 0b111 

yasm outputs:

error: expected `,' 

why expect comma here? nasm happily assembles this.

from yasm manual:

3.5.1. numeric constants
numeric constant number. nasm allows specify numbers in variety of number bases, in variety of ways: you can suffix h, q or o, , b for hex, octal, , binary, or can prefix 0x hex in style of c, or can prefix $ hex in style of borland pascal.

examples:
mov ax,10010011b ; binary

the nasm manual adds:

in addition, current versions of nasm accept prefix 0h hexadecimal, 0d or 0t decimal, 0o or 0q octal, , 0b or 0y binary.

tl;dr: while nasm supports both b-suffix , 0b-prefix binary literals, yasm supports suffix variant. 0b111 needs written 111b.


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -