flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Kronos 24 Jul 2015, 15:34
when i click run a in fasm it opens the command console and closes at the same time.why command console closes very fast and how to solve this?
|
|||
![]() |
|
typedef 24 Jul 2015, 22:19
Open your application from CMD or import system/getchar from msvcrt100.dll or whatever version you find in your System32 folder and then cinvoke-call system("pause") or getchar()
|
|||
![]() |
|
Kronos 26 Jul 2015, 10:13
How to run assembly code in console version?
And a other thing i tried to run console code in gui ide version thats when the console opened and closed. thanks for the answer in advance |
|||
![]() |
|
shutdownall 26 Jul 2015, 11:34
This depends if you develop windows code or "dos" code. The IDE just starts the program and the OS decides how to do that. If it is a WIN application there will be opened a window (if you programmed this) or at least handle it as a window application. In the other way it starts this as a cmd application which is closed automatically when the application is finished.
If you try to develop this type of code it might be useful to just compile the code in the IDE (CTRL-F9 vs. F9) and open a cmd window with the same directory and start your new compiled application manually. This way the cmd window is not closed when the program finishes and you could read what your program did write on the screen. ![]() |
|||
![]() |
|
El Tangas 27 Jul 2015, 12:07
Command line programs normally just do their job and exit, like DOS and Linux commands, so if they are fast you will only see a command window quickly flash and disappear.
To keep the output, you have to run them from a command console, on windows you can use cmd or powershell. |
|||
![]() |
|
Kronos 27 Jul 2015, 17:26
Thanks guyz
|
|||
![]() |
|
PeExecutable 27 Jul 2015, 21:33
As it has always been for as long as I can remember:
cmd /k (carries out the command but command line window remains open) cmd /c (carries out the command but terminates window, unless the executing program pauses something) An easy way to avoid that is to use the Sleep command in your program, to let it sleep for a few seconds. You have to remember that when you execute a program from explorer, the command line window is spawned by explorer, and explorer decides exit state from it, which is set to terminate by default. If you launch a program from an already open cmd window, there is no exit state because the command line window is already opened with a non-terminate state. If you create a fasm program you can create a new process that launches a shell command, and in that you can specify many things for the command line window, including exit states (exit or remain). Understanding your operating system is everything. (Study the attached files, it's nasm but you'll understand it)
|
|||||||||||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.