Tutorial 6
Moving the cursor to the next line

Overview
    This is a seemingly worthless but none the less important tutorial on moving the cursor to the next line.

The Source Code
    This code will move the cursor to the new line.

#define B_CALL(xxxx)    rst 28h \ .dw xxxx
#define B_JUMP(xxxx)   call 50h \ .dw xxxx

_homeup                       =4558h
_newline                        =452Eh
_clrlcdfull                       =4540h
           
            .org 9D95h
           
            B_CALL(_clrlcdfull)
            B_CALL(_homeup)                     ;Call up the home screen
            B_CALL(_newline)                      ;Move cursor to next line
                                                       ;Return home

.end
END

Explanation
    The screen should look like this after you run the program:
 

 

 

As you can see, there is an empty line on the top of the screen followed by a "Done" message and the blinking cursor on the next line. If it weren't for the "Done" message, the cursor would have been on the preceding line. The point is, the cursor isn't on the "First line". But rather on the next "empty" one.

 

New Commands
   
_newline - sets the cursor on the next "empty" line.

Related Commands
   
Did you know there is actually a ROM call that displays the "Done" message on the screen? Well that call is _DispDone (_DispDone = 45B5h). Try it out.

 

Tutorial 7

    Click to return to the site's menu... or here to get back to the tutorial's menu.