Skip to content
This repository
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

file 41 lines (23 sloc) 0.41 kb

Print a literal string

C

#include <stdio.h>

int main ()
{
    printf("%s", "abc") ;

    return 0 ;
}

Assembly

        .include "utils.s"

        global_text main

        prepare_stack

        literal_string "abc" , %rax

        print_string %rax

        print_nl

        return_integer $0

Assemble and run

$ gcc print-literal-string.s -lm && ./a.out
abc
Something went wrong with that request. Please try again.