title: Difference between NASM and 8086
body: <p>Good evening people. I just started learning about assembly language, and I've found very good examples online to follow. Someone recommended me to use NASM to start learning, but the examples I've found I've seen they use 8086 assembler. As I was following the examples, I noticed that if I used NASM they didn't run on a linux terminal, however if I installed an 8086 assembler emulator, it did work.</p>
  
  <p>My question is: is there any difference between NASM and 8086 assembler? to me they should be the same thing since it is assembly code. If not, is there anyone that could explain me if there is ANY difference between both? and why they don't run being the same code on both NASM and 8086</p>
  
  <p>this is the code I was following that did run on 8086 assembler but not on NASM on Linux</p>
  
  <pre><code> DATA SEGMENT
       NUM1 DB ?
       NUM2 DB ?
       RESULT DB ?
       MSG1 DB 10,13,"ENTER FIRST NUMBER TO ADD : $"
       MSG2 DB 10,13,"ENTER SECOND NUMBER TO ADD : $"  
       MSG3 DB 10,13,"RESULT OF ADDITION IS : $"
  ENDS
  CODE SEGMENT 
      ASSUME DS:DATA CS:CODE
  START:
        MOV AX,DATA
        MOV DS,AX
  
        LEA DX,MSG1
        MOV AH,9
        INT 21H
  
        MOV AH,1
        INT 21H
        SUB AL,30H
        MOV NUM1,AL
  
        LEA DX,MSG2
        MOV AH,9
        INT 21H
  
        MOV AH,1
        INT 21H
        SUB AL,30H
        MOV NUM2,AL
  
        ADD AL,NUM1
  
        MOV RESULT,AL
  
        MOV AH,0 
        AAA
  
        ADD AH,30H
        ADD AL,30H 
  
        MOV BX,AX
  
        LEA DX,MSG3
        MOV AH,9
        INT 21H
  
        MOV AH,2
        MOV DL,BH
        INT 21H
  
        MOV AH,2
        MOV DL,BL
        INT 21H
  
        MOV AH,4CH
        INT 21H     
  ENDS
  END START
  </code></pre>
  
  <p>Thanks and hope you have a good night.</p>