T
T
Type Programmer2017-05-27 23:05:18
Programming
Type Programmer, 2017-05-27 23:05:18

I'm writing MiniOS on asm, int 13h doesn't work?

I am writing a Mini-Program to run from the BIOS
Everything works there is a bootloader, the kernel
I would like to load the 6th sector (floppies) already from under the kernel which is on the floppy disk and bend it to the code that I downloaded here that's the problem, it reads the jump freezes

org 500h
use16 

push dx   
mov [n],dl


        mov ax,0000h
        mov es,ax
        mov bx,test1
        mov ch,0                   
        mov dh,0  
        mov cl,02h         
        mov dl,80h        
        mov al,01h         
        mov ah,03h
        int 13h         
              
jmp start    





e: 
ret

endl:   
mov ah,14
xor bl,bl
mov bx,nl
call puts
jmp e


buff_out:
mov ah,14
xor bl,bl
mov bx,buff
call puts
jmp e   

del:      
        mov [buff+si],al
        dec si
        mov ah,0x0E
        mov bh,0
        mov al,8
        int 10h
        mov ah,0x0E
        mov bh,0
        mov al,0
        int 10h
        mov ah,0x0E
        mov bh,0
        mov al,8
        int 10h
        jmp com2_1   

            

com2_1:
        mov ah,0
        int 16h
        cmp ah,1Ch
        jz com2   
        cmp ah,0Eh
        jz del
        mov [buff+si],al
        inc si
        mov ah,0x0E  
        mov bh,0
        int 10h 
        jmp com2_1
com2_2:  
        mov ax,0000h
        mov es,ax
        mov bx,buff
        mov ch,0                   
        mov dh,0  
        mov cl,01h         
        mov dl,80h        
        mov al,01h         
        mov ah,02h
        int 13h 
        jmp com2
com2_3: 
        mov ax,0000h
        mov es,ax
        mov bx,buff
        mov ch,0                   
        mov dh,0  
        mov cl,01h         
        mov dl,80h        
        mov al,01h         
        mov ah,03h
        int 13h 
        jmp com2     
com2_4:
        mov ah,14
        xor bl,bl
        mov bx,buff
        call puts
        jmp com2    
com2_5: 
        mov ax,0000h
        mov es,ax
        mov bx,clr
        mov ch,0                   
        mov dh,0  
        mov cl,01h         
        mov dl,80h        
        mov al,01h         
        mov ah,03h
        int 13h 
        jmp com2 
        

com3_1:  
mov cl,1h
start1:                     
        mov ax,0000h
        mov es,ax
        mov bx,clr
        mov ch,0                   
        mov dh,0           
        mov dl,80h        
        mov al,01h         
        mov ah,03h
        int 13h
        inc cl 
        cmp cl,30h 
        jz p0
        jmp start1
               

puts:
mov al,[bx]
test al,al
jz e
inc bx
int 10h
jmp puts 

com1:    
        mov ah,14
        xor bl,bl
        mov bx,clr
        call puts
        jmp p0

com2:   
        mov si,0
        mov ah,14
        xor bl,bl
        mov bx,textE
        call puts
        mov ah,0
        int 16h
        cmp al,'1'
        jz com2_1
        cmp al,'2'
        jz com2_2
        cmp al,'3'
        jz com2_3
        cmp al,'4'
        jz com2_4  
        cmp al,'5'
        jz com2_5
        jmp p0  
 

com3:         
        mov ah,14
        xor bl,bl
        mov bx,HD
        call puts
        mov ah,0
        int 16h
        jz com3_1
        jmp p0
        

com4: 
        mov ax,0000h
        mov es,ax
        mov bx,clr
        mov ch,0                   
        mov dh,0           
        mov dl,80h
        mov cl,01h        
        mov al,01h         
        mov ah,03h
        int 13h
        mov ax,0000h
        mov es,ax
        mov bx,clr
        mov ch,0                   
        mov dh,0  
        mov cl,00h         
        mov dl,80h        
        mov al,01h         
        mov ah,03h
        int 13h  
        mov ah,14
        xor bl,bl
        mov bx,OSdel
        call puts
        jmp p0

com5: 
        mov ax,0000h
        mov es,ax
        mov bx,7c00h
        mov ch,0                   
        mov dh,0  
        mov cl,01h         
        mov dl,80h        
        mov al,01h         
        mov ah,02h
        int 13h 
        jmp 0000:7c00h

com6:
        mov ah,14
        xor bl,bl
        mov bx,creat
        call puts
        jmp p0          
com7:  
mov cl,2           
com7_0:
        mov ax,0000h
        mov es,ax
        mov bx,buff
        mov ch,0                   
        mov dh,0           
        mov dl,80h        
        mov al,01h         
        mov ah,02h
        int 13h 
        call buff_out
        call endl 
        mov ah,0
        int 16h
        cmp cl,5h
        jz com7_1
        add cl,1h
        jmp com7_0
        
