Continued to lesson 15

This commit is contained in:
2025-06-22 23:14:35 +03:00
parent 6a824fbbda
commit 8d471b77f7
16 changed files with 137 additions and 0 deletions
+53
View File
@@ -1,3 +1,56 @@
;------------------------------------------
; void iprint(Integer number)
; Integer printing function (itoa)
iprint:
push eax
push ecx
push edx
push esi
mov ecx, 0
divideLoop:
inc ecx
mov edx, 0
mov esi, 10
idiv esi
add edx, 48
push edx
cmp eax, 0
jnz divideLoop
printLoop:
dec ecx
mov eax, esp
call sprint
pop eax
cmp ecx, 0
jnz printLoop
pop esi
pop edx
pop ecx
pop eax
ret
;------------------------------------------
; void iprintLF(Integer number)
; Integer printing function with linefeed (itoa)
iprintLF:
call iprint
push eax
mov eax, 0Ah
push eax
mov eax, esp
call sprint
pop eax
pop eax
ret
;------------------------------------------
; int slen(String message)
; String length calculation function