Page 1 of 1

Scrolling the screen - ASM

Posted: Sat Nov 28, 2009 6:27 am
by matio
When you scroll the screen up it moves each line up, but this means the that data is lost. Is there a way for it to keep everything that has been on the screen (buffer)?

Re: Scrolling the screen - ASM

Posted: Sat Nov 28, 2009 6:31 am
by ru2aqare
matio wrote:When you scroll the screen up it moves each line up, but this means the that data is lost. Is there a way for it to keep everything that has been on the screen (buffer)?
The answer is exactly that - a buffer that contains the lines you've scrolled out of the screen. Of course to keep everything you would need infinity amounts of memory, so you can keep things "on screen" only until you run out of memory.

Re: Scrolling the screen - ASM

Posted: Sat Nov 28, 2009 8:03 am
by quanganht
Simple: copy the (n+1)th to the nth line, clear the last line.

Re: Scrolling the screen - ASM

Posted: Sat Nov 28, 2009 8:48 am
by matio
@ru2aqare
thanks!

@quanganht
erm, sorry not sure what you mean :)

Re: Scrolling the screen - ASM

Posted: Sat Nov 28, 2009 8:55 am
by Creature
matio wrote:@ru2aqare
thanks!

@quanganht
erm, sorry not sure what you mean :)
quanganht just gave you a way to scroll to the screen, but did not answer your question. The answer is indeed what ru2aqare said. I guess the best way would be to either dynamically allocate a buffer (you could even allow the user to specify how many lines of history must be remembered) or you could just use a static buffer (of however many lines you wish to remember), but this might increase executable size considerably.

Re: Scrolling the screen - ASM

Posted: Sat Nov 28, 2009 9:50 am
by matio
Thanks everyone. Seen as I'm doing this in asm I will probaly have to use a file.

Re: Scrolling the screen - ASM

Posted: Sat Nov 28, 2009 11:42 am
by Dex
Yes, you need to treat it as a file (eg: with 10, 13, at end of each string ), you should take a look at asm editors like Tex4u, fasms dos editor or small dos one's like these http://texteditors.org/cgi-bin/wiki.pl?TinyEditors
Teds a good small one : http://texteditors.org/cgi-bin/wiki.pl?TEDNASM

Re: Scrolling the screen - ASM

Posted: Sun Nov 29, 2009 1:15 am
by quanganht
matio wrote: @quanganht
erm, sorry not sure what you mean :)
Oops. I thought u only asked about scrolling. :oops: