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
2
votes
1 answer

Sorting algorthm: assembly

I am implementing a function for a bubblesort algorithm in assembly language (Linux, 64-bit, yasm). The function is called from within a C file where the array and the array size are passed through to assembly via rdi and rsi respectively. xor…
cadebe
  • 651
  • 1
  • 12
  • 35
2
votes
2 answers

Which AVX registers should I use to avoid 3-byte VEX prefixes?

I am currently working on an implementation of Bitslice DES for x64, and I would like to know how I could avoid 3-byte VEX prefixes as much as possible with the following AVX instructions: vpor vpxor vpand vpandn I was told I should use 2-byte VEX…
meriken2ch
  • 409
  • 5
  • 15
2
votes
2 answers

ffmpeg brew yasm

I'm trying to install ffmpeg via brew. It error I get with yasm is "Error: You must `brew link pkg-config yasm' before ffmpeg can be installed" When doing so I'm told that my permissions are insufficient. "Linking…
Johann
  • 273
  • 1
  • 6
  • 11
2
votes
1 answer

Mac OS X: YASM: error: macho: sorry, cannot apply 32 bit absolute relocations in 64 mode

NASM compiles just fine, but when i use YASM I'm getting the following error: hello.asm:12: error: macho: sorry, cannot apply 32 bit absolute relocations in 64 bit mode, consider "[_symbol wrt rip]" for mem access, "qword" and "dq _foo" for…
EhevuTov
  • 20,205
  • 16
  • 66
  • 71
2
votes
1 answer

Performing a Backspace in YASM or NASM assembly

I have a program reading characters in raw mode. That is, any characters input are read immediately instead of being buffered. I would like to know how to perform a backspace. That is, when I press the Backspace key, it should delete the character…
InvalidBrainException
  • 2,312
  • 8
  • 32
  • 41
2
votes
1 answer

Moving indirect-addressed value into AL works, but moving it into an 8-bit rXb register doesn't in yasm

I have a byte-array of characters declared in .data chars db 'spipopd' and I have set rdi to point to the base index of this array mov rdi, chars At some point, I want to put a character from the array into an 8-bit register. The first statement…
InvalidBrainException
  • 2,312
  • 8
  • 32
  • 41
2
votes
2 answers

Woes of implementing selection sort in x86 NASM or YASM Assembly

I am attempting to implement a selection sort of an array in NASM that runs on 64-bit Linux. The array is declared as: section .bss strbuf resb 10 small resb 1 ; current minimum value The sort algorithm itself is quite simple, but I feel limited…
InvalidBrainException
  • 2,312
  • 8
  • 32
  • 41
1
vote
1 answer

How can I write to console in MS Windows with yasm?

I tried this code (using interruptions), but it is for DOS: mov eax, 42 ; write 42 to console mov ecx, 10 ; in decimal out_int_loop: xor edx, edx div ecx push eax add dl, '0' ; one digit mov ah, 2 ; 2 is code for writing…
andrybak
  • 2,129
  • 2
  • 20
  • 40
1
vote
0 answers

Is it possible for the assembler to have an impact on the code's performance?

I know that the compiler can have a direct impact, but can the assembler also have any impact? I saw two sources that said the assembler can optimize by rearranging instructions to reduce clock cycles, and that it can also reduce overhead (redundant…
1
vote
1 answer

Implementing a function that checks if floating point number belongs to the given interval (YASM 8086)

I have to write a program that would filter text lines from the input file. Each line is divided into six columns. Columns are separated from each other by a semicolon. I implemented 3 filters: Second column has to contain no u or v letters. Third…
user10203585
  • 105
  • 6
1
vote
0 answers

Adding floating point numbers in assembly (yasm 8086)

I have to write a program that would filter text lines from the input file. Each line is divided into six columns. Columns are separated from each other by a semicolon. I implemented 3 filters: Second column has to contain no u or v letters. Third…
user10203585
  • 105
  • 6
1
vote
1 answer

How to transfer data from one file to another in YASM with interrupt

I am writing my own interrupt, to transfer 100 bytes from one file to another file. (My interrupt code is 0x88). What the interrupt does: the interrupt gets two addresses DS:DX - input file; ES:CX - output file, (in .com programs, DS always == to…
KazlLaur
  • 63
  • 6
1
vote
1 answer

How to draw a graph within the intervals in YASM 8086

I have to draw a graph y = cos(x2+x+1) interval: [-π/2,π/2]. I have the graph without the interval, just making calculations with the screen resolution 320 x 200. This is my code so…
KazlLaur
  • 63
  • 6
1
vote
1 answer

Handling multiple conditional jumps in Assembly (x86-64)

I'm trying to make a calculator in Assembly where the equation is read in as a string (ie 9+3-2/5*4) as opposed to reading in one digit at a time and asking the user which operation they want to perform. I figured out how to parse the string so I…
1
vote
1 answer

How to check if there is newLine YASM 8086

I've been working on the project. The main goal is to calculate how many words do not contain letters from 'a' to 'k'. Given file has [0;1000] lines. Every line contains 6 columns. The first two columns contain string with [1; 20] characters.…
KazlLaur
  • 63
  • 6