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.
Questions tagged [yasm]
172 questions
0
votes
0 answers
Getting segfault on `__pthread_attr_copy` while trying to create pthreads in x86-64 with YASM
I came across this stackoverflow question while researching this exact problem but apparently it has been deleted by the original author which is a shame. Other than that, I have been unlucky in finding any other resources.
I've been trying to use…

Expert Thinker El Rey
- 148
- 1
- 9
0
votes
1 answer
YASM logical right shift zeroing out memory?
I am using the YASM assembler.
If I have a variable declared as such
segment .bss
number resb 100
and I perform a logical right shift like so
shr byte [number], 8
and if for example 123 is stored in there so that the memory looks like such…

NullPointer7
- 101
- 7
0
votes
1 answer
I cannot figure out why this code results in a segmentation fault
I am using the yasm assembler on wsl2.
segment .text
global _start
_start:
mov eax,1
I am compiling it in the following way
yasm -f elf64 -g dwarf2 -l task1.lst task1.asm
ld -o task1 task1.o

NullPointer7
- 101
- 7
0
votes
0 answers
How does assembly store letters?
I am trying to figure out how data is stored, so I have a little program:
section .data
msg1 dq 'a',
msg2 dq 'b'
msg3 dq 'ab'
GDB shows:
(gdb) p/t (int)msg1
$1 = 1100001
(gdb) p/t (int)msg2
$2 = 1100010
But:
(gdb) p/t (int)msg3
$3 =…

asd
- 266
- 7
- 15
0
votes
1 answer
Checking if number inputted is between 0 and 9 Assembly
I'm programming in assembly, and I'm very new to the language. I'm using yasm in Ubuntu to do my programming. I'm supposed to take input from the user and tell whether their input is even or odd. If the input is odd, I need to see if it's greater…

Kyle Roberts
- 9
- 1
- 6
0
votes
1 answer
TASM code gives error in YASM: instruction expected after label
I have code I made for TASM, and to my knowledge YASM is compatible with that, so IDK why I get these errors:
91.asm:3: error: instruction expected after label
91.asm:4: error: instruction expected after label
91.asm:27: error: instruction expected…

sef sf
- 117
- 1
- 8
0
votes
0 answers
input output in 64 bit assembly in linux
segment .data
n times 100 db 0 ; n = scanf()
s times 100 db 0 ; char s[100]
fmt db "%s",0
pfmt db "The input was %s",0x0a,0
extern printf
extern scanf
segment .text
global main
main:
lea rdi,[fmt]
lea rsi,[s]
xor eax,eax
…

Swapnil
- 9
- 4
0
votes
0 answers
NASM YASM Adding numbers of an array
Given the following data segment, write code in main which adds all the numbers in a. If the final sum is positive, it should be saved in RBX register, and if it is negative, then it should be saved in RCX register.
Hello! I am a bit confused on how…

OliOlivee
- 3
- 4
0
votes
1 answer
Assembly YASM Distance Squared Between 2 Points
I am honestly so lost in my Assembly class. Would anyone be willing to walk me through how to go about this problem? I am to code in EBE.
This is the problem:
Write an assembly language program to compute the distance squared between 2 points in
the…

OliOlivee
- 3
- 4
0
votes
0 answers
Yasm ebe How to Add to an Indexed Value of an Array
First Part of the Lab
Second Part of the Lab
Hello! I am confused on how to add to a value of an array in ebe. I've tried some different ways, but all resulted in an error that stated: "invalid combination of opcode and operands"
segment…

OliOlivee
- 3
- 4
0
votes
1 answer
Imagemagick yasm singularity build fails
I am attempting to convert the docker file for :
https://hub.docker.com/r/dpokidov/imagemagick/
to singularity. The docker builds fine in docker. In my singularity def file the following line fails with the error.
yasm cmake
libde265-0 libde265-dev…

user2945234
- 418
- 6
- 12
0
votes
1 answer
x86 Assembly (YASM): Floating Point exception error
I'm trying to compute the expression i_sqrt=(((i_number/i_sqrt)+i_sqrt)/2) where i_number is 78999999.
I have made my code in the ubuntu x86 yasm assembler but it throws the error described in the title. N is the number of iterations to perform; in…

BOYNUGGET
- 1
- 1
0
votes
1 answer
Assembly - Moving through a register/array with an offset of 5
Quick question. This code will not compile:
mov eax, dword [rbx+rsi*5]
I don't expect it to, with the explaination that mov and multiplication are two different CPU operations. The only reason it can be achieved is through bit-shifting.
However,…

zapshe
- 228
- 1
- 8
0
votes
1 answer
Assembly code inlining in java and how to distinguish 32bit and 64bit os in java
I need to write some assembly injection in java code for tasks at my university.
I have a class with native function
import java.io.File;
public class AsmOR {
static {
String path = System.getProperty("user.dir");
…

Saliery
- 155
- 5
- 16
0
votes
0 answers
Assembly (64 bit) - Moving a NUL into byte[rax] for "comparison"
I'm here with what is probably a very basic question, but I haven't been able to find many resources out there for the assembly I'm working with (YASM assembler, targeting 64-bit Intel CPUs [“x86-64”] on Linux).
As part of a program I'm writing, I…

Christopher M
- 99
- 2
- 7