News:

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

Console Output

Started by drith, June 29, 2006, 12:54:13 AM

Previous topic - Next topic

drith

Hi to all folks here. I have a simple question.

How can I print bytes,words, real4,real 8 and so on to the Console Output?

.data

       b2              byte        2
       b3              word       100
       r1              real8     200.1  ;How to print this values?


   
    .code                       ; Tell MASM where the code starts

; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««

start:                          ; The CODE entry point to the program

         
       
       
     print (I gues Something but what)?     

       
       exit
; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««

end start                       ; Tell MASM where the program ends



If someone cna tell me i will be so happy  :(


Mark Jones

Hello Drith, take a look at the FpuFLtoA function explained inside \masm32\help\FpuLib.hlp

(FpuLib Courtesy of Raymond Filiatreault.) :U
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

Vortex

Welcome on board.

You can try also the printf function from C run-time libraries.

zooba

<shameless self promotion>Also, have a look at the Print (or Format) function in my ASM Runtime. It can print basically whatever data type you want in a variety of formats.</shameless self promotion>

Though it does use Raymond's FpuFLtoA function for real numbers, so you'll get the same results using that directly.

Cheers,

Zooba :U

drith

Thanks alot people. I want to ask something more. Is there any tutorials about Console Applications?
Thanks  :U

Mark Jones

Hmm... not that I know of. Did you try googling? Console apps are generally simpler than GUI apps in many ways. I think the example in \masm32\examples\advanced\msort contains nearly all the common console elements. Try to learn from that and start experimenting with this code:


; compile using "console assemble and link"
include masm32rt.inc
.data
MyString  db  "Hello world!",13,10,13,10,0

.code
start:
    print chr$(" MyConsoleApp v0.1...",13,10,13,10)
    print offset MyString
    mov eax,input(" Press ENTER to exit.")
    invoke ExitProcess,0
end start
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

Vortex

Some of Hutch's masm32 examples are console applications, check the masm32 package.

drith

Thanks alot. I will learn it what ever it will cost me. :)
Everything is mental work.
Thanks again!

dancho

check this link:

http://www.adrianxw.dk/SoftwareSite/Consoles/Consoles1.html

it is not asm,but
explain a lot about consoles...