Questions tagged [yasm]

Yasm is a modular assembler intended as a full rewrite of the Netwide Assembler (NASM). It is licensed under a revision of the BSD licenses.

172 questions
1
vote
2 answers

Failed to compile or link yasm program that call c function

When try to call c function from assembly code (yasm) on linux (x86-64), it failed to execute. Code function_call_c.asm: ; yasm assembly program, instruction - call c function ; compile: yasm -f elf64 function_call_c.asm -g dwarf2 && ld…
Eric
  • 22,183
  • 20
  • 145
  • 196
1
vote
0 answers

64 bit assembly: Why is ld using the 32 bit syscalls, not the 64 bit ones?

I'm wondering why I have to use the syscall numbers from /usr/include/asm/unistd_32.h, not unistd_64.h, even though I'm using the 64 Bit Registers and assembling and linking with (I think) the appropriate commands: $ yasm -f elf64 hellow.asm $ ld…
curious_weather
  • 194
  • 1
  • 7
1
vote
1 answer

Cmake:build YASM source files

I am using CMake 3.4.1 to generate and build Visual Studio 2013 64bit C++ solution.One of the project also contains .asm files which we compile in VisualStudio with yasm assembler as lib.How do I configure CMake to use yasm for those files?I haven't…
Michael IV
  • 11,016
  • 12
  • 92
  • 223
1
vote
1 answer

YASM equivalent for NASM built-in __BITS__ macro?

I have a piece of nasm assembly code which I want to be yasm compatible, but running the assembler on it gives errors on a couple of nasm-specific macros and includes, mostly related to the conditional %if __BITS__ == 32 Where __BITS__ is the…
Matt O
  • 1,336
  • 2
  • 10
  • 19
1
vote
1 answer

NASM/Yasm drops CALL after comment ending with backslash

I am currently trying to built my own boot loader and noticed something peculiar. When below code is assembled with NASM or Yasm without the marked NOP command the following CALL is missing from the binary. With the NOP included the CALL is…
Schnusch
  • 31
  • 3
1
vote
0 answers

YASM, why the global-extern-linking does not work

i´m new to assembly and using yasm, with the ebe editor. Now after the first steps i want to check the global/extern mechanism. Therefore i made 2 modules: actor.asm extern greeter section .text global main main: …
1
vote
0 answers

yasm, using 64bit register as pointer to list and having the offset be a 32bit register

I'm having trouble moving some of my previous code into a global function in assembly. I have an algorithm that accepts len and lst where len is the length of the list and lst is the list of double words itself. Before moving it into a function I…
Syntactic Fructose
  • 18,936
  • 23
  • 91
  • 177
1
vote
1 answer

Trying to install FFmpeg via mac terminal and can't cd into the yasm folder

I couldn't expand the yasm archive via terminal so I did it via Finder, went back to terminal to cd into the folder and it says it doesn't exist even though I'm looking right at it in the Finder. What am I missing? I took a screenshot but my…
1
vote
1 answer

asm usage of memory location operands

I am in trouble with the definition 'memory location'. According to the 'Intel 64 and IA-32 Software Developer's Manual' many instruction can use a memory location as operand. For example MOVBE (move data after swapping bytes): Instruction: MOVBE…
michi099
  • 49
  • 2
  • 9
1
vote
1 answer

Initialise .bss variable assembly

I have declared a variable: section .bss var resb 1 I want to initialise this in my program to the value 255. mov [var], 255 ;error on this line When compiling I get the error below: program.asm:123: error: invalid size for operand…
ojhawkins
  • 3,200
  • 15
  • 50
  • 67
1
vote
2 answers

Segmentation fault ASM on linux at printf

The following is a program from a book (Introduction to 64 Bit Intel Assembly Language Programming for Linux, by Seyfarth, 2012), chap 9. The fault (in gdb) is: Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7aa10a5 in…
user3043627
  • 15
  • 1
  • 6
1
vote
0 answers

Building libvpx under Windows 7 - yasm error

I am building libvpx under 64 bit Windows 7 (but want to target build for win32 platform), following the instructions here: http://www.webmproject.org/code/build-prerequisites/ I am doing this using Mingw, and using yasm 1.1.0. I am mostly through…
taansari
  • 95
  • 1
  • 4
  • 13
1
vote
1 answer

I'm trying to create a triangle of dots in assembly but it isn't working

I'm trying to create a triangle of dots on the screen by taking a user-entered value (to vary the size of the resulting triangle) and using it to write decrementing lines of dots. Here is the code: section .data global _start char …
Matt
  • 11
  • 2
1
vote
2 answers

Simple bootloader and bochs

I have a simple bootloader written in AT&T syntax. [bits 16] [org 0x7c00] jmp $ times 510-($-$$) db 0 dw 0xaa55 I use yasm -f bin -o boot.bin loader.s to compile it, and bochs to run. dd if=boot.bin bs=512 of=floppy.img bochs -q But bochs…
Vanzef
  • 453
  • 1
  • 5
  • 17
1
vote
0 answers

Correct syntax for using YASM assembler

When using the YASM assembler there are times when I get a syntax error upon input such as: nop dword [ds:rax+rax+0x0] or nop dword [eax+eax], etc. disassembled: 00000001000a1000 0F1F440000 nop dword [ds:rax+rax+0x0] what is the…
Dick Faps
  • 135
  • 1
  • 8