I'm learning assembly language with Intel syntax. I was using Win XP and MASM 4.0 and everything was ok. Recently I migrated all of my homeworks to Linux (Ubuntu 10.04), trying to assemble codes with nasm or nasm I receive a lot of errors (almost in each line). I also added .intel_syntax in first line. here is my first assembly program:
.intel_syntax
stksg   segment stack
    db 32 dup ("stack")
stksg   ends
datasg segment para 'data'
    m1 db "Enter 1st number: " , '$'
    m2 db "Enter 2nd number: " , '$'
    number1 label byte
    max1 db 10
    ln1 db ?
    n1  db 10 dup(0)
    dollar db '$'
    number2 label byte
    max2 db 10
    ln2  db ?
    n2 db 10 dup(0)
    p1 db 10 dup(' ')
datasg ends
codesg segment para 'code'
    main proc far
    assume ds:datasg, cs:codesg, ss:stksg
    mov ax, datasg
    mov ds, ax
    mov ah,06h  ;clear screen
    mov al,25   ;number of rows to clear
    mov ch,0    ;UL row
    mov cl,0    ;UL col
    mov ch,24   ;BR row
    mov cl,79   ;BR col
    mov bh,07h  ;attribute (back:black, text:white)
    int 10H
    mov dx, offset m1   ;prints m1
    mov ah,9h
    int 21h
    mov ah,0ah      ;gets number 1
    mov dx,offset number1
    int 21h 
    mov ah,02h      ;move cursor
    mov dh,1
    mov dl,0
    mov bh,0
    int 10h
    mov dx, offset m2   ;prints m2
    mov ah,9h
    int 21h  
    mov ah,0ah      ;gets number 2
    lea dx,number2
    int 21h 
    mov ah,09h
    mov bl,ln1
    lea ax,ln1
    ;mov [ln1+1],'$'
    mov p1,bl
    add ln1,30h
    ;lea dl,(offset p1)+1
    ;mov [dl],'$'
    ;mov offset p1+1,'$'
    lea dx,ln1
    int 21h   
;   mov bx,0
;   mov cx,1
;f1:    mov dl,[offset n1+cx]
;   sub dl,30h      ;convert to number   
;   mov al,10   
;   mul bx          ; ax = bx*10    
;   mov bx,ax       ; bx=ax === bx=bx*10    
;   add bx,dl    
;   inc cx   
;   cmp cx,ln1    
;   jne f1
    mov ah,01h    
    int 21h
    mov ax, 4c00h
    int 21h
    main endp
codesg ends
end main
end
 
     
    