Is there a way to clear the screen in a terminal window with nasm? By clear the screen, I mean emulate the Ctrl-L
hotkey. Remove all text from the window.
Is this possible to do in nasm assembly?
Thanks in advance,
Rileyh
Is there a way to clear the screen in a terminal window with nasm? By clear the screen, I mean emulate the Ctrl-L
hotkey. Remove all text from the window.
Is this possible to do in nasm assembly?
Thanks in advance,
Rileyh
In Bash:
In C:
How do I find the string:
Have a look at this NASM program:
http://www.muppetlabs.com/~breadbox/software/tiny/snake.asm.txt
There's an interesting part showing how to write escape sequences to the stdout:
The code doesn't probably do exactly what you want to, but it'd be easy to modify it to output
\033[H\033[2J
. Also have a look here:http://ascii-table.com/ansi-escape-sequences-vt-100.php
Plus, if you want your code to be portable, think of using some library that's compatible among different terminals, like ncurses.
(EDIT: That was for Linux. If you're on Windows, I'd try this.)