Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
42 lines (23 sloc) 410 Bytes

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