Quantcast
Channel: Programmers Heaven Forums RSS Feed
Viewing all articles
Browse latest Browse all 2703

need little help on al,[bp-di]

$
0
0
bp-di showing different character. what i'm trying to do here is concatenate 1 global variable to user input being stored in the stack. i don't understand why this is happening. kindly explain what might be causing this. thanks in advance guys.

deceleration look like this:

    con_u   db 32 dup(0)  
    pni2    db "$",0
    usr_v   db "C:/Users/$"
    buf3 db ?
    pni3 db "$",0


g_b_i: push bp
       mov bp,sp  
       mov bx,offset var_1  
       mov di,0
fnc:   cmp byte ptr[bx+di],"$"
       je t_t 
       mov dl,byte ptr[bx+di]
       push dx 
       inc di
       jmp fnc
       mov bx,offset inp_u       
t_t:   ;mov di,0
w_u_e: mov ah,0
       int 16h   
       cmp al,0dh 
       je  v_in
       int 29h    
       ;mov byte ptr[bx+di],al
       mov ah,00h
       push ax
       inc di
       jmp w_u_e  
       mov si,0            


v_in:    mov cx,di
         mov ah,2
         mul cx 
         mov bx,ah ;al has x2 di
         mov si,0 
         
         mov di,0
            
b_c:     cmp di,bx
         je  gofh
         mov dl,[bp-di]
        
         mov byte ptr[con_u+si],dl
         inc si
         add di,2   
         jmp b_c

gofh:

Viewing all articles
Browse latest Browse all 2703

Trending Articles