So I opened a text file to 1000h:200h, and i have one question.
Does anyone have asm code for reading lines, inserting and deleting text, dumping the file to screen, etc? I know it's alot to ask, but I want to get a head start in this major area of development ::)
fopen issues
Re:fopen issues
All of these are 100% dependent on your OS architecture....St8ic wrote:
Does anyone have asm code for reading lines, inserting and deleting text, dumping the file to screen, etc?
Every good solution is obvious once you've found it.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:fopen issues
this is mostly a matter of *application* than a matter of kernel programming.
When you said "opened at 1000:200 (or whatever), i assume you mean the whole file content has been dumped to that memory location, right ?"
print $line
When committing the file (e.g. at 'SAVE' command from user), sweep the lines list and write back each line to the file ...
This is a Quick&Dirty approach and will probably suffer problems with larger files, longer sessions, etc. but it should suffice for application-level QeDitor
When you said "opened at 1000:200 (or whatever), i assume you mean the whole file content has been dumped to that memory location, right ?"
foreach $line (in @all_lines[$start ... $start+$SCREEN_HEIGHT])how do i dump it on screen
print $line
scan your initial content for 'end of line' characters and create a list of lines (holding a pointer to the line data and a pointer to the next 'line' structure). Deleting a line will mean removing a 'line' structure from the list, inserting a line means inserting a new 'line' structure pointing to newly allocated memory with new data.how do i insert/delete lines
When committing the file (e.g. at 'SAVE' command from user), sweep the lines list and write back each line to the file ...
This is a Quick&Dirty approach and will probably suffer problems with larger files, longer sessions, etc. but it should suffice for application-level QeDitor