nntp2http.com
Posting
Suche
Optionen
Hilfe & Kontakt

FASM und float's ausgeben??

Von: Jens Kallup (jkallup@web.de) [Profil]
Datum: 05.10.2009 17:33
Message-ID: <4aca11c8$0$9749$6e1ede2f@read.cnntp.org>
Newsgroup: de.comp.lang.assembler
Hallo,

im folgenden habe ich AssemblerCode, der sich problemlos
unter/mit FASM übersetzen lässt.
Mich erstaunt, das die EXE max. 2048 Byte groß ist.
Aber nun zum Problem:
Wie kann ich "float's" auf der Console ausgeben - das label
hello_msg lässt sich ja auch problemlos ausgeben ...
Ich schätze mal das was mit den pushes nicht stimmt?
Für Infos/Fidbäck bin ich sehr dankbar

Euer
Jens

---
format PE console
entry start

include 'i:\Projekte\kmice\asm\include\win32a.inc'

section '.code' code readable executable
start:
push ebp
mov ebp, esp

fld qword [LC0]
fld qword [LC1]
faddp
fst qword [_var1]
fld qword [LC2]
fld qword [_var1]
faddp
fst qword [_var2]

push _var2
push _var1
ccall [printf], user_str

ccall [printf], hello_msg
ccall [getchar]
stdcall [ExitProcess],0

leave
ret

section '.data' data readable writeable
hello_msg db 'Hello, world!',0
LC0: dq 2.1000
LC1: dq 3.0500
LC2: dq 2.5000
_var1: dq 0.0
_var2: dq 0.0
user_str: db "--> %f, %f",10,0


section '.idata' import data readable

library kernel,'kernel32.dll',\
msvcrt,'msvcrt.dll'

import kernel,\
ExitProcess,'ExitProcess'

import msvcrt,\
printf,'printf',\
getchar,'_fgetchar'
---


[ Auf dieses Posting antworten ]

Antworten