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

Question about cursor movement during read system calls on the terminal

I am pretty new to Assembly and I am following some tutorials that I found on google / youtube (Mostly this). I am trying to fly on my own and write my own little program, but obviously, it doesn't go as it goes while following a tutorial ;) I am…
Hunkerjr
  • 83
  • 1
  • 6
0
votes
1 answer

segmentation fault while trying to run graphics in yasm

I'm trying to learn assembly for x86_64 and the only problem for now is with the VGA graphics. It tells me "Segmentation fault (core dumped) ". the loop func is to freeze the code. I've tried a lot of tutorials in the WEB, but none of them helped…
0
votes
1 answer

Porting yasm code (Intel style) to gas (AT&T style)

I'm trying to learn about strings in assembly x86 32bit but recently switched from yasm to gas and tried translating the sources file btw I used xorpd code you can see here I saw some AT&T syntax and I tried translating include file but However I…
Rohit
  • 17
  • 4
0
votes
0 answers

What is the difference between mov opcode in stack and in heap?

For example mov ax, [bp, - 2] Takes from stack. And mov ax, word [some_Label] Takes from heap. I know that stack is much faster than heap because of the 1D'ish. But using mov opcode as same method to take 2D'ish, doesn't it take the "speed from…
Dr.Gray
  • 11
  • 4
0
votes
1 answer

YASM: Instruction movsx refuses dword for operand size?

An assembly program I'm writing will not compile with the y assembler, citing: error: invalid size for operand 2 On the following line: movsx rbx, dword [rsi+4*rcx] ; Copy double-word and sign extend. However, I can't find any reason why dword…
Micrified
  • 3,338
  • 4
  • 33
  • 59
0
votes
1 answer

C calling ASM (YASM x86)

I want to call a ASM function in a c code, How do I pass the parameters to the ASM code? #include extern int * asm_mod_array(int *ptr,int size); int main() { int fren[5]={1,2,3,4,5}; /*Call ASM func*/ int…
0
votes
1 answer

Stack frame appearance during recursion. C vs assembly

I'm just learning about functions in assembly and the stack frame and so on, so I've been looking at the stack frame in gdb as I run a recursive algorithm to see what happens. If I run some recursive code in C, the stack looks like I expect it to -…
jezza
  • 331
  • 2
  • 13
0
votes
0 answers

Assembly yasm x64 compare stored string with user input string

I need to build a calculator program in x64 assembly, where the user inputs two numbers and then the program asks for an operator (+,-,*,/) from the user. I am trying to compare the input with stored variables so I can compare the input with those…
Jaynill Gopal
  • 47
  • 1
  • 9
0
votes
1 answer

Why nasm and yasm yield 67 opcode for mov r16, word [r64 - 3] instruction?

In x86-64 assembly I have following instruction mov dx, word [esi-5] Nasm 2.13.03 generates: 66 67 8B 56 FB yasm 1.3.0 generates: 67 66 8B 56 FB The 66 67 opcodes are modifiers so 8B 56 FB on its own is: mov edx, dword [rsi-5] I…
Kamil.S
  • 5,205
  • 2
  • 22
  • 51
0
votes
0 answers

Assembly minimum, middle, max, sum, and integer average of a list of numbers

I need to create a simple x96-64 assembly language program to compute the min, middle value, max, sum and integer average of a list of numbers. When I try to assemble it gives me errors. My code so far: ; ----- ; Define constants. NULL equ…
0
votes
0 answers

What is a parameter for YASM to exclude unnecessary module in object binary?

Can yasm, ld, gcc exclude unnecessary parts? I expect gcc exclude it like in C/C++. ;testSize1.asm segment .text global main extern printf,scanf ;<== difference part main: push rbp mov rbp,rsp sub rsp,16 mov…
SuperJOE
  • 73
  • 1
  • 8
0
votes
1 answer

How to organize assembly code?

Assembly code tends to be incredibly messy when there are no proper rules for organizing the code. Can anybody suggest some useful techniques for code organization, including macros, procedures, etc?
Rubyko
  • 29
  • 3
0
votes
1 answer

yasm writing to PAGEZERO in x86_64 mach-o format

I'm following a assembly book which uses the yasm assembler and ld linker. I'm on OSX 10.12 and I'm trying to assembly to Mach-O format. Unfortunately, I'm receiving a segmentation fault. This is the original .asm file: BITS 64 segment .data a dd…
0
votes
1 answer

why did not fill with zeros

Allocated array for 10000 bits = 1250 bytes(10000/8): mov edi, 1250 call malloc tested the pointer: cmp rax, 0 jz .error ; error handling at label down the code memory was allocated: (gdb) p/x $rax $3 = 0x6030c0 attempted to fill that allocated…
Bulat M.
  • 680
  • 9
  • 25
0
votes
1 answer

Extra characters at the end of filenames I create

I am attempting to learn assembler and am having an issue with this tutorial http://www.tutorialspoint.com/assembly_programming/assembly_file_management.htm it works fine and dandy except for when it writes out the file. Instead of myfile.txt, it…
Tyson
  • 25
  • 6