flat assembler
Message board for the users of flat assembler.

Index > Main > int 16h hangs.

Author
Thread Post new topic Reply to topic
d0z



Joined: 11 Oct 2005
Posts: 11
Location: Sweden
d0z
Hello i'm currently learning to program assembly and are working on a starfield. I have made this example code that writes to video memory.

Code:
org 100h
use16
mov ax,0013h
int 10h
mov ax,0A000h
mov fs,ax
mov [fs:10], byte 10
xor ah,ah
int 16h
mov ax,0002h
int 10h
int 20h
    


I'm using int 16h to wait for user input before exiting. But when I use it the program hangs. What could be the reason for this behavior?

(I'm using windows XP SP2)

/Thanks.
Post 11 Oct 2005, 09:34
View user's profile Send private message Reply with quote
Artlav



Joined: 23 Dec 2004
Posts: 188
Location: Moscow, Russia
Artlav
Hm. Works fine both in Win XP sp2 and in plain DOS 95.
More details? What exactly "hangs" mean?
Post 11 Oct 2005, 11:33
View user's profile Send private message Visit poster's website Reply with quote
d0z



Joined: 11 Oct 2005
Posts: 11
Location: Sweden
d0z
>>What exactly "hangs" mean?
It means that the program won't listen to the keyboard. I have to CTRL+ALT+DEL and shutdown the program. I have run similar programs on the computer before and they where working fine. But now none of them work anymore and I have no clue why.
It doesn't matter which assembler I use either so I guess it has something to do with Windows XP.
Post 11 Oct 2005, 11:45
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
If you remove the "int 16h" the program stops hanging? Maybe something is bad when you switch to mode 2, try mode 3 to see what happend. I tested you program and works fine on my WinXP SP2.

PS: Why you use FS? remember FS is not available on 286 and lower.
Post 11 Oct 2005, 15:57
View user's profile Send private message Reply with quote
d0z



Joined: 11 Oct 2005
Posts: 11
Location: Sweden
d0z
>>If you remove the "int 16h" the program stops hanging?
Yes.

It doesn't matter if I use mode 3 since it get stuck on int 16h. I'm going to reinstall XP today and that should solve it. It's a little bit annoying though that I don't know what's causing it.

[edit] Now works fine with new XP installation. [/edit]
Post 11 Oct 2005, 16:54
View user's profile Send private message Reply with quote
Matrix



Joined: 04 Sep 2004
Posts: 1171
Location: Overflow
Matrix
:/ weird
Post 13 Oct 2005, 05:09
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.