From 8bd72097d5ec3bd0c413d5689ec2bdc5e5437d6e Mon Sep 17 00:00:00 2001 From: maelstrom Date: Wed, 24 Jul 2024 22:27:55 +0300 Subject: [PATCH] broken print_uint --- main.asm | 4 ++-- main.bin | Bin 683 -> 721 bytes print_util.asm | 27 +++++++++++++++++++++++++++ ret_util.asm | 3 +++ 4 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 ret_util.asm diff --git a/main.asm b/main.asm index bbbfc03..4897e56 100644 --- a/main.asm +++ b/main.asm @@ -5,8 +5,8 @@ section KERNEL follows=BOOTSECTOR vstart=1000h main: - mov bx, HELLO_WORLD - call println + mov bx, 24734 + call print_uint jmp $ ; Halt diff --git a/main.bin b/main.bin index fe4ae114ded8add81650b9ce28f78f5193a857a9..7530319b183793a36179919373394c17839a9e81 100644 GIT binary patch delta 72 zcmZ3@dXaSlBNNNKgcnmLvocLJPw2d{d%r;QYsQ^i47(T@zJF{!WY8(z{DYzN^^1W2 aiH8}$z#}y$CtpXQJijO>MNz@Zg#iFL1{<#c delta 34 qcmcb}x|($ZBNNLkfftICS(&B^dZgy$ ax, rem -> dx + + add dx, 0x30 ; Add ascii '0' + mov [bx], dx ; Place that value into the buffer + + cmp ax, 0 ; Continue looping as long as the quotient is not 0 + jnz .loop + + ; Print the contents of the buffer + ; String is already in bx + call print + + popa + ret + +_print_dec_buff: resb 6 %macro print_ch 1 push ax diff --git a/ret_util.asm b/ret_util.asm new file mode 100644 index 0000000..ad2fe5e --- /dev/null +++ b/ret_util.asm @@ -0,0 +1,3 @@ +%macro pushargs + +%endmacro \ No newline at end of file