Page 1 of 1

is it just me or nasm?

Posted: Tue Dec 24, 2002 11:32 am
by Mr_Spam
When I declare a varriable a value at compile time, at run time, that varriable contains the value 0. When i set a varriable a vaule at runtime, it keeps its value. heres the code:
cmp [var], 61h
je debug
cmp [var], 0
je debug2

debug:

mov ax, 0E07h
int 10h ;beep once
jmp $

debug2:
mov cx, 2
mov ax, 0E07h

.test:

int 10h ;beep twice
loop .test

var db 61h
it beeps twice! it should only beep once! when i compile, var's value turns to 0 or var's address isn't what its sapose to be.

mov [var], 61h
cmp [var], 61h
je debug
cmp [var], 0
je debug2

debug:

mov ax, 0E07h
int 10h ;beep once
jmp $

debug2:
mov cx, 2
mov ax, 0E07h

.test:

int 10h ;beep twice
loop .test

var db 61h
it beeps once. which is what it should do.....

can any one help trying to fix this?

Re:is it just me or nasm?

Posted: Tue Dec 24, 2002 11:44 am
by Mr_Spam
never mind. PROBLEM SOLVED!

please disregard this thread