| | |
16-2- 32
![]() |
•
•
Join Date: Jan 2009
Posts: 17
Reputation:
Solved Threads: 0
Learning assembly and 'am trying to move from 16-bit to 32-bit.
i have this assembly code to display a string in a message box.
How do i get the very string displayed in command line without using the api MessageBoxA ; what would be the assembly code like? Please give a suggestion, probably i could get going from there.
thank you.
i have this assembly code to display a string in a message box.
Assembly Syntax (Toggle Plain Text)
;tasm32/tlink32 .386 .model flat extrn MessageBoxA:proc extrn ExitProcess:proc .data head db " 'Heard melodies are sweet,",0 body db " but those unheard Are sweeter;'",0 .code begin: push 0 push offset head push offset body push 0 call MessageBoxA push 0 call ExitProcess end begin
thank you.
Last edited by eniwe; May 3rd, 2009 at 11:09 pm.
•
•
Join Date: Apr 2009
Posts: 39
Reputation:
Solved Threads: 5
If I'm understanding you correctly you just want to print the string to command line without using the o/s api MessageBox?
Well let's see you could use the interrupt interface; a quick google search for dos print interrupt or the like should lead you to a multitude of tutorials.
You could also just print directly into the video buffer, once again lots of tutorials available and will take a little bit more thinking on your part.
Well let's see you could use the interrupt interface; a quick google search for dos print interrupt or the like should lead you to a multitude of tutorials.
You could also just print directly into the video buffer, once again lots of tutorials available and will take a little bit more thinking on your part.
Last edited by sysop_fb; May 4th, 2009 at 12:09 am.
•
•
Join Date: Jan 2009
Posts: 17
Reputation:
Solved Threads: 0
•
•
•
•
If I'm understanding you correctly you just want to print the string to command line without using the o/s API MessageBox?
Well let's see you could use the interrupt interface
Assembly Syntax (Toggle Plain Text)
org 100h mov ah, 9h mov dx, offset msg int 21h msg db "Thanks you... $"
However, i thank you for taking the time to respond to my uncertainty.
Regards…
To write text to the console, first use GetStdHandle:
http://msdn.microsoft.com/en-us/libr...31(VS.85).aspx
Use that to get the handle for the StdOut device. Then you can use this handle in a call to WriteFile:
http://msdn.microsoft.com/en-us/libr...47(VS.85).aspx
There are some tutotials and examples:
http://www.deinmeister.de/wasmtute.htm
http://win32assembly.online.fr/index.html
http://msdn.microsoft.com/en-us/libr...31(VS.85).aspx
Use that to get the handle for the StdOut device. Then you can use this handle in a call to WriteFile:
http://msdn.microsoft.com/en-us/libr...47(VS.85).aspx
There are some tutotials and examples:
http://www.deinmeister.de/wasmtute.htm
http://win32assembly.online.fr/index.html
while (CPU is present) {some assembly required}
Or with the handle just use WriteConsole() http://www.daniweb.com/code/snippet1165.html Doesn't really matter.
"Jedenfalls bin ich überzeugt, daß der Alte nicht würfelt."
"I became very sensitive to what will happen to all this and all of us." -Two geniuses named Albert
"I became very sensitive to what will happen to all this and all of us." -Two geniuses named Albert
![]() |
Other Threads in the Assembly Forum
- Previous Thread: Assembly fatal ........
- Next Thread: XY position
| Thread Tools | Search this Thread |





