flat assembler
Message board for the users of flat assembler.
Index
> DOS > Mouse basics (callback) |
Author |
|
Tomasz Grysztar 28 Oct 2006, 21:18
First: the handler is a far-call, thus you have to use RETF to return from it.
Second: at the time when your handler is called, you may be not guaranteed that DS is what you'd like it to be (I don't remember as it is with mouse handlers exactly, though). In this case you seem to use the same segment for data as for code, so you need DS to be the same as your CS to make your variables accessible. Thus the correct handler should be like: Code: MouseHandler: push ds ; store DS push cs pop ds ; DS := CS mov [MouseX], cx mov [MouseY], dx mov [MouseButton], bx pop ds ; restore DS retf |
|||
28 Oct 2006, 21:18 |
|
DustWolf 28 Oct 2006, 22:00
Tomasz Grysztar wrote:
Thanks. I've figured it'd be something to do with a far call and thus a far return, just didn't know how to spell it in FASM. Didn't remember the DS so thanks there. And always, thanks for the assembler. |
|||
28 Oct 2006, 22:00 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.