assembly

NASM: How to create/handle basic bmp file using intel 64 bit assembly?

Deadly 提交于 2021-01-07 10:41:22
问题 How do I create/handle simple bmp file filling it with one color only using intel 64 bit assembly and nasm assembler? 回答1: The steps that include such operation are: Create bmp file header with fixed values (explanation of specific fields below) Create buffer which contains enough space - three bytes per pixel (one color = red + green + blue) Open/create file Fill the buffer Write header to file Write buffer to file Close file Exit program Ad. 2: This is a bit more tricky - if the number of

NASM: How to create/handle basic bmp file using intel 64 bit assembly?

你离开我真会死。 提交于 2021-01-07 10:40:52
问题 How do I create/handle simple bmp file filling it with one color only using intel 64 bit assembly and nasm assembler? 回答1: The steps that include such operation are: Create bmp file header with fixed values (explanation of specific fields below) Create buffer which contains enough space - three bytes per pixel (one color = red + green + blue) Open/create file Fill the buffer Write header to file Write buffer to file Close file Exit program Ad. 2: This is a bit more tricky - if the number of

NASM: How to create/handle basic bmp file using intel 64 bit assembly?

前提是你 提交于 2021-01-07 10:40:17
问题 How do I create/handle simple bmp file filling it with one color only using intel 64 bit assembly and nasm assembler? 回答1: The steps that include such operation are: Create bmp file header with fixed values (explanation of specific fields below) Create buffer which contains enough space - three bytes per pixel (one color = red + green + blue) Open/create file Fill the buffer Write header to file Write buffer to file Close file Exit program Ad. 2: This is a bit more tricky - if the number of

CMake Assembler Errors: No such instruction

ぃ、小莉子 提交于 2021-01-07 02:54:29
问题 Hello I am trying to build a FreeRTOS application for a Beaglebone black target which has a AM335X ARM Cortex-A8 processor. I am running windows but i am using a virtual machine that runs linux debian 10 which is what i am cross compiling from. uname -a provides: Linux debian 4.19.0-13-amd64 #1 SMP Debian 4.19.160-2 (2020-11-28) x86_64 GNU/Linux My project can be found here: https://github.com/frank2597/FreeRTOS_BBB I am getting various assembler errors when i try to compile with arm-linux

Windows 10 won't recognize hand-made PE executables that work in WINE

你。 提交于 2021-01-07 02:48:32
问题 I have made (in assembler, without a linker) an EXE for x86-64 that runs perfectly well in Wine under Linux. It's a basic HelloWorld that calls MessageBoxA and ExitProcess. Windows 10 won't recognize it, saying 'This program cannot be executed on your computer, talk to your vendor for a version that will suit your computer'. I have used PE format readers (PE Tools and CFF Explorer) to analyze my PE EXE. All numbers in the PE Optional header are the same as in other working EXEs (like os

LDR and EQU in ARM Assembly

社会主义新天地 提交于 2021-01-07 02:33:20
问题 This my assembly code. a EQU 0x20000000 b EQU 0x20000004 c EQU 0x20000008 LDR R4, =a LDR R0, [R4] LDR R4, =b LDR R1, [R4] LDR R4, =c I had two questions. what after LDR R0, [R4] what goes inside R[4] ? 0x20000000 or contents of the memory at 0x20000000 ? And second, after the last line, what goes inside R4 ? c or contents of memory at 0x20000008 ? I've searched the internet about EQU and LDR, my own guess is that to all to questions, it goes the contents of the memory, but I'm confused

execute system command (bash) using assembly?

霸气de小男生 提交于 2021-01-07 01:33:18
问题 Basically I am trying to execute the command /bin/ls using assembly, but unfortunately I am failing: SECTION .data buf: db "Hello", 5 SECTION .text global _start _start: xor eax, eax mov edx, eax push edx mov eax, 0x736c2f2f ; "sl/" push eax mov eax, 0x6e69622f ; "nib/" push eax mov ebx, esp push edx mov eax, 0x2f push eax mov ecx, esp mov eax, 11 xor edx, edx int 0x80 mov eax, 1 int 0x80 But If I change the mov eax, 11 to mov eax, 4 and add mov edx, 7 after xor edx, edx . It do print /bin/ls

execute system command (bash) using assembly?

被刻印的时光 ゝ 提交于 2021-01-07 01:32:17
问题 Basically I am trying to execute the command /bin/ls using assembly, but unfortunately I am failing: SECTION .data buf: db "Hello", 5 SECTION .text global _start _start: xor eax, eax mov edx, eax push edx mov eax, 0x736c2f2f ; "sl/" push eax mov eax, 0x6e69622f ; "nib/" push eax mov ebx, esp push edx mov eax, 0x2f push eax mov ecx, esp mov eax, 11 xor edx, edx int 0x80 mov eax, 1 int 0x80 But If I change the mov eax, 11 to mov eax, 4 and add mov edx, 7 after xor edx, edx . It do print /bin/ls

Location of Port mapped I/O address space

吃可爱长大的小学妹 提交于 2021-01-06 03:01:27
问题 I know access to ports in I/O address spaces requires specific IN/OUT instructions and they are not part of Physical memory( RAM) but I have not understood Where is the I/O address space actually located (Physically)? (some sort of RAM in )I/O controller? Reserved side of physical memory? 回答1: On the early X86 processors (and also the 8080, Z80 etc) I/O address space was on the same data and address bus as the memory, but was accessed by activating a dedicated IO-request pin on the CPU So

Null-terminating a string in MIPS?

北城余情 提交于 2021-01-05 14:43:26
问题 I'm writing strncpy in MIPS, but I'm having trouble null-terminating the string. If i do not null-terminate it myself, the string goes on and on. I have tried sb $__ 0($0) but that does not seem to work... $a0 = pointer to destination array $a1 = source string $a2 = number of characters to copy strncpy: add $t1 $zero $zero #counter beq $a2 $0 done # if num chars to copy is 0, return. j cpyLoop cpyLoop: beq $t1 $a2 done # if counter == num to copy, end lb $t2 0($a1) # load the character beq