Take the printout of the assembler-listing of Chapter 2 to continue with the examination of the NPLv111.bin-file :
Things are beginning to get interesting for us at adress 820122h. This adress
contains the command SCALL 82h:1094.
That means, that the execution of the program continues at adress 821094h.
A subroutine starts there, which will initialize the LCD-Controller.
The subroutine ends with
the command SRET and returns to the main program at the adress after the previous SCALL-command.
At adress 82013Ah a MOV-command moves the value 007Eh to register 2. The next command moves the value 0082h
(segment-value !!) to register 3.
That means, R2 and R3 are containing together the adress of the first text-output string !
Every output string ends with the value 00h (compare text area 82007Eh to 8200E2h) !
Therefore we understand, that looking to adress 820158h we can see the value of the adress of the second output string...
What happens beneath ?
The PUSH-commands at adress 820142h and 820144h transfer the
values of R3 and R2 to the stack, a defined storage area for register-values.
At adress 820146h the value 001Eh is moved to R2 and afterwards pushed on the stack. This value defines the line on the LCD-screen
where the output string will be positioned !
At adress 82014Ch another value is moved to R2. It defines the column where the output string will be positioned - pixelwise !
After all at adress 82014Eh SCALL
82h:1EE0h calls another subroutine which sends the output string to the LCD-screen !
The next lines are printed all by the same pattern.
1. Try to modify slightly the line-values (1Eh =30dez; 28h =40dez; B0h =50dez) for the output strings with the Hexeditor in the file NPLv111.bin.
Rename the modified file to Test2.bin and download it to the DV3.
Watch the results ! What is the maximum value to reach the last line of the LCD- screen ?
2. Try to modify in the same way the column-values for the output strings.
Caution: As we can see in the assembler-listing, the MOV-command to define the value of a column is structured as
C9 23 -> MOV R2, 03h -> C9 = MOV; 2 = R2; 3 = 03h
Which problem are we facing therefore, if we want to redefine a column ?
3. Use the disassembler to verify the modifications you have done with the Hexeditor. Indeed you should always check the modified BIN-file with the disassembler before downloading it to the DV3 to avoid
unpleasant effects !