title: ASSEMBLY TASM, STRING OUTPUT PROB using procedure
body: <p>ASSEMbLY MAStER PLEASE HELP.. IM HAVING TROUBLE IN OUTPUT,
  assembly masters, please help. im having trouble in output.
  the output should be:</p>
  
  <p>eg.</p>
  
  <p>DEstroit♥Me</p>
  
  <p>but the output in my code is messed up></p>
  
  <p>where did i go wrong??
  Please help
  Thanks in advance;</p>
  
  <p>HERE IS MY CODE:</p>
  
  <pre><code>.model small
  .stack 0100h
  .data
  a db 0ah, 0dh,"ENTER FIRSTNAME: $"
  b db 0ah, 0dh,"ENTER SECONDNAME: $" 
  c db 20d, ?, 20d DUP("$")
  d db 20d, ?, 20d DUP("$")
  .code
  main proc
  mov ax, @data
  mov ds, ax
  mov es, ax
  call cls
  call input
  call output
  
  mov ax, 4c00h
  int 21h
  main endp
  
  ;clear screen
  cls proc
  mov ax, 0600h
  mov bh, 07h
  mov cx, 0000h
  mov dx, 184fh
  int 10h
  cls endp
  
  ;INPUT
  input proc
  mov ah, 09h
  mov dx, OFFSET a
  int 21h
  mov ah, 0ah
  mov dx, OFFSET c
  int 21h
  mov ah, 09h
  mov dx, OFFSET b
  int 21h
  mov ah, 0ah
  mov dx, OFFSET d
  int 21h
  input endp
  
  ;OUTPUT
  output proc
  mov ah, 09h
  mov dx, OFFSET c+2
  int 21h
  mov ah, 02h
  mov dl, 003h
  int 21h
  mov ah, 09h
  mov dx, OFFSET d+2
  int 21h
  output endp
  
  end main
  </code></pre>