Skip to content

Commit

Permalink
perf(print): inline printc
Browse files Browse the repository at this point in the history
  • Loading branch information
ErrorNoInternet committed Nov 4, 2024
1 parent bd67a78 commit f5d9192
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 29 deletions.
4 changes: 2 additions & 2 deletions circles.S
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ print_colors:
mov rsi, offset purple
call print_circle

mov bl, 10
call printc
mov byte ptr [print_buf + r10], '\n'
inc r10

ret

Expand Down
4 changes: 2 additions & 2 deletions desktop.S
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ print_known_desktop:
test rax, rax
jne check_session

mov bl, '\n'
call printc
mov byte ptr [print_buf + r10], '\n'
inc r10

ret

Expand Down
4 changes: 2 additions & 2 deletions host.S
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ print_known_user:
mov rcx, 5
call print

mov bl, '@'
call printc
mov byte ptr [print_buf + r10], '@'
inc r10

mov rsi, offset green
mov rcx, 5
Expand Down
4 changes: 2 additions & 2 deletions kernel/common.S
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ print_kernel:
mov rcx, sysname_length
call print

mov bl, ' '
call printc
mov byte ptr [print_buf + r10], ' '
inc r10
14 changes: 7 additions & 7 deletions memory.S
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ print_memory:
add rsi, offset number_buf
call print

mov bl, '%'
call printc
mov byte ptr [print_buf + r10], '%'
inc r10

mov rsi, offset reset
mov rcx, 4
Expand Down Expand Up @@ -78,15 +78,15 @@ print_memory_number:
call print

print_memory_decimal:
mov bl, '.'
call printc
mov byte ptr [print_buf + r10], '.'
inc r10

mov rcx, 2
call print

ret

print_memory_zero:
mov bl, '0'
call printc
jmp print_memory_decimal
mov byte ptr [print_buf + r10], '0'
inc r10
jmp print_memory_decimal
5 changes: 0 additions & 5 deletions print.S
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ println:

ret

printc:
mov [print_buf + r10], bl
inc r10
ret

flush:
mov rax, SYS_WRITE
mov rdi, 1
Expand Down
14 changes: 7 additions & 7 deletions storage.S
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ print_storage_numbers:
add rsi, offset number_buf
call print

mov bl, '%'
call printc
mov byte ptr [print_buf + r10], '%'
inc r10

mov rsi, offset reset
mov rcx, 4
Expand Down Expand Up @@ -97,15 +97,15 @@ print_storage_number:
call print

print_storage_decimal:
mov bl, '.'
call printc
mov byte ptr [print_buf + r10], '.'
inc r10

mov rcx, 2
call print

ret

print_storage_zero:
mov bl, '0'
call printc
jmp print_storage_decimal
mov byte ptr [print_buf + r10], '0'
inc r10
jmp print_storage_decimal
4 changes: 2 additions & 2 deletions uptime.S
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ uptime_minutes:
jne print_comma_minutes

uptime_done:
mov bl, '\n'
call printc
mov byte ptr [print_buf + r10], '\n'
inc r10
ret

print_day_label:
Expand Down

0 comments on commit f5d9192

Please sign in to comment.