Hi,the program is Binary Search ,but how do I print out two digits this is the code.
Code:
org 0x0100   
            ;mov  [swap],0
            mov cx,1
            jmp start
            
    
    data:   dw 60,80,0,50,70,90,20,30,10,40
    
    swap:   db 0
               
    
    
    start:  mov bx,0
            mov byte [swap],0    
            
    loopl:  mov ax, [data+bx]
            cmp ax, [data+bx+2]
            jbe noswap
            
            
            
             mov dx,[data+bx+2]
             mov [data+bx+2],ax
             mov [data+bx],dx
             mov byte[swap],1
            
            
         
    noswap: add bx,2
            cmp bx,18
            jne loopl
            
            ;xopr [swap],[swap]
           
            add cx,1
            cmp cx,10         
            jbe  start 
            
            
            mov cx,10 
            mov bx,data  
            
    printsorted:
            
            
            mov al, [bx]
            add bx,2  
            or  al, 30h
            mov ah,0eh  
            int 10h
            sub cx,1
            jnz printsorted

            mov ax,0x4c00             
            int 0x21
I'm waiting..

Last edited by shabbir; 10May2010 at 08:24.. Reason: Code blocks