From d98f46ce647846b0aa30b2e16a30fd4e152a1bf5 Mon Sep 17 00:00:00 2001 From: Carlos Maiolino Date: Thu, 10 Jul 2025 22:55:07 +0200 Subject: Add new code Signed-off-by: Carlos Maiolino --- PGU/CHAP10/convprog.s | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 PGU/CHAP10/convprog.s (limited to 'PGU/CHAP10/convprog.s') diff --git a/PGU/CHAP10/convprog.s b/PGU/CHAP10/convprog.s new file mode 100644 index 0000000..49ac6fb --- /dev/null +++ b/PGU/CHAP10/convprog.s @@ -0,0 +1,35 @@ +.include "linux.s" + +.section .data + +tmp_buffer: + .ascii "\0\0\0\0\0\0\0\0\0\0\0" + +.section .text + +.globl _start + +_start: + movq %rsp, %rbp + + pushq $tmp_buffer + pushq $824 + call integer2string + addq $16, %rsp + + pushq $tmp_buffer + call count_chars + addq $8, %rsp + + movq %rax, %rdx + movq $STDOUT, %rdi + movq $tmp_buffer, %rsi + movq $SYS_WRITE, %rax + syscall + + pushq $STDOUT + call write_newline + + movq $SYS_EXIT, %rax + movq $0, %rdi + syscall -- cgit v1.2.3