Assembler Developer

Moderators: None (Apply to moderate this forum)
Number of threads: 960
Number of posts: 1752

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
need little help on al,[bp-di] Posted by joeyboy on 16 Nov 2012 at 9:50 PM
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:
Report
Re: need little help on al,[bp-di] Posted by joeyboy on 16 Nov 2012 at 9:59 PM
sorry the problematic part in the code can be found in the b_c label




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.