.equ FP, 1
.equ SP, 2
.equ RET, 3
//------------------------------------------------------------------------------
// Procedure putchar(ch)
//------------------------------------------------------------------------------
.equ ret, 0
.equ fp, 8
// procedure arguments
.equ ch, 16
.text
.globl putchar
putchar:
// function prologue
movq %RET, ret(%SP)
movq %FP, fp(%SP)
addq 0, %SP, %FP
// reserve space for 0 local variables.
subq 0, %SP, %SP
// begin of the function body
movzbq ch(%FP), %4
putc %4
// end of the function body
// function epilogue
putchar.leave:
addq 0, %FP, %SP
movq fp(%SP), %FP
movq ret(%SP), %RET
jmp %RET, %0