flat assembler
Message board for the users of flat assembler.

flat assembler > Windows > console text editor

Author
Thread Post new topic Reply to topic
Ali.A



Joined: 08 Jan 2018
Posts: 139
is it possible to make console as a text editor?

_________________
Asm For Wise Humans
Post 18 Jul 2018, 03:07
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16149
Location: Hyperborea
DOS had the program EDLIN. So, yes, it is possible and it has been done.
Post 18 Jul 2018, 03:10
View user's profile Send private message Visit poster's website Reply with quote
Ali.A



Joined: 08 Jan 2018
Posts: 139
hmm, interesting.

but setconsolemode doesnt have an option to ignore ENTER (virtual key enter)

please tell me it doesnt require kernelmode lol, hopefully not.
Post 18 Jul 2018, 03:51
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16149
Location: Hyperborea
You can parse the keystrokes in any way you need to. You don't have to use any drivers. As the user presses the keys you can ignore them or process them as is required for your app.
Post 18 Jul 2018, 09:48
View user's profile Send private message Visit poster's website Reply with quote
Ali.A



Joined: 08 Jan 2018
Posts: 139
still not sure about ignoring key strokes, can you point me to...?
Post 18 Jul 2018, 09:57
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16149
Location: Hyperborea
In your app you receive the keystrokes and then decide what to do with them. If you want to ignore some keys then simply go back to waiting for the next keystroke.
Post 18 Jul 2018, 10:00
View user's profile Send private message Visit poster's website Reply with quote
Ali.A



Joined: 08 Jan 2018
Posts: 139
ok, another question might be off topic:

are INS(byte,word,dword) and OUTS(byte,word,dword) privilege instructions?
because my program crashed when i added them lol, and while being debugged couldnt even step-thru
Post 18 Jul 2018, 11:12
View user's profile Send private message Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1258
Location: In a West End town
For such project, i dοn't think you will need anything more than console functions.
Post 18 Jul 2018, 11:24
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 16149
Location: Hyperborea
Ali.A wrote:
ok, another question might be off topic:

are INS(byte,word,dword) and OUTS(byte,word,dword) privilege instructions?
because my program crashed when i added them lol, and while being debugged couldnt even step-thru
Yes they are privileged. This is how drivers communicate with the devices.

The OS can enable certain ports for user access. However Windows doesn't enable any ports.
Post 18 Jul 2018, 11:31
View user's profile Send private message Visit poster's website Reply with quote
Ali.A



Joined: 08 Jan 2018
Posts: 139
interesting, i thought windows would use such asm instructions.
they use syscall which is similar to interrupt services but a lil bit faster than INT
Post 18 Jul 2018, 12:25
View user's profile Send private message Reply with quote
ManOfSteel



Joined: 02 Feb 2005
Posts: 1147
Ali.A wrote:
interesting, i thought windows would use such asm instructions.

Of course it must be using in/out instructions for all its drivers (disk, keyboard, etc.) It's just that it doesn't allow any access to them from user-space processes to prevent user programs from causing interference with the system and wreacking havoc. Drivers are kernel-space processes. This is what privilege separation is all about. Modern operating systems implement this separation to prevent problems caused both by errors (software and user) as well as malicious behavior.
But like Picnic already said, console functions is all that you need here (and 99.99% of the time).
Post 18 Jul 2018, 17:29
View user's profile Send private message Reply with quote
Ali.A



Joined: 08 Jan 2018
Posts: 139
revolution wrote:
In your app you receive the keystrokes and then decide what to do with them. If you want to ignore some keys then simply go back to waiting for the next keystroke.

thanks buddy, keyboard input

i think i can also parse keystrokes, ill look for more functions and uses.

_________________
Asm For Wise Humans
Post 20 Jul 2018, 02:06
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2018, Tomasz Grysztar.

Powered by rwasa.