Sign in to follow this  
Photonman

asm

Recommended Posts

Photonman    174
Can anyone point me to a good assembly tutorial (x86)? I want to learn it just for the hell of it. asm always kinda fascinated me. btw...and this is off my own topic, but is there any way to make a clear screen function in C++ without a system call, conio, windows, or printing a bunch of newlines?

Share this post


Link to post
Share on other sites
Evil Steve    2017
Quote:
Original post by Photonman
btw...and this is off my own topic, but is there any way to make a clear screen function in C++ without a system call, conio, windows, or printing a bunch of newlines?

No idea about the asm tutorials, sorry. But no, there's no portable way to clear the screen. The reason being that stdout doesn't have to be a screen. You could be outputting to a printer or some other device, and clearing the screen wouldn't make sense. Your best bet would be either using system("cls"); or a Win32 command (If you're using Windows).

Share this post


Link to post
Share on other sites
virtuacasper    144
i hope this helps...

[source = "c++"]

void clrscr()
{
HANDLE hStdOut;
COORD coord;
ULONG area;

hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);

coord = GetLargestConsoleWindowSize(hStdOut);

area = coord.X * coord.Y;

coord.X = 0;
coord.Y = 0;

FillConsoleOutputCharacter(hStdOut,' ',area,coord,&area);
}

Share this post


Link to post
Share on other sites
Photonman    174
Thanks all, the links were helpful.

I didn't think there was a simple way to do it without windows or a system call, etc., although I thought maybe there would be some way to do it with \b and spaces, although the only problem there is knowing how many characters have been printed.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this