Updated lib label scopes and continued to lesson 18

This commit is contained in:
2025-06-24 00:26:00 +03:00
parent 8d471b77f7
commit 1c0fcde351
10 changed files with 182 additions and 9 deletions
Executable
BIN
View File
Binary file not shown.
+60
View File
@@ -0,0 +1,60 @@
; %include '../lib/fl.asm' ; local
%include 'lib/fl.asm' ; build.sh
SECTION .data
fizz db 'Fizz', 0h
buzz db 'Buzz', 0h
SECTION .text
global _start
_start:
mov esi, 0
mov edi, 0
mov ecx, 0
nextNumber:
inc ecx
.checkFizz:
mov edx, 0
mov eax, ecx
mov ebx, 3
div ebx
mov edi, edx
cmp edi, 0
jne .checkBuzz
mov eax, fizz
call sprint
.checkBuzz:
mov edx, 0
mov eax, ecx
mov ebx, 5
div ebx
mov esi, edx
cmp esi, 0
jne .checkInt
mov eax, buzz
call sprint
.checkInt:
cmp edi, 0
je .continue
cmp esi, 0
je .continue
mov eax, ecx
call iprint
.continue:
mov eax, 0Ah
push eax
mov eax, esp
call sprint
pop eax
cmp ecx, 100
jne nextNumber
call quit
BIN
View File
Binary file not shown.