Hey. Where are you learning assembly from? Eitherway good job =D. Now i want to learn assembly too xD
What does that above part do? Well except the stdcall part, i get that.Code:.386 .model flat,stdcall option casemap:none
Yay i'm so proud of myself. My first assembly program. I'm sure i've seen nothing yet. But hey, i'm still learning
All it does is get's the users input, max 256 characters, and then outputs it.Code:.386 .model flat,stdcall option casemap:none include\masm32\include\windows.inc include\masm32\include\kernel32.inc includelib\masm32\lib\kernel32.lib bufferSize = 256 .data buffer BYTE bufferSize DUP(?),0 bytesread db ? byteswritten db ? inHandle HANDLE ? outHandle HANDLE ? .code main: invoke GetStdHandle,STD_INPUT_HANDLE mov [inHandle],eax invoke GetStdHandle,STD_OUTPUT_HANDLE mov [outHandle],eax push 0 push offset bytesread push bufferSize push offset buffer push inHandle call ReadConsole push 0 push offset byteswritten push bufferSize push offset buffer push outHandle call WriteConsole push 0 call ExitProcess end main
I can't seem to find anyway to hold the window open, it just closes right away. If anyone could point me in the right direction here that would be much appreciated.
I tryed not using that invoke method to calling functions. My program looks really ugly now D:
Hey. Where are you learning assembly from? Eitherway good job =D. Now i want to learn assembly too xD
What does that above part do? Well except the stdcall part, i get that.Code:.386 .model flat,stdcall option casemap:none
Honestly, I have no idea. I'm not learning from any site specificaly. I just google my problems.
Just run it from the commandline the way it was meant to
Call sleep, or run an infinite loop. I.e
@jmp_recursive1:
jmp jmp_recursive1
Run it through as if your a computer, you finish all the instructions up to call WriteConsole, what are you gonig to do now? Suddenly stop for some reason? No, you're going to continue to the instructions which cause you to exit.
O''yea and remember the callee doesn't always clean-up the stack, it depends what calling convention you use. I believe you're with that, Windows uses the stdcall calling convention, which does clean up the stack after the call. Make sure you're aware of the function you're using, and which calling convention it uses. Provided the stack address grows:
push SomeParamater
call ThisUsesTheCDeclConvention
sub esp, 4(provided the first parameter was a DWORD)
Last edited by radnomguywfq3; 12-11-2009 at 10:05 AM.
There are two types of tragedies in life. One is not getting what you want, the other is getting it.
If you wake up at a different time in a different place, could you wake up as a different person?
Void (12-11-2009)
Jeta, you too smart brah :/