Skip to content
This repository has been archived by the owner on Dec 12, 2022. It is now read-only.

Latest commit

 

History

History
47 lines (39 loc) · 833 Bytes

p_53.md

File metadata and controls

47 lines (39 loc) · 833 Bytes

5.3 "Compiler un programme qui fait un putchar()"

Command to run the test (source code):

./chef.py test backend -bw doc/p_53.c
cat build/cpp-bin/assembly.s

Result :

.file  "p_53.c"
.text

.Ltext0:
  .globl main
  .type main, @function


main:
  pushq   %rbp
  movq    %rsp, %rbp
  subq $32, %rsp

  jmp    .L1_innerbeginof_main

.L1_innerbeginof_main:
  movl    $79, -8(%rbp)
  pushq    %rdi
  movl    -8(%rbp), %edi                 # call Param
  call    putchar
  popq     %rdi
  movl    $75, -16(%rbp)
  pushq    %rdi
  movl    -16(%rbp), %edi                 # call Param
  call    putchar
  popq     %rdi
  movl    $10, -24(%rbp)
  pushq    %rdi
  movl    -24(%rbp), %edi                 # call Param
  call    putchar
  popq     %rdi
  jmp    .L0_endof_main

.L0_endof_main:
  leave
  ret