From 26121a86d0c95d56e040479f4d53cd08c99f7991 Mon Sep 17 00:00:00 2001 From: ErrorNoInternet Date: Tue, 20 Aug 2024 20:53:19 +0800 Subject: [PATCH] perf: move reset escape code into separator symbol --- colors.S | 6 +----- desktop.S | 6 +----- kernel/common.S | 6 +----- memory.S | 6 +----- shell.S | 6 +----- storage.S | 6 +----- symbols.S | 2 +- system.S | 6 +----- uptime.S | 6 +----- 9 files changed, 9 insertions(+), 41 deletions(-) diff --git a/colors.S b/colors.S index a1edd9a..af2511c 100644 --- a/colors.S +++ b/colors.S @@ -13,12 +13,8 @@ print_colors: mov rcx, 10 call print - mov rsi, offset reset - mov rcx, 4 - call print - mov rsi, offset separator_symbol - mov rcx, 4 + mov rcx, 8 call print mov rsi, offset blue diff --git a/desktop.S b/desktop.S index 827c4ea..401ab89 100644 --- a/desktop.S +++ b/desktop.S @@ -13,12 +13,8 @@ print_desktop: mov rcx, 10 call print - mov rsi, offset reset - mov rcx, 4 - call print - mov rsi, offset separator_symbol - mov rcx, 4 + mov rcx, 8 call print mov rsi, offset desktop diff --git a/kernel/common.S b/kernel/common.S index 03356de..8387643 100644 --- a/kernel/common.S +++ b/kernel/common.S @@ -13,12 +13,8 @@ print_kernel: mov rcx, 10 call print - mov rsi, offset reset - mov rcx, 4 - call print - mov rsi, offset separator_symbol - mov rcx, 4 + mov rcx, 8 call print mov rsi, offset sysname diff --git a/memory.S b/memory.S index d8a1778..c27e7f3 100644 --- a/memory.S +++ b/memory.S @@ -15,12 +15,8 @@ print_memory: mov rcx, 10 call print - mov rsi, offset reset - mov rcx, 4 - call print - mov rsi, offset separator_symbol - mov rcx, 4 + mov rcx, 8 call print mov rax, memtotal diff --git a/shell.S b/shell.S index 3779fe7..7c7e08a 100644 --- a/shell.S +++ b/shell.S @@ -13,12 +13,8 @@ print_shell: mov rcx, 10 call print - mov rsi, offset reset - mov rcx, 4 - call print - mov rsi, offset separator_symbol - mov rcx, 4 + mov rcx, 8 call print mov rsi, offset shell_path diff --git a/storage.S b/storage.S index 73c9d3b..66bffdf 100644 --- a/storage.S +++ b/storage.S @@ -15,12 +15,8 @@ print_storage: mov rcx, 10 call print - mov rsi, offset reset - mov rcx, 4 - call print - mov rsi, offset separator_symbol - mov rcx, 4 + mov rcx, 8 call print mov rax, [statfs_buf + 16] diff --git a/symbols.S b/symbols.S index 937f16f..4ee709b 100644 --- a/symbols.S +++ b/symbols.S @@ -23,7 +23,7 @@ colors_symbol: .ascii " " separator_symbol: - .ascii " " + .ascii "\x1b[m\xf " circle_symbol: .ascii " " diff --git a/system.S b/system.S index 547995a..d7c187f 100644 --- a/system.S +++ b/system.S @@ -13,12 +13,8 @@ print_system: mov rcx, 10 call print - mov rsi, offset reset - mov rcx, 4 - call print - mov rsi, offset separator_symbol - mov rcx, 4 + mov rcx, 8 call print mov rsi, offset pretty_name + 1 diff --git a/uptime.S b/uptime.S index 6b6e3d8..08f63db 100644 --- a/uptime.S +++ b/uptime.S @@ -24,12 +24,8 @@ print_uptime: mov rcx, 10 call print - mov rsi, offset reset - mov rcx, 4 - call print - mov rsi, offset separator_symbol - mov rcx, 4 + mov rcx, 8 call print xor r9, r9