nasm

UNIX domain datagram socket — server does not receive all records

送分小仙女□ 提交于 2020-06-17 09:40:54
问题 I have a multicore program that uses a UNIX domain datagram socket. Three cores (or more, but 3 in this example) send records with sendto and one core receives records with recvfrom and processes the records sent by multiple clients. Each core is assigned to a separate core (using its affinity mask). The program processes a data series in a loop and at the end of each iteration the cores send data to the socket. The data series is small 64-bit integers. My problem is that I receive records

Copying to arrays in NASM

╄→尐↘猪︶ㄣ 提交于 2020-06-16 08:41:53
问题 I have to write in assembly code which copy 100 bytes in memory in loop. I wrote it like this: section .data a times 100 db 1 ;reserve 100 bytes and fill with 1 b times 100 db 0 ;reserve 100 bytes and fill with 0 section _start global _start _start: mov rsi, a ;get array a address mov rdi, b ;get arrat b address _for: ;początek pętli cmp cx, 100 ;loop jae _end_for ;loop push cx ;loop mov byte al, [rsi] ;get one byte from array a from al mov byte [rdi], al ;put one byte from al to array b inc

How to use Cmake to build binaries with NASM

孤者浪人 提交于 2020-06-12 12:17:34
问题 I'm learning x64 and I hate make, so I'm trying to get cmake to build binaries with NASM. This is roughly supported by cmake but the documentation is crap. This is what I have working right now by cobbling together stuff from stack overflow and then cutting out everything that doesn't break the build: cmake_minimum_required(VERSION 3.14) set(CMAKE_ASM_NASM_LINK_EXECUTABLE "ld <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>") set(CMAKE_ASM_NASM_OBJECT_FORMAT elf64) project(test_project ASM

How to use Cmake to build binaries with NASM

こ雲淡風輕ζ 提交于 2020-06-12 12:16:35
问题 I'm learning x64 and I hate make, so I'm trying to get cmake to build binaries with NASM. This is roughly supported by cmake but the documentation is crap. This is what I have working right now by cobbling together stuff from stack overflow and then cutting out everything that doesn't break the build: cmake_minimum_required(VERSION 3.14) set(CMAKE_ASM_NASM_LINK_EXECUTABLE "ld <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>") set(CMAKE_ASM_NASM_OBJECT_FORMAT elf64) project(test_project ASM

How to use Cmake to build binaries with NASM

假如想象 提交于 2020-06-12 12:15:12
问题 I'm learning x64 and I hate make, so I'm trying to get cmake to build binaries with NASM. This is roughly supported by cmake but the documentation is crap. This is what I have working right now by cobbling together stuff from stack overflow and then cutting out everything that doesn't break the build: cmake_minimum_required(VERSION 3.14) set(CMAKE_ASM_NASM_LINK_EXECUTABLE "ld <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>") set(CMAKE_ASM_NASM_OBJECT_FORMAT elf64) project(test_project ASM

How syscall knows where to jump? [closed]

三世轮回 提交于 2020-06-12 04:42:48
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 11 months ago . How does Linux determine the address of another process to execute with a syscall? Like in this example? mov rax, 59 mov rdi, progName syscall It seems there is a bit of confusion with my question, to clarify, what I was asking is how does syscall works, independently of the

Compile assembler in nasm on mac os

两盒软妹~` 提交于 2020-06-10 05:52:41
问题 So, i write some instruction on asm, and compile them. nasm -f macho test.asm Now, nasm generate obj file, test.o gcc test.o Returned next error: ld: warning: ignoring file test.o, file was built for unsupported file format which is not the architecture being linked (x86_64) Undefined symbols for architecture x86_64: "_main", referenced from: start in crt1.10.6.o ld: symbol(s) not found for architecture x86_64 collect2: ld returned 1 exit status in gcc line, i used -arch i386 (x86_64),

Why does my assembly program (x86) freezes in Dosbox when I try to run it?

帅比萌擦擦* 提交于 2020-06-09 07:04:30
问题 Things to note: Working in x86 assembly (16-bit); using Nasm; running program in DosBox. When I try to run the program in DosBox, the emulator freezes (I'm not sure freezes is the right word since the cursor still blinks) and refuses to respond to input. The first time I tried running it DosBox actually crashed. Here is my code: ;ASSIGNMENT 3 org 100h section.data: prompt1 db 0dh, 0ah, 0dh, 0ah, "Please input a signed base-10 integer: $" prompt2 db 0dh, 0ah, "Your number in binary is: $"

Why does my assembly program (x86) freezes in Dosbox when I try to run it?

China☆狼群 提交于 2020-06-09 07:01:28
问题 Things to note: Working in x86 assembly (16-bit); using Nasm; running program in DosBox. When I try to run the program in DosBox, the emulator freezes (I'm not sure freezes is the right word since the cursor still blinks) and refuses to respond to input. The first time I tried running it DosBox actually crashed. Here is my code: ;ASSIGNMENT 3 org 100h section.data: prompt1 db 0dh, 0ah, 0dh, 0ah, "Please input a signed base-10 integer: $" prompt2 db 0dh, 0ah, "Your number in binary is: $"

nasm gcc command error with subprogram as seperate file

*爱你&永不变心* 提交于 2020-06-09 05:25:31
问题 testing subprograms as external files in nasm. After running : nasm -f elf subprogram2.asm nasm -f elf get_int.asm I then run the gcc: gcc subprogram2.o get_int.o -o stuff.exe I then get the following error: subprogram2.o: In function 'main': subprogram2.asm:(.text+0x19): undefined reference to 'get_int' subprogram2.asm:(.text+0x3d): undefined reference to 'get_int' collect2: error: ld returned 1 exit status section .text of the file containing main has both the extern get_int and global get