Your code has some errors: the variable hello doesn't requiere colon, the word start with two dots isn't right, you are trying to access the variable without initialize the data segment, and the code to display the string won't do it.
Any assembler program x86 requires a basic structure to work, then you can add more code, procedures, etc. Next is that basic structure :
.stack 100h
.data
my_variable db 'hello$'
.code
;INITIALIZE DATA SEGMENT.
mov ax,@data
mov ds,ax
call my_procedure
;FINISH.
mov ax,4c00h
int 21h
proc my_procedure
mov dx,offset my_variable
mov ah,9
int 21h
my_label:
ret
endp
First you have the stack, in this case, 256 bytes (100h).
Next comes the data segment for your variables.
The code segment requires the data segment to be initialized, or you won't be able to access your variables. After that you add all your code, but never forget to finish the program properly. At the bottom you may add your procedures.
In the procedure there is a label and the syntax to declare it: label-name followed by colon, and the right way to display the variable.
Hope this helps you.
Sorry, I forgot: I used EMU8086 compiler.
Another edit: pay attention to the '$' sign at the end of 'hello', required for any string you display this way. If you forget it, weird characters will be displayed too.
section .data
andsection .code
. Also..start
and.exit
is going to produce an error, not sure what you wanted with that.end
is also not used bynasm
. Maybe you are trying to compile code intended for a different assembler. – Jester