Scrolling the screen - ASM

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
matio
Posts: 9
Joined: Mon Aug 17, 2009 1:37 am

Scrolling the screen - ASM

Post 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)?
ru2aqare
Member
Member
Posts: 342
Joined: Fri Jul 11, 2008 5:15 am
Location: Hungary

Re: Scrolling the screen - ASM

Post 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.
User avatar
quanganht
Member
Member
Posts: 301
Joined: Fri May 16, 2008 7:13 pm
Location: Hanoi, Vietnam

Re: Scrolling the screen - ASM

Post by quanganht »

Simple: copy the (n+1)th to the nth line, clear the last line.
"Programmers are tools for converting caffeine into code."
matio
Posts: 9
Joined: Mon Aug 17, 2009 1:37 am

Re: Scrolling the screen - ASM

Post by matio »

@ru2aqare
thanks!

@quanganht
erm, sorry not sure what you mean :)
User avatar
Creature
Member
Member
Posts: 548
Joined: Sat Dec 27, 2008 2:34 pm
Location: Belgium

Re: Scrolling the screen - ASM

Post 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.
When the chance of succeeding is 99%, there is still a 50% chance of that success happening.
matio
Posts: 9
Joined: Mon Aug 17, 2009 1:37 am

Re: Scrolling the screen - ASM

Post by matio »

Thanks everyone. Seen as I'm doing this in asm I will probaly have to use a file.
User avatar
Dex
Member
Member
Posts: 1444
Joined: Fri Jan 27, 2006 12:00 am
Contact:

Re: Scrolling the screen - ASM

Post 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
User avatar
quanganht
Member
Member
Posts: 301
Joined: Fri May 16, 2008 7:13 pm
Location: Hanoi, Vietnam

Re: Scrolling the screen - ASM

Post by quanganht »

matio wrote: @quanganht
erm, sorry not sure what you mean :)
Oops. I thought u only asked about scrolling. :oops:
"Programmers are tools for converting caffeine into code."
Post Reply