From 1b8cebf54c10acc4d895d88063f6a6eaf4aa9923 Mon Sep 17 00:00:00 2001 From: Andreas Kapp Lindquist Date: Wed, 8 Oct 2025 13:33:47 +0200 Subject: fix(outputGenerator.s): renamed printNum to print_num --- src/outputGenerator.s | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/outputGenerator.s') diff --git a/src/outputGenerator.s b/src/outputGenerator.s index 8a885d1..d547c59 100644 --- a/src/outputGenerator.s +++ b/src/outputGenerator.s @@ -5,7 +5,7 @@ newline: tab: .byte 9 # '\tab' - +.section .text # -------------------------------------------- # FUNCTION: print_tab # PURPOSE : print a tab character ('\t') @@ -55,12 +55,12 @@ print_buffer: cmpq $0, %rsi jle done # if n > 0 print_coordinate - movq %rdi, %rdx # keep pointer here, rdi will be used for printNum + movq %rdi, %rdx # keep pointer here, rdi will be used for print_num loop: # print x and tab movq (%rdx), %rdi # load x - call printNum + call print_num push %rdx # save pointer push %rsi # save n call print_tab @@ -69,7 +69,7 @@ loop: # print y and newline movq 8(%rdx), %rdi # load y - call printNum + call print_num push %rdx # save pointer push %rsi # save n call print_newline @@ -90,9 +90,9 @@ ret # Print RDI as an unsigned integer without any new line. # Note: the function does not follow the ordinary calling convention, # but restores all registers. -.type printNum, @function -.globl printNum -printNum: +.type print_num, @function +.globl print_num +print_num: push %rbp movq %rsp, %rbp @@ -107,7 +107,7 @@ printNum: movq %rdi, %rax # arg movq $0, %r9 # digit count -.LprintNum_convertLoop: +.Lprint_num_convertLoop: movq $0, %rdx movq $10, %rcx idivq %rcx @@ -115,8 +115,8 @@ printNum: push %rdx addq $1, %r9 cmpq $0, %rax - jne .LprintNum_convertLoop -.LprintNum_printLoop: + jne .Lprint_num_convertLoop +.Lprint_num_printLoop: movq $1, %rax # sys_write movq $1, %rdi # stdout movq %rsp, %rsi # buf @@ -124,7 +124,7 @@ printNum: syscall addq $8, %rsp addq $-1, %r9 - jne .LprintNum_printLoop + jne .Lprint_num_printLoop # restore pop %r9 -- cgit v1.2.3-70-g09d2