Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

43 lines (23 sloc) 0.406 kB

Print a literal integer

C

#include <stdio.h>

int main ()
{
    printf ( "%i\n" , 123 ) ;

    return 0 ;
}

Assembly

        .include "utils.s"

        global_text main

        prepare_stack

        mov $123 , %rax

        print_int %rax

        print_nl

        return_integer $0

Assemble and run

$ gcc print-literal-int.s -lm && ./a.out
123
Jump to Line
Something went wrong with that request. Please try again.