Logo

dev-resources.site

for different kinds of informations.

Running inline assembly code in C

Published at
6/29/2024
Categories
gcc
asm
assembly
Author
tallesl
Categories
3 categories in total
gcc
open
asm
open
assembly
open
Author
7 person written this
tallesl
open
Running inline assembly code in C
#include <stdio.h>

void main() {
    const char *hello = "Hello, World!\n";

    asm(
        "mov $1, %%rax\n"
        "mov $1, %%rdi\n"
        "mov %0, %%rsi\n"
        "mov $14, %%rdx\n"
        "syscall\n"
        :
        : "r"(hello)
        : "%rax", "%rdi", "%rsi", "%rdx"
    );
}
Enter fullscreen mode Exit fullscreen mode
asm Article's
26 articles in total
Favicon
Running inline assembly code in C
Favicon
What is Attack Surface Management (ASM)
Favicon
Easier than ASM
Favicon
Writing a Nes Game Day 2 -Tools & documentation
Favicon
Calling Conventions
Favicon
Writing a Nes Game Day 3 -starting with the code
Favicon
AsmBB v3.0 has been released.
Favicon
PicoCTF Writeup – Reverse Engineering (asm2)
Favicon
100 Languages Speedrun: Episode 40: x86-64 Assembly
Favicon
Learning 6502 ASM
Favicon
ARMΒ Assembly – hello world
Favicon
'function enter/leave' + .NET profiler + 64Bit. Assembler code included!
Favicon
Trace 'function enter/leave' events with a .NET profiler + detect StackOverflow. Assembler code included!
Favicon
AsmBB v2.9 has been released. With new beautiful theme and emoji!!!111 πŸ†πŸ₯‡
Favicon
Adventures in learning x86 Assembly part 1
Favicon
Assembly language learning series- intro post
Favicon
Interesting hash tree implementation
Favicon
Video of one hour of assembly programming.
Favicon
Why assembly programs are faster than HLL programs, despite that the compilers are so advanced?
Favicon
Tale about data corruption, stack and red zone
Favicon
CoreFreq
Favicon
Base 10, Base 2, Base 8, Base 16- part 1
Favicon
Mixing C++ with AMD64 (x86_64) assembly
Favicon
AsmBB v2.7 has been released. Now encrypted databases are supported.
Favicon
Fresh IDE v2.7.0 has been released
Favicon
Lightning fast installation of AsmBB forum.

Featured ones: