annotate code_part1/OSTC_code_asm_part1/displaytext.asm @ 840:b29cf452f91d

minor
author heinrichsweikamp
date Wed, 18 Oct 2023 19:54:09 +0200
parents 2750099bf5bb
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
815
2a0e5d884fc3 BUGFIX: Fix licence in German
heinrichsweikamp
parents: 807
diff changeset
1 ; OSTC Mk.2, 2N and 2C - diving computer code
807
c50296c3059e BUGFIX: Divetime had unwanted "." behind the minutes
heinrichsweikamp
parents: 174
diff changeset
2 ; Copyright (C) 2015 HeinrichsWeikamp GbR
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
4 ; This program is free software: you can redistribute it and/or modify
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
5 ; it under the terms of the GNU General Public License as published by
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
6 ; the Free Software Foundation, either version 3 of the License, or
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
7 ; (at your option) any later version.
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
8
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
9 ; This program is distributed in the hope that it will be useful,
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
10 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
11 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
12 ; GNU General Public License for more details.
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
13
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
14 ; You should have received a copy of the GNU General Public License
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
15 ; along with this program. If not, see <http://www.gnu.org/licenses/>.
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
16
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
17
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
18 ; Displays from text_table_vx.asm
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
19 ; written by: Matthias Heinrichs, info@heinrichsweikamp.com
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
20 ; written: 10/30/05
51
ceeeb5e49348 1.70....
heinrichsweikamp
parents: 0
diff changeset
21 ; last updated: 100730
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
22 ; known bugs:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
23 ; ToDo:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
24
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
25
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
26 ; These macros output to POSTINC only
174
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
27 OUTPUTTEXT macro n ; For Texts 1-255
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
28 If n>.255
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
29 Error "Bad low text number", n
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
30 Endif
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
31 movlw n
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
32 call displaytext0_low
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
33 endm
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
34
174
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
35 OUTPUTTEXTH macro n ; For Texts 256-511
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
36 If n<.256
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
37 Error "Bad low text number", n
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
38 Endif
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
39 movlw n-.256 ; Use only Lower 8 Bit
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
40 call displaytext0_high
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
41 endm
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
42
174
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
43 displaytext0_high:
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
44 bsf displaytext_high ; Highbit set
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
45 bra displaytext0
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
46
174
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
47 displaytext0_low:
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
48 bcf displaytext_high ; Highbit clear
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
49 displaytext0:
174
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
50 bsf output_to_postinc_only
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
51 bra displaytext
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
52
174
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
53 ; These macros output to letter[], and call the wordprocessor
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
54 DISPLAYTEXT macro n
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
55 movlw n
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
56 call displaytext_1_low
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
57 endm
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
58
174
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
59 DISPLAYTEXTH macro n
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
60 movlw LOW n ; Use only Lower 8 Bit
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
61 call displaytext_1_high
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
62 endm
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
63
174
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
64 displaytext_1_high:
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
65 bsf displaytext_high ; Highbit set
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
66 bra displaytext
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
67
174
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
68 displaytext_1_low:
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
69 bcf displaytext_high
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
70
174
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
71 displaytext:
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
72 movwf textnumber
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
73 movlw LOW(text_pointer-4)
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
74 movwf TBLPTRL
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
75 movlw HIGH(text_pointer-4)
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
76 movwf TBLPTRH
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
77 movlw UPPER(text_pointer-4)
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
78 movwf TBLPTRU
51
ceeeb5e49348 1.70....
heinrichsweikamp
parents: 0
diff changeset
79
838
2750099bf5bb 3.15 release
heinrichsweikamp
parents: 815
diff changeset
80 clrf letter_counter ; reset the letter counter
174
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
81 movlw 4 ; textnumber * 4 --> PROD
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
82 mulwf textnumber
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
83
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
84 btfsc displaytext_high ; If high text, add 4*256 to PROD
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
85 addwf PRODH
51
ceeeb5e49348 1.70....
heinrichsweikamp
parents: 0
diff changeset
86
174
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
87 movf PRODL,W ; Add PROD to TBLPTR
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
88 addwf TBLPTRL,F
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
89 movf PRODH,W
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
90 addwfc TBLPTRH,F
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
91 movlw 0
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
92 addwfc TBLPTRU
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
93
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
94 TBLRD*+
174
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
95 movff TABLAT,textaddress+0 ; textaddress:2 holds address for first character
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
96 TBLRD*+
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
97 movff TABLAT,textaddress+1
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
98
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
99 btfsc output_to_postinc_only ; output to postinc only?
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
100 bra displaytext2
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
101
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
102 TBLRD*+
51
ceeeb5e49348 1.70....
heinrichsweikamp
parents: 0
diff changeset
103 movff TABLAT,win_leftx2 ; No, write coordinates
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
104
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
105 TBLRD*+
174
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
106 movff TABLAT,win_top ; No, write coordinates
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
107
174
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
108 displaytext2:
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
109 clrf WREG ; Reset to small font
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
110 movff WREG,win_font ; (BANK 0)
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
111
174
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
112 movff textaddress+0,TBLPTRL
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
113 movff textaddress+1,TBLPTRH
51
ceeeb5e49348 1.70....
heinrichsweikamp
parents: 0
diff changeset
114 btfss output_to_postinc_only ; output to postinc2 only?
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
115 lfsr FSR2,letter ; no!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
116
174
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
117 displaytext3:
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
118 TBLRD*+
174
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
119 movf TABLAT,W
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
120 bz display_text_exit ; Text finished?
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
121 movwf POSTINC2
838
2750099bf5bb 3.15 release
heinrichsweikamp
parents: 815
diff changeset
122 incf letter_counter,F ; ++1
174
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
123 bra displaytext3
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
124
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
125 display_text_exit:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
126 btfss output_to_postinc_only ; output to postinc only?
815
2a0e5d884fc3 BUGFIX: Fix licence in German
heinrichsweikamp
parents: 807
diff changeset
127 bra display_text_exit2
174
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
128
53b16a746166 Multi-lang
JeanDo
parents: 172
diff changeset
129 bcf output_to_postinc_only
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
130 return
815
2a0e5d884fc3 BUGFIX: Fix licence in German
heinrichsweikamp
parents: 807
diff changeset
131
2a0e5d884fc3 BUGFIX: Fix licence in German
heinrichsweikamp
parents: 807
diff changeset
132 display_text_exit2:
2a0e5d884fc3 BUGFIX: Fix licence in German
heinrichsweikamp
parents: 807
diff changeset
133 clrf WREG
2a0e5d884fc3 BUGFIX: Fix licence in German
heinrichsweikamp
parents: 807
diff changeset
134 movff WREG,letter+.22
2a0e5d884fc3 BUGFIX: Fix licence in German
heinrichsweikamp
parents: 807
diff changeset
135 goto word_processor