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
1
vote
1 answer
Graph drawing in YASM 8086
I don't know if anyone will be able to help me, but I will try to explain my problem as clearly, as possible. I am learning 8086 FPU with YASM. I want to draw y = cos(x^2+x+1) This is how this graph looks like. I am doing it in DosBox, and I am…

KazlLaur
- 63
- 6
1
vote
1 answer
How to work with string from file and sort that in YASM 8086
I got stuck on a task.
I have to write a program, which reads strings from file, sorts the last 10 strings by sixth column and then outputs sorted strings in a new file.
The first two columns contain string with [1; 20] characters, then 3-5 columns…

gailtye
- 13
- 3
1
vote
1 answer
how to properly calculate sum of digits from specific place in file? (YASM 8086)
I have one line of text in my input file, which is divided into six columns. Columns are separated from each other by a semicolon.
Here is input file example:
A1;example;10;0;55;2.44
I am looking only into third column number. In this case it would…

user10203585
- 105
- 6
1
vote
2 answers
How to skip word in YASM (8086)
I've been working on the project. The main goal is to calculate how many words do not contain letters 'B' nor 'C'. Given file has [0;1000] lines. Every line contains 6 columns.
he first two columns contain string with [1; 20] characters. Characters…

Kurbamit
- 89
- 8
1
vote
0 answers
Translating function from C to assembly, problem with div operator
I am pretty new to assembly, and I am struggling quite a bit trying to learn. I have a program written in C, that is supposed to call some routines written in assembly. I also have these routines in C, so I can inspect them and know exactly what…

AAB07
- 45
- 4
1
vote
1 answer
Working with strings from file YASM (8086)
I have one task to do. I will try to explain it as clearly as possible.
When you run the program, it asks to input (reading file and writing file).
Reading file has lines in range [1; 999]. Every line has six columns. Every column is separated by…

Kurbamit
- 89
- 8
1
vote
0 answers
movsx and movsxd different behavior
I am in an introductory assembly class in university. I am using the yasm assembler, and I understand that movsx moves a lower sized value to the higher sized register. I also understand that movsxd is for moving a double word into a higher sized,…

Jackson Brienen
- 61
- 9
1
vote
0 answers
I have an x86-64 program that only works properly when run from the gdb debugger
I have written a primitive version of malloc in x86 assembler as an exercise. The code uses a linked list to keep track of allocated memory blocks. I decided to add a function to walk the list and print out the meta data for each block and…

David Whitsed
- 11
- 2
1
vote
1 answer
extern command not importing a declared variable in other source file in assembly
So , I am trying to implement a program where it will use a variable declared in other source file. The book I am reading stated that I can import a variable and function name declared in other file by using
extern < symbolName > where the…
user14933221
1
vote
1 answer
YASM mov instruction gives error: invalid size for operand 1
I am trying to do some basic YASM coming from TASM, and this line of code will error:
mov [var], 7
I have defined the variable like so: var db 5.
Even after trying to do var: db 5 it still errored out and said:
error: invalid size for operand 1

sef sf
- 117
- 1
- 8
1
vote
1 answer
YASM is there a way to check for specific numbers in a word?
If I were to try to calculate the number of 1's in the dw data, how would I go about that? I want to store the number of 1's in memory sum. I am using EBE to code in 64 bit Assembly Language.
segment .data
data dw 1011011011001010b
…

puyopop
- 27
- 5
1
vote
0 answers
PTR error and OFFSET going from C to assembler
I have a function in C performed as follows
int rowScreen;
int colScreen;
char charac;
char tiles[DimMatrix][DimMatrix] = { {'1','2','4'},
{'6','8','A'},
…

willy22
- 25
- 5
1
vote
2 answers
Function that takes a char array and 2 indices; swapping the chars in those indices
This is my function prototype:
char* swap(char* array, int index1, int index2);
This is my assembly code:
segment .text
global swap
swap:
mov r14,[rdi+rsi]
mov r15,[rdi+rdx]
mov [rdi+rsi],r15 ;this line segfaults
mov…

Darthvader
- 35
- 3
1
vote
1 answer
Splitting NASM assembly source code into libraries
I would like to split my nasm code into several files, so that I can work on different pieces of code separately. However, the only way I found is using nasm %include macro. For example. main.asm file looks somewhat like this,
; ---- main.asm…

MinuxLint
- 111
- 9
1
vote
0 answers
Assembly Bubble Sort
I am trying to declare an array size of 10 double words and then sort them. I would like this to work even when the array size is changed.
Below is my code:
segment .data
a dd 14, 10, 23, 45, 17, 9, 54, 22, 1, 76
size dd 10
…

Defqon
- 117
- 11