com7_1: 
        mov al,'>'
        mov ah,0x0e
        int 10h 
        mov ah,0
        int 16h
        cmp al,'1'
        jz com7_2_1
        cmp al,'2'
        jz com7_2_1
        cmp al,'3'
        jz com7_2_1
        cmp al,'4'
        jz com7_2_1
        jmp p0     

com7_2_1:
        mov al,'>'
        mov ah,0x0e
        int 10h   
        pop dx
        call conv
        mov al,'>'
        mov ah,0x0e
        int 10h     
        mov dl,[n]
        mov ax,0000h
        mov es,ax
        mov bx,700h
        mov ch,0                   
        mov dh,0              
        mov al,01h         
        mov ah,02h
        int 13h    
        jmp 0000:0700h
        
        conv:
        cmp al,'1'
        jz conv1   
        cmp al,'2'
        jz conv2
        cmp al,'3'
        jz conv3
        cmp al,'4'
        jz conv4
        p4:
        ret
        
        conv1:
        mov cl,6
        jmp p4
        conv2:  
        mov cl,7 
        jmp p4
        conv3:  
        mov cl,8  
        jmp p4
        conv4:  
        mov cl,9
        jmp p4
        
        
        
        
         
        

        

com8:
       int 19h   
com0:
mov dl,[n]
mov ax,0000h
        mov es,ax
        mov bx,700h
        mov ch,0                   
        mov dh,0  
        mov cl,06h                 
        mov al,01h         
        mov ah,02h
        int 13h 
        jmp 0000:700h



       

   

start:
mov ah,14
xor bl,bl
mov bx,clr
call puts   
mov ah,14
xor bl,bl
mov bx,list
call puts
p0:  
mov ah,0
int 16h
cmp al,'1'
jz com1
cmp al,'2'
jz com2
cmp al,'3'
jz com3
cmp al,'4'
jz com4
cmp al,'5'
jz com5
cmp al,'6'
jz com6   
cmp al,'7'
jz com7
cmp al,'8'
jz com8
cmp al,'0'
jz com0       
jmp start

ret  

;; Data segment   
nl db 0Ah,0Dh,0
clr db 0Ah,0Dh,0Ah,0Dh,0Ah,0Dh,0Ah,0Dh,0Ah,0Dh,0Ah,0Dh,0Ah,0Dh,0Ah,0Dh,0Ah,0Dh,0Ah,0Dh,0Ah,0Dh,0Ah,0Dh,0Ah,0Dh,0Ah,0Dh,0Ah,0Dh,0Ah,0Dh,0Ah,0Dh,0Ah,0Dh,0Ah,0Dh,0Ah,0Dh,0Ah,0Dh,0Ah,0Dh,0Ah,0Dh,0Ah,0Dh,0Ah,0Dh,0Ah,0Dh,0Ah,0Dh,0Ah,0Dh,0Ah,0Dh,0Ah,0Dh,0      
list db 0Ah,0Dh,'1) Clear Screen',0Ah,0Dh,'2) Text Editor',0Ah,0Dh,'3) HDD clr',0Ah,0Dh,'4) Delete OS',0Ah,0Dh,'5) Boot HDD',0Ah,0Dh,'6) Creators',0Ah,0Dh,'7) File List',0Ah,0Dh,'8) Reboot WinCleaner2017',0Ah,0Dh,0 
creat db 0Ah,0Dh,'ASMcoder | NovaK',0Ah,0Dh,0     
HD db 0Ah,0Dh,'HDD 30 sectors cleared',0Ah,0Dh,0 
OSdel db 0Ah,0Dh,'OS was deleted',0Ah,0Dh,0  
textE db 0Ah,0Dh,0Ah,0Dh,'1) Print',0Ah,0Dh,'2) Load',0Ah,0Dh,'3) Save',0Ah,0Dh,'4) View',0Ah,0Dh,'5) Clear',0Ah,0Dh,0          
test1 db 'test',0
buff  db 255 
n db 0

Here is such a core, and separately the code that doesn’t really work in my opinion is a petty mistake, but to find it ... I
mean, there is a code like this if you pressed 1 then read sector 6 from a floppy disk, do not strictly judge the code, I teach assembler like that (OS by writing)
This is does not work
com7_2_1:
        mov al,'>'
        mov ah,0x0e
        int 10h   
        pop dx
        call conv
        mov al,'>'
        mov ah,0x0e
        int 10h     
        mov dl,[n]
        mov ax,0000h
        mov es,ax
        mov bx,700h
        mov ch,0                   
        mov dh,0              
        mov al,01h         
        mov ah,02h
        int 13h    
        jmp 0000:0700h
        
        conv:
        cmp al,'1'
        jz conv1   
        cmp al,'2'
        jz conv2
        cmp al,'3'
        jz conv3
        cmp al,'4'
        jz conv4
        p4:
        ret
        
        conv1:
        mov cl,6
        jmp p4
        conv2:  
        mov cl,7 
        jmp p4
        conv3:  
        mov cl,8  
        jmp p4
        conv4:  
        mov cl,9
        jmp p4

Thanks to those who tried to help or even helped!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question