-
A simple hello world
I just downloaded the latest version of nasm but the "Hello World!" code in the FAQ doesn't work now. It gives me some kind of error message on Line #1. I just restarted doing assembly after a few months and I remember I was able to run some asm code using nasm but can't now. Any idea on what would the starting lines for Nasm (eg .Stack, .Code, etc) and where to put the actual code?
-
type it
type your program here and i will see if i can halp u but whole program please
-
PHP Code:
jmp start
Message1 db "Hello World!$"
start:
mov ah, 09h
mov dx, offset Message1
int 21h
mov ax, 4c00h
int 21h
-
try this
.modal small
.stack 100h
.data
rec db 'zdravo narode(hello world)$'
.code
start:
mov dx,@data
mov ds,dx
mov dx,offset rec
mov ah,9h
int 21h
mov ah,4ch
int 21h
end start
-
Doesn't work - gives me errors (starting from line #1) saying something like "attempt to define a local label before any non-local labels". Also gives me an error message on line 9 saying "Comma or end of line expected" and another error on line #14 saying "parser: instructions expected".
-
hmhmh
i think we don't use the same version of asm or something like that
try again
jmp start
rec db 'ererrw$'
start:
mov dx,@data
mov ds,dx
mov dx,offset rec
mov ah,9h
int 21h
mov ah 4ch
int 21h
or something like this it should works
-
-
sranje
try to download this version of asm and 100% it will works
-
sranje
well i sugest u to download some other version of asm becouse seample which i gave u is fine and it works very good on my conm
here some code from my program:
.model small
.stack 100h
.data
poruka db 13,10,'usa$'
sifra db 'minja$'
duz equ $-sifra
text db 13,10,'Enter password:$'
poz db 13,10,'HMHMHM$'
.code
start:
mov dx,@data
mov ds,dx
poc:
mov dx,offset text
mov ah,9
int 21h
mov bx,0
mov cx,0
ponovi:
xor ax,ax
mov ah,8
int 21h
cmp al,13
je lab1
cmp al,sifra[bx]
jne lab2
ispis:
mov dl,'*'
mov ah,2
int 21h
inc bx
jmp ponovi
lab2:
mov cx,1
jmp ispis
lab1:
cmp cx,1
jne p2
p1:
lea dx,poruka
mov ah,9
int 21h
jmp poc
p2:
cmp bx,duz-1
jne p1
lea dx,poz
mov ah,9
int 21h
kraj:
mov ah,4ch
int 21h
end start
tell me if it works
-
else
well i sugest u to download some other version of asm becouse seample which i gave u is fine and it works very good on my conm
here some code from my program:
.model small
.stack 100h
.data
poruka db 13,10,'usa$'
sifra db 'minja$'
duz equ $-sifra
text db 13,10,'Enter password:$'
poz db 13,10,'HMHMHM$'
.code
start:
mov dx,@data
mov ds,dx
poc:
mov dx,offset text
mov ah,9
int 21h
mov bx,0
mov cx,0
ponovi:
xor ax,ax
mov ah,8
int 21h
cmp al,13
je lab1
cmp al,sifra[bx]
jne lab2
ispis:
mov dl,'*'
mov ah,2
int 21h
inc bx
jmp ponovi
lab2:
mov cx,1
jmp ispis
lab1:
cmp cx,1
jne p2
p1:
lea dx,poruka
mov ah,9
int 21h
jmp poc
p2:
cmp bx,duz-1
jne p1
lea dx,poz
mov ah,9
int 21h
kraj:
mov ah,4ch
int 21h
end start
tell me if it works
-
There is no other version of asm. I think you are talking about the assembler. Right now I am using NASM 0.98 but I'll try to use TASM and see if that works.
-
yes
i work whit that kind of asembller TASM i don't know what is NASM and all programs from upside going to work if u download TASM
end i think u gonna find good version of TASM but if you need help just say
good luck
-
mmiill
This is TASM, so it certainly won't work in Nasm...
However, I wouldn't work with:
mov dx, offset rec
I'd use
lea dx, rec
It's the newer and better way.
dozwidanie
CodeRonin
-
!
ok lea is better than mov dx,offset text , but his question was about mov etc.
do u know something about programing whit PORT ......??
:o :o :o :o :o
-
type this in. I had the same problem too. Hope this helps.
section .data
db txtString "Hello World$"
section .bss
section .text
@start:
mov dx,txtString
mov ah,9h
int 21h
@end:
mov ah,4Ch
int 21h
-
mmiill, that code listing works in NASM?