title: Need conversion from MASM to NASM
body: <p>Attached Files:
  File dosbox_003.png (5.722 KB)
  Write a NASM which will:</p>
  
  <p>Display your name on one line.  (Use int 21h, function 9.  The characters for carriage return and linefeed are 0Dh and 0Ah, respectively.)
  On the next line, display a prompt (once again using int 21h, function9) and read three characters from the keyboard (using int 21h, fcn 1.)  Store the characters in appropriately labeled byte variables.
  Print the three characters, one per line, (Depending on how you implement this, use either int 21h, function 9, or function 2, your choice.)
  Assemble your program using NASM and execute it using DOSBox.  </p>
  
  <p>assembling with command prompt</p>
  
  <p>given this code (with errors bolded and lines highlighted)
  i have these errors</p>
  
  <pre><code>C:\NASM&gt;nasm bal-lab2.asm -o bal-lab2.com
  bal-lab2.asm:5: error: attempt to define a local label before any non-local 
  labels
  bal-lab2.asm:5: error: parser: instruction expected
  bal-lab2.asm:6: error: attempt to define a local label before any non-local 
  labels
  bal-lab2.asm:6: error: parser: instruction expected
  bal-lab2.asm:7: warning: label alone on a line without a colon might be in 
  error [-w+orphan-labels]
  bal-lab2.asm:7: error: attempt to define a local label before any non-local 
  labels
  bal-lab2.asm:17: warning: label alone on a line without a colon might be in 
  error [-w+orphan-labels]
  bal-lab2.asm:18: error: parser: instruction expected
  bal-lab2.asm:127: error: symbol `main' redefined
  bal-lab2.asm:127: error: parser: instruction expected
  bal-lab2.asm:128: error: parser: instruction expected
  </code></pre>
  
  <p>with this code</p>
  
  <pre><code>;ff
  ;ff
  ;ff
  
  .model small line ***LINE 5***
  .stack 100h ***LINE 6***
  .data ***LINE 7***  
  nameString db 'my name here $' ;replace by your name
  prompt1 db 'Enter first character : $' ;ask for character
  prompt2 db 'Enter second character : $' ;ask for character
  prompt3 db 'Enter third character : $' ;ask for character
  
  character1 DB ? ;memory to store character
  character2 DB ? ;memory to store character
  character3 DB ? ;memory to store character
  
  .code ***LINE 17**
  main proc ***LINE 18***
  
  
  mov ax,@data ;move data address to ax
  mov ds,ax ;move ax to data segment  
  
  
  lea dx , nameString ;move content to dx
  
  mov ah,9 ;ask to print array of string
  int 21h
  
  mov dx,10 ;print \n
  mov ah,2
  int 21h  
  
  mov dx,13 ;cursor at first position
  mov ah,2
  int 21h
  
  lea dx , prompt1 ;if use lea no need to use offset
  
  mov ah,9 ;print prompt
  int 21h  
  ;ask for character input
  mov ah,1
  int 21h
  
  mov character1,al ; move to labled memory
  
  
  mov dx,10 ;print \n
  mov ah,2
  int 21h  
  
  mov dx,13 ;cursor at first position
  mov ah,2
  int 21h
  
  lea dx , prompt2 ;if use lea no need to use offset
  
  mov ah,9 ;print prompt
  int 21h  
  ;ask for character input
  mov ah,1
  int 21h
  
  mov character2,al ; move to labled memory
  
  
  mov dx,10 ;print \n
  mov ah,2
  int 21h  
  
  mov dx,13 ;cursor at first position
  mov ah,2
  int 21h
  
  lea dx , prompt3 ;if use lea no need to use offset
  
  mov ah,9 ;print prompt
  int 21h  
  ;ask for character input
  mov ah,1
  int 21h
  
  mov character3,al ; move to labled memory  
  
  
  mov dx,10 ;print \n
  mov ah,2
  int 21h  
  
  mov dx,13 ;cursor at first position
  mov ah,2
  int 21h
  
  mov dl,character1 ;move character value to dl for print
  mov ah,2
  int 21h
  
  mov dx,10 ;print \n
  mov ah,2
  int 21h  
  
  mov dx,13 ;cursor at first position
  mov ah,2
  int 21h
  
  mov dl,character2 ;move character value to dl for print
  mov ah,2
  int 21h
  
  
  mov dx,10 ;print \n
  mov ah,2
  int 21h  
  
  mov dx,13 ;cursor at first position
  mov ah,2
  int 21h
  
  mov dl,character3 ;move character value to dl for print
  mov ah,2
  int 21h
  
  
  mov ah,4ch
  int 21h
  main endp ***LINE 127***
  end main ***LINE 128***
  </code></pre>
  
  <p>the errors are highlighted and the lines too
  id appreciate any help, im very new to assembly language</p>