flat assembler
Message board for the users of flat assembler.
Index
> Windows > Procedures (Sleep, Print, ClearScreen, Pause) |
Author |
|
metalfishx 24 Oct 2004, 02:19
Hey Joey.
Well, i have implemented some of the funcitons that you want and wraped the functions with macros for more easy to use functions. Theres you will find some bugs, but the example is fully working. The functions thats works are in the example and looks like this: Code: ;******************************************************************** ; CONSOLE UTILS ; GNU GENERAL PUBLIC LICENCED, BY ZONA SERVICES. ; HTTP://WWW.ZONAUY.COM - FLORIDA URUGUAY ;******************************************************************** ; ----------------------------------------------------------- ; PARAMS ; ----------------------------------------------------------- format PE GUI 4.0 entry MAIN include 'conutils.inc' ; ----------------------------------------------------------- ; CODE START ; ----------------------------------------------------------- section '.code' code readable executable ; ----------------------------------------------------------- ; MAIN PROC ; ----------------------------------------------------------- proc MAIN OpenConsole ;Open the console window Print IntroMessage Input strTestInput ;Read an string SetColor 3 Locate 10,10 Print [strTestInput] ;Print the readed string SetColor 6 Locate 20,20 Print [strTestInput] Sleep 2000 ;Wait 3 seconds CloseConsole ;Close The Console Halt endp Thanks to the macros, you can use a basic like syntax. Im working with this because im trying to make a BASIC Style language, but fully created with macros. You need to study the conutils.inc wheres i have the macros and the functions. Theres some funcitons thats actually are'nt wrapped and the some macros thats are not working. I hope this can help you. Cheers.
_________________ --------------------------------------- Roberto A. Berrospe Machin Ruta Internet, Florida Uruguay --------------------------------------- |
|||||||||||
24 Oct 2004, 02:19 |
|
roticv 24 Oct 2004, 04:25
Hi,
Code:
format PE CONSOLE 4.0
|
|||
24 Oct 2004, 04:25 |
|
metalfishx 24 Oct 2004, 07:02
Hi roticv. It's ok, im ussing PE GUI to have full control on the open console and close console. With this, you can for example have the app running on memory and show the console when you like, or dont show the console.
This is an example on how to do that: Code: ;******************************************************************** ; CONSOLE UTILS ; GNU GENERAL PUBLIC LICENCED, BY ZONA SERVICES. ; HTTP://WWW.ZONAUY.COM - FLORIDA URUGUAY ;******************************************************************** ; ----------------------------------------------------------- ; PARAMS ; ----------------------------------------------------------- format PE GUI 4.0 entry MAIN include 'conutils.inc' ; ----------------------------------------------------------- ; VARIABLES ; ----------------------------------------------------------- section '.data' data readable writable LPSTR strTestInput STRING IntroMessage,'Write your name: ' STRING HelloMessage,'Hello ' STRING MsgBoxTitle,'Message:' STRING ConsoleOpenMessage,'Now Console Opened...' STRING ConsoleClosedMessage,'Now Console Closed!' STRING ConsoleOpenedAgainMessage,'Now Console Opened Again...' STRING ConsoleClosedExitMessage,<'Now Console Closed Again!',13,10,"And Now I'll Exit "> ; ----------------------------------------------------------- ; CODE START ; ----------------------------------------------------------- section '.code' code readable executable ; ----------------------------------------------------------- ; MAIN PROC ; ----------------------------------------------------------- proc MAIN OpenConsole ;Open the console window Print ConsoleOpenMessage ;Print in the console Input strTestInput ;Wait for press enter CloseConsole ;Close the console MsgBox ConsoleClosedMessage ;Show the message box OpenConsole ;Reopen a new console SetColor 3 ;Change the print color Print ConsoleOpenedAgainMessage ;Print to the console Input strTestInput ;Wait for enter.. CloseConsole ;Close The Console MsgBox ConsoleClosedExitMessage ;Show exit message Halt endp Even, i have aded some extra macros to console.inc, and modified the kind of how the variables works. You can see now two asm. Console.asm and Console2.asm; this example code is in the Console2.asm. Try to compile it. Cheers.
_________________ --------------------------------------- Roberto A. Berrospe Machin Ruta Internet, Florida Uruguay --------------------------------------- |
|||||||||||
24 Oct 2004, 07:02 |
|
metalfishx 26 Oct 2004, 00:47
Hey! heres the new version that have all you want.
With this inc you can use: Sleep, WaitKey (instead Pause), Locate, Print, Input, Inkey, SetColor, OpenConsole, CloseConsole, ConsoleTitle, MsgBox, And Halt. You can see how to use these functions in the examples, and you can study the inc code to know how i do all that Code: ;******************************************************************** ; CONSOLE UTILS EXAMPLE4 ; GNU GENERAL PUBLIC LICENCED, BY ZONA SERVICES. ; HTTP://WWW.ZONAUY.COM - FLORIDA URUGUAY ;******************************************************************** ; ----------------------------------------------------------- ; PARAMS ; ----------------------------------------------------------- format PE GUI 4.0 entry MAIN include 'conutils.inc' ; ----------------------------------------------------------- ; VARIABLES ; ----------------------------------------------------------- section '.data' data readable writable LPSTR strTestInput STRING conTitle,".::[ Console Utils Example 4 ]::." STRING msgWhat,"Write something:" STRING msgWrote,"You Write:" STRING message,"Press any key to continue..." STRING message2,"Press any key to exit.." ; ----------------------------------------------------------- ; CODE START ; ----------------------------------------------------------- section '.code' code readable executable ; ----------------------------------------------------------- ; MAIN PROC ; ----------------------------------------------------------- proc MAIN OpenConsole ;Open the console window ConsoleTitle conTitle SetColor 6 Locate 23,2 Print conTitle Sleep 2000 Locate 26,7 SetColor 2 Print message ;Print Press any key to continue... WaitKey Cls Locate 18,10 Print msgWhat Locate 35,10 Input strTestInput Cls SetColor 4 Print msgWrote Locate 10,0 Print [strTestInput] ;In this case, the string is a pointer to string Locate 26,12 Print message ;Print Press any key to continue... WaitKey Cls SetColor 0 Print message2 WaitKey CloseConsole ;Close The Console Halt endp Enjoy!
_________________ --------------------------------------- Roberto A. Berrospe Machin Ruta Internet, Florida Uruguay --------------------------------------- |
|||||||||||
26 Oct 2004, 00:47 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.