News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

32 bit alternative to intterupts

Started by crazy_andy, July 15, 2005, 01:13:21 PM

Previous topic - Next topic

crazy_andy

I have just started learning 32 bit asm, and was having a prob with interupts, and from what i have found here, i gather that INT does not work in 32 bit.

So basically what is the alternative? and how do i print a string / character to the screen.

Thanks alot for your help.

ctt

For printing text ... is it in CLI or in a window?

for console there should be something like
invoke StdOut,ADDR txt
Atleast i think so ;)

Mark Jones

Hello, take a look at the file \masm32\help\asmintro.hlp. Also see the examples which come with MASM, they illustrate how most things are accomplished in Win32 code. :)

Basically where you would call an INT in dos to perform some function such as printing a string, you'd push arguments to the stack and call (or invoke) a Windows-API function (such as StdOut) instead. Also see the 16-bit dos programming thread below, lots of good stuff there.
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

hutch--

Andy,

You can effectively forget real mode interrupts in 32 bit windows, the OS does not work that way and if you try and use them, your code will crash. See what the interrupt is doing and then find an API function that does the same thing. File IO, console output and a massive range ofd other things that you culd never do in DOS.

In the short term for console output, try out the masm32 macros, its as easy as,


print "Hi, I am a string printed to the console",13,10
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

crazy_andy

ok, thanks. Me and my mate spent ages trying to work out what was going on. I'm hoping to make my own OS eventually, and would therefore prefer to write all the stuff myself rather than use macros. I will let you know if I get it woking. Thanks again.

roticv

If you gonna write your own OS, it is really different from coding for windows. You would end up writing to the video memory directly instead.

crazy_andy

yes, i gathed that from a tutorial somewhere, but i thought that was not the best way to do it, as a mistake could easily be made.

Do you know any good tutorials on the matter?

roticv

Which part of the OS coding are you interested in?

1) Bootloader
2) Video/Display
3) Memory management
4) Floppu drive/hdd access

There's hell lot of things to do if you are really interested in coding an OS. My 0.00001% completed OS is currently collecting a hell lot of dust because of inertia.  :toothy I can send you if you are really interesting - It is still a mess.

Anyway, a good website is http://www.osdever.net/

roticv

If you are talking about coding for windows, be sure to read iczelion's tutorial and http://win32asmcommunity.net/phpwiki/

crazy_andy

I'm going for all of it. :p

I have seen OSdever.

and nope not for windows.

I would be intrested in that code. I can imagine it would be usefull.