is it just me or nasm?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Mr_Spam

is it just me or nasm?

Post 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?
Mr_Spam

Re:is it just me or nasm?

Post by Mr_Spam »

never mind. PROBLEM SOLVED!

please disregard this thread
Post Reply