flat assembler
Message board for the users of flat assembler.

Index > Windows > Is there anything in W32 like the MS-DOS function int 16h?

Author
Thread Post new topic Reply to topic
clamicun



Joined: 04 Dec 2013
Posts: 77
Location: Muenster NRW Germany
clamicun 03 Mar 2014, 01:01
Question ?!

Is there anything in W32 like the old MS-DOS function

mov ah,0
int 16h

or
getch()

Not to use it in the program, but to check the code.
I usually use "MessageBox", "wsprintf" and %s/%d ... to see results, but sometimes I would like to just hold the program.
There is ?
Post 03 Mar 2014, 01:01
View user's profile Send private message Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2909
Location: 0x77760000
typedef 03 Mar 2014, 01:44
For Console EXEs

msvcrt.dll!system("pause") (Has implications, do not use in real applications)
kernel32.dll!Sleep(1000 * 50) /// 5 minutes or whatever
msvcrt.dll!getch()

For GUI EXEs

kernel32.dll!Sleep(1000 * 50) /// 5 minutes or whatever
kernel32.dll!MessageBox (...)

Or just use a debugger
Post 03 Mar 2014, 01:44
View user's profile Send private message Reply with quote
Walter



Joined: 26 Jan 2013
Posts: 155
Walter 03 Mar 2014, 03:16
A getch example:

Code:
;*************
;* getch.asm *
;*************

format pe console 
entry start 

include 'win32a.inc'

section '.data' data readable writeable

strPrompt db 'Press a Ukrainian button, you Russian:',0
strMsg db 13,10,'You pressed %c.',0,13,10

section '.code' code readable executable 

start: 

    cinvoke printf,strPrompt
    cinvoke _getch
    cinvoke printf,strMsg,eax
    invoke  ExitProcess,0

section '.idata' import data readable 

    library kernel32,'KERNEL32.DLL',\ 
            msvcrt,'MSVCRT.DLL' 
          
    import kernel32,\ 
           ExitProcess,'ExitProcess' 

    import msvcrt,\ 
           _getch,'_getch',\
           printf,'printf'
    
Post 03 Mar 2014, 03:16
View user's profile Send private message Reply with quote
sid123



Joined: 30 Jul 2013
Posts: 339
Location: Asia, Singapore
sid123 03 Mar 2014, 07:15
Quote:

mov ah,0
int 16h

Its not a MSDOS Function, it has existed before DOS.
It a BIOS Call.

_________________
"Those who can make you believe in absurdities can make you commit atrocities" -- Voltaire https://github.com/Benderx2/R3X
XD
Post 03 Mar 2014, 07:15
View user's profile Send private message Reply with quote
prostyle4444



Joined: 28 Jun 2013
Posts: 25
Location: Bootsector
prostyle4444 03 Mar 2014, 10:33
If you create a dos .com using INT 16h, it should work on your command prompt on WIN32. It will work only if it`s an application running in text mode.
Post 03 Mar 2014, 10:33
View user's profile Send private message Reply with quote
clamicun



Joined: 04 Dec 2013
Posts: 77
Location: Muenster NRW Germany
clamicun 04 Mar 2014, 13:09
[quote="Walter"]A getch example:

Walter, you forgot the second getch to see the result.
start:

cinvoke printf,strPrompt
cinvoke _getch
cinvoke printf,strMsg,eax
cinvoke _getch
invoke ExitProcess,0
Post 04 Mar 2014, 13:09
View user's profile Send private message Reply with quote
Walter



Joined: 26 Jan 2013
Posts: 155
Walter 04 Mar 2014, 18:43
A second getch is not required. The example is a "console" example.

You are a "thankless" idiot.
Post 04 Mar 2014, 18:43
View user's profile Send private message Reply with quote
cod3b453



Joined: 25 Aug 2004
Posts: 618
cod3b453 04 Mar 2014, 21:27
The Win32 equivalent is ReadConsole
Post 04 Mar 2014, 21:27
View user's profile Send private message Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1903
DOS386 08 Mar 2014, 08:40
> Is there anything in W32 like the MS-DOS function int 16h?

INT $16 is a BIOS call.

> you create a dos .com using INT 16h, it should work on your command prompt on WIN32

Yes, but bad idea.

> There is ?

NO: http://board.flatassembler.net/topic.php?t=11172
Post 08 Mar 2014, 08:40
View user's profile Send private message 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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.