05-12-2004, 09:44 AM
Before I ask my questions, I would like to tell you that I have absolutely no experience writing ASM and I don't know what I'm doing.
I'm using NASM (the Netwide Assembler) to make a QB lib. Just for starters, I wrote a little mouse routine:
This works just fine. But now, I want to put the value that I'm going to store into ax in a memory variable thingy. I try this:
This doesn't work. I also tried putting brackets around TestVar in the mov (mov ax,[TestVar]), but that didn't help. Do I need to do something special because TestVar is in a different segment from the mouse routine? Any help would be appreciated.
I'm using NASM (the Netwide Assembler) to make a QB lib. Just for starters, I wrote a little mouse routine:
Code:
uppercase
use16
segment code
align 4
global MouseShow
MouseShow:
push bp
mov bp,sp
mov ax,1
int 33h
pop bp
retf
This works just fine. But now, I want to put the value that I'm going to store into ax in a memory variable thingy. I try this:
Code:
uppercase
use16
segment data
TestVar dw 1
segment code
align 4
global MouseShow
MouseShow:
push bp
mov bp,sp
mov ax,TestVar
int 33h
pop bp
retf