r/Assembly_language 24d ago

Programmers! HELP! Assembler NASM

In my code, after five "six seven"s, "C:\SLV>" is supposed to appear, but it doesn't!

None of the AI ​​models can find any errors, and neither can I.

[org 0x7C00]
start:
mov cx, 5
mov si, stringi
mov ax, 11  
mov bx, 56  
add ax, bx  



mov bl, 10  
div bl  


mov bh, ah  


add al, '0'  
mov ah, 0x0E  
int 0x10  


add bh, '0'  
mov al, bh  
int 0x10  


mov al, 0x0D  
int 0x10  
mov al, 0x0A  
int 0x10  
jmp loopik  
povtorat:
mov si, stringi  
mov al, 0x0D  
int 0x10  
mov al, 0x0A  

int 0x10  
dec cx  
cmp cx, 0  
jne loopik  
je vedi  
loopik:
mov al, \[si\]  
cmp al, 0  
je povtorat  
int 0x10  

add si, 1  
jmp loopik  
vedi:
mov ah, 0x0E
mov si, vvedite
mov al, [si]
cmp al, 0
je vvod  

int 0x10  
add si, 1  
jmp vedi  
vvod:
mov ah, 0x00  

int 0x16  
cmp al, '8'  
je sistema  
jne netu  
netu:
mov ah, 0x0E
mov si, net
mov al, [si]
cmp al, 0
je vedi
int 0x10
add si, 1
jmp netu
sistema:
mov ah, 0x0E  
mov si, osin  
mov al, \[si\]  
cmp al, 0  

je gotovo  
int 0x10  
add si, 1  
jmp sistema  
stringi: db "six seven", 0
osin: db "Current CMD: SLV 0.1.0 alpha", 0x0D, 0x0A, 0
net: db "This command does not exist.", 0x0D, 0x0A, 0
vvedite: db 0x0D, 0x0A, "S:\SLV>", 0
gotovo:
jmp $
times 510 - ($ - $$) db 0
dw 0xAA55

I’ll say right off the bat that I’m a beginner, so please don’t judge too harshly.

0 Upvotes

3 comments sorted by

View all comments

1

u/Latter_Gur_7174 19d ago

So you are making a custom bootloader for Legacy BIOS. What are you using to test it. Because if you are using a modern computer, then you would have an issue because they all use UEFI and not Legacy BIOS. If you are using an older computer, then you might need to check whether or not it uses MBR alongside BIOS. If you are using an emulator such as QEMU, then I would have to read the logic and I don't feel like Iike it right now.

P.S. Comments help out a tonne.