News:

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

outputing text to the console.

Started by Citric, April 06, 2005, 07:11:07 AM

Previous topic - Next topic

Citric

Hi all

How do you write to the console? also what is the lowest Appication level(ring 3) available?

I have used WriteFile with stardardout and printf, but i know there are others, just wondering what other people use

Adam

liquidsilver

You could use the StdOut from the Masm library. That's what I do as it's very fast. Remember to assemble as a console application if you can't see the console. Often people forget that. I can see when printf would be more useful, but usually I just make a plan.

I can't help with the application level, but I'm interested to know what it is.

hutch--

Citric,

I like the "brick" you have as an avatar.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Citric

Cheers Hutch

I have had her about 6 years now, she has only been that colour for about 6 months.

liquidsilver:
The StdOut from the Masm library uses WriteFile with standard out.

thanks for the reply tho.

Adam

Vortex

Hi Citric,

Why StdOut and printf ( from C run-time DLLs ) doesn't meet your requirements? What's wrong with them?

Tedd

You can also use WriteConsole, but this doesn't allow you to redirect the output to a file; so I prefer using WriteFile.

Applications run in ring 3. (If this is what you mean by application level?)
No snowflake in an avalanche feels responsible.

thomasantony

Hi,
Ring 0 is OS
I forgot what are Ring 1 and Ring 2 as I haven't done OS coding for a while. I think they are for device drivers. Ring 3 is user or applications.

Thomas :U
There are 10 types of people in the world. Those who understand binary and those who don't.


Programmer's Directory. Submit for free

Citric

Hi Vortex, Tedd

Nothing is wrong woth StdOut and printf(well cleaning up the stack afterwards sucks), just curious.

thanks Tedd, i will have to have a look at the api for WriteConsole.

Cheers
Adam

Infro_X

Windows uses 2 CPLs (or rings). CPL of 3 for applications. CPL of 0 for Device Drivers. No other CPLs are used. But, i am unsure of what CPL a user mode driver runs at, I would assume ring 0 as well.

rags

Citric,
     What kind of automoblie is that  on your avatar?
regards,
    Rags
God made Man, but the monkey applied the glue -DEVO

Vortex

Hi Citric,

Nice avatar, I liked it  :U

hutch--

Rags,

I don't know if you got them in the US in the late 60s, early 70s but they were made as a "Morris" and the model was a "Mini" with the high perforance variation being a "Cooper S". I remember a mate of mine having a Cooper S that he could get about 105 MPH out of (1275CC engine.) ery few cars were competitive to a Mini in tight built up areas where they had both the acceleration and handled brilliantly well, especially for someone who knew how to drive them.

I grew up with Ford V8s which were for open spaces but around the cities or on very tight winding roads a Mini was a giant killer. When you see the old car chase movies, it was mainly fantasy but a well driven Mini Cooper S could actually do it in narrow streets, right angle turns and tight winding roads.

they were called "BRICKS" here in OZ.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Citric

Thanks Vortex!!

Just a stupid little note, the 'Mini' was made in England right up until September 2000(might have been 2001, cant remember),and still looking very much like my 1963 version. Then BMW came along and made the bini!(I dont like them).

another thing, the 'Mini' weather is was a Morris, An Austin,a Layland or a Rover made in England, Australia or Brazil and probably a number of other countries, is one of the best cars ever made and sooooo much fun to drive, Like a Go CarT.

Looks like WriteFile is my best bet!

Cheers EveryOne!!

ps The colour of my car is a Ford Australia colour called 'Citric Acid'

rags

Hutch,
  After talking about the mini with an older friend at work, I found out they were available here at least in the '60's,
as an Austin. I think the main reason they stopped the sale of them here was the safety factor of those cars, they couldn't meet the minimum safety standards for automobiles, that were set by our government.
  The BMW Mini is a nice looking car, but here in the States goes for around $20,000 US. A bit much for me.
Rags
God made Man, but the monkey applied the glue -DEVO

Jimg

The Mini was available in the states thru 1967.  I bought one of the last, a 1967 Austin Cooper 'S' Mark II.   I Drove it for nearly 15 years before it became too much to keep up for me.  Now I'm sorry I ever sold it.