Basic program operations [PICProgramm.cs]
This commit is contained in:
@@ -1,35 +1,35 @@
|
||||
00001 ;TPicSim1
|
||||
00002 ;Programm zum Test des 16F84-Simulators.
|
||||
00003 ;Es werden alle Literal-Befehle gepr<70>ft
|
||||
00004 ;(c) St. Lehmann
|
||||
00005 ;Ersterstellung: 23.03.2016
|
||||
00006 ;
|
||||
00007 list c=132 ;Zeilenl<6E>nge im LST auf 132 Zeichen setzen
|
||||
00008
|
||||
00009 ;Definition einiger Symbole
|
||||
00010 ;zuerst Hardware-Register
|
||||
00011 status equ 03h
|
||||
00012 ra equ 05h
|
||||
00013 rb equ 06h
|
||||
00014
|
||||
00015 ;f<>r den Benutzer frei verwendbare Register
|
||||
00016 count equ 0ch
|
||||
00017
|
||||
00018 ;Definition des Prozessors
|
||||
00019 device 16F84
|
||||
00020
|
||||
00021 ;Festlegen des Codebeginns
|
||||
00022 org 0
|
||||
00023 start
|
||||
0000 3011 00024 movlw 11h ;in W steht nun 11h, Statusreg. unver<65>ndert
|
||||
0001 3930 00025 andlw 30h ;W = 10h, C=x, DC=x, Z=0
|
||||
0002 380D 00026 iorlw 0Dh ;W = 1Dh, C=x, DC=x, Z=0
|
||||
0003 3C3D 00027 sublw 3Dh ;W = 20h, C=1, DC=1, Z=0
|
||||
0004 3A20 00028 xorlw 20h ;W = 00h, C=1, DC=1, Z=1
|
||||
0005 3E25 00029 addlw 25h ;W = 25h, C=0, DC=0, Z=0
|
||||
00030
|
||||
00031
|
||||
00032 ende
|
||||
0006 2806 00033 goto ende ;Endlosschleife, verhindert Nirwana
|
||||
00034
|
||||
00035
|
||||
00001 ;TPicSim1
|
||||
00002 ;Programm zum Test des 16F84-Simulators.
|
||||
00003 ;Es werden alle Literal-Befehle gepr<70>ft
|
||||
00004 ;(c) St. Lehmann
|
||||
00005 ;Ersterstellung: 23.03.2016
|
||||
00006 ;
|
||||
00007 list c=132 ;Zeilenl<6E>nge im LST auf 132 Zeichen setzen
|
||||
00008
|
||||
00009 ;Definition einiger Symbole
|
||||
00010 ;zuerst Hardware-Register
|
||||
00011 status equ 03h
|
||||
00012 ra equ 05h
|
||||
00013 rb equ 06h
|
||||
00014
|
||||
00015 ;f<>r den Benutzer frei verwendbare Register
|
||||
00016 count equ 0ch
|
||||
00017
|
||||
00018 ;Definition des Prozessors
|
||||
00019 device 16F84
|
||||
00020
|
||||
00021 ;Festlegen des Codebeginns
|
||||
00022 org 0
|
||||
00023 start
|
||||
0000 3011 00024 movlw 11h ;in W steht nun 11h, Statusreg. unver<65>ndert
|
||||
0001 3930 00025 andlw 30h ;W = 10h, C=x, DC=x, Z=0
|
||||
0002 380D 00026 iorlw 0Dh ;W = 1Dh, C=x, DC=x, Z=0
|
||||
0003 3C3D 00027 sublw 3Dh ;W = 20h, C=1, DC=1, Z=0
|
||||
0004 3A20 00028 xorlw 20h ;W = 00h, C=1, DC=1, Z=1
|
||||
0005 3E25 00029 addlw 25h ;W = 25h, C=0, DC=0, Z=0
|
||||
00030
|
||||
00031
|
||||
00032 ende
|
||||
0006 2806 00033 goto ende ;Endlosschleife, verhindert Nirwana
|
||||
00034
|
||||
00035
|
||||
|
@@ -1,33 +1,33 @@
|
||||
;TPicSim1
|
||||
;Programm zum Test des 16F84-Simulators.
|
||||
;Es werden alle Literal-Befehle gepr?ft
|
||||
;(c) St. Lehmann
|
||||
;Ersterstellung: 23.03.2016
|
||||
;
|
||||
|
||||
;Definition einiger Symbole
|
||||
;zuerst Hardware-Register
|
||||
status equ 03h
|
||||
ra equ 05h
|
||||
rb equ 06h
|
||||
|
||||
;f?r den Benutzer frei verwendbare Register
|
||||
count equ 0ch
|
||||
|
||||
;Definition des Prozessors
|
||||
device 16F84
|
||||
|
||||
;Festlegen des Codebeginns
|
||||
org 0
|
||||
start
|
||||
movlw 11h ;in W steht nun 11h, Statusreg. unver?ndert
|
||||
andlw 30h ;W = 10h, C=x, DC=x, Z=0
|
||||
iorlw 0Dh ;W = 1Dh, C=x, DC=x, Z=0
|
||||
sublw 3Dh ;W = 20h, C=1, DC=1, Z=0
|
||||
xorlw 20h ;W = 00h, C=1, DC=1, Z=1
|
||||
addlw 25h ;W = 25h, C=0, DC=0, Z=0
|
||||
|
||||
|
||||
ende
|
||||
goto ende ;Endlosschleife, verhindert Nirwana
|
||||
|
||||
;TPicSim1
|
||||
;Programm zum Test des 16F84-Simulators.
|
||||
;Es werden alle Literal-Befehle gepr?ft
|
||||
;(c) St. Lehmann
|
||||
;Ersterstellung: 23.03.2016
|
||||
;
|
||||
|
||||
;Definition einiger Symbole
|
||||
;zuerst Hardware-Register
|
||||
status equ 03h
|
||||
ra equ 05h
|
||||
rb equ 06h
|
||||
|
||||
;f?r den Benutzer frei verwendbare Register
|
||||
count equ 0ch
|
||||
|
||||
;Definition des Prozessors
|
||||
device 16F84
|
||||
|
||||
;Festlegen des Codebeginns
|
||||
org 0
|
||||
start
|
||||
movlw 11h ;in W steht nun 11h, Statusreg. unver?ndert
|
||||
andlw 30h ;W = 10h, C=x, DC=x, Z=0
|
||||
iorlw 0Dh ;W = 1Dh, C=x, DC=x, Z=0
|
||||
sublw 3Dh ;W = 20h, C=1, DC=1, Z=0
|
||||
xorlw 20h ;W = 00h, C=1, DC=1, Z=1
|
||||
addlw 25h ;W = 25h, C=0, DC=0, Z=0
|
||||
|
||||
|
||||
ende
|
||||
goto ende ;Endlosschleife, verhindert Nirwana
|
||||
|
||||
|
@@ -1,314 +1,314 @@
|
||||
00001 ;TPicSim10
|
||||
00002 ;Programm zum Test des 16F84-Simulators.
|
||||
00003 ;Es wird die richtige Funktionsweise von PCL und PCLATH am Beispiel
|
||||
00004 ;eines Tabellenzugriffs getestet
|
||||
00005 ;(c) St. Lehmann
|
||||
00006 ;19.04.2014
|
||||
00007
|
||||
00008 list c=132 ;Zeilenl<6E>nge im LST auf 132 Zeichen setzen
|
||||
00009
|
||||
00010 ;Definition einiger Symbole
|
||||
00011 indirect equ 0
|
||||
00012 pcl equ 02h
|
||||
00013 status equ 03h
|
||||
00014 fsr equ 04h
|
||||
00015 ra equ 05h
|
||||
00016 rb equ 06h
|
||||
00017 pclath equ 0ah
|
||||
00018 intcon equ 0bh
|
||||
00019
|
||||
00020 ;Definition des Prozessors
|
||||
00021 device 16F84
|
||||
00022 ;Festlegen des Codebeginns
|
||||
00023 org 0
|
||||
00024 start
|
||||
0000 3000 00025 movlw 0 ;Index f<>r Tabellenzugriff in 0FH
|
||||
0001 008F 00026 movwf 0fh
|
||||
0002 3005 00027 movlw 5 ;insgesamt 5 Tabellenzugriffe
|
||||
0003 008E 00028 movwf 0eh
|
||||
0004 3010 00029 movlw 10h ;Ergebnis wird ab 10H abgespeichert
|
||||
0005 0084 00030 movwf fsr
|
||||
00031 loop
|
||||
0006 3001 00032 movlw 1 ;PCLATH setzen, damit auf den Bereich 256-511 zugegriffen werden kann
|
||||
0007 008A 00033 movwf pclath
|
||||
0008 080F 00034 movf 0fh,w
|
||||
0009 2109 00035 call tabelle
|
||||
000A 0080 00036 movwf indirect
|
||||
000B 0A84 00037 incf fsr
|
||||
000C 0A8F 00038 incf 0fh
|
||||
000D 0B8E 00039 decfsz 0eh
|
||||
000E 2806 00040 goto loop
|
||||
000F 018A 00041 clrf pclath
|
||||
0010 080F 00042 movf 0fh,w
|
||||
0011 2109 00043 call tabelle ;Fehler, der ADDWF PCL kommt nicht in die Tabelle. Grund: in W steht 5
|
||||
00044 ;im PC 109 bzw. nach dem Fetch 10A. Zu diesem Wert wird 5 addiert und
|
||||
00045 ;die oberen Bits auf 0 gesetzt (PCLATH=0). Damit steht im PC der Wert
|
||||
00046 ;0Fh. Dorthin springt der PIC durch den ADDWF-Befehl. Hier verweilt
|
||||
00047 ;das Programm w<>hrend der Stack immer weiter w<>chst.
|
||||
00048
|
||||
00049
|
||||
00050 ende
|
||||
0012 2812 00051 goto ende ;Endlosschleife, verhindert Nirwana
|
||||
00052
|
||||
0013 0000 00053 nop
|
||||
0014 0000 00054 nop
|
||||
0015 0000 00055 nop
|
||||
0016 0000 00056 nop
|
||||
0017 0000 00057 nop
|
||||
0018 0000 00058 nop
|
||||
0019 0000 00059 nop
|
||||
001A 0000 00060 nop
|
||||
001B 0000 00061 nop
|
||||
001C 0000 00062 nop
|
||||
001D 0000 00063 nop
|
||||
001E 0000 00064 nop
|
||||
001F 0000 00065 nop
|
||||
0020 0000 00066 nop
|
||||
0021 0000 00067 nop
|
||||
0022 0000 00068 nop
|
||||
0023 0000 00069 nop
|
||||
0024 0000 00070 nop
|
||||
0025 0000 00071 nop
|
||||
0026 0000 00072 nop
|
||||
0027 0000 00073 nop
|
||||
0028 0000 00074 nop
|
||||
0029 0000 00075 nop
|
||||
002A 0000 00076 nop
|
||||
002B 0000 00077 nop
|
||||
002C 0000 00078 nop
|
||||
002D 0000 00079 nop
|
||||
002E 0000 00080 nop
|
||||
002F 0000 00081 nop
|
||||
0030 0000 00082 nop
|
||||
0031 0000 00083 nop
|
||||
0032 0000 00084 nop
|
||||
0033 0000 00085 nop
|
||||
0034 0000 00086 nop
|
||||
0035 0000 00087 nop
|
||||
0036 0000 00088 nop
|
||||
0037 0000 00089 nop
|
||||
0038 0000 00090 nop
|
||||
0039 0000 00091 nop
|
||||
003A 0000 00092 nop
|
||||
003B 0000 00093 nop
|
||||
003C 0000 00094 nop
|
||||
003D 0000 00095 nop
|
||||
003E 0000 00096 nop
|
||||
003F 0000 00097 nop
|
||||
0040 0000 00098 nop
|
||||
0041 0000 00099 nop
|
||||
0042 0000 00100 nop
|
||||
0043 0000 00101 nop
|
||||
0044 0000 00102 nop
|
||||
0045 0000 00103 nop
|
||||
0046 0000 00104 nop
|
||||
0047 0000 00105 nop
|
||||
0048 0000 00106 nop
|
||||
0049 0000 00107 nop
|
||||
004A 0000 00108 nop
|
||||
004B 0000 00109 nop
|
||||
004C 0000 00110 nop
|
||||
004D 0000 00111 nop
|
||||
004E 0000 00112 nop
|
||||
004F 0000 00113 nop
|
||||
0050 0000 00114 nop
|
||||
0051 0000 00115 nop
|
||||
0052 0000 00116 nop
|
||||
0053 0000 00117 nop
|
||||
0054 0000 00118 nop
|
||||
0055 0000 00119 nop
|
||||
0056 0000 00120 nop
|
||||
0057 0000 00121 nop
|
||||
0058 0000 00122 nop
|
||||
0059 0000 00123 nop
|
||||
005A 0000 00124 nop
|
||||
005B 0000 00125 nop
|
||||
005C 0000 00126 nop
|
||||
005D 0000 00127 nop
|
||||
005E 0000 00128 nop
|
||||
005F 0000 00129 nop
|
||||
0060 0000 00130 nop
|
||||
0061 0000 00131 nop
|
||||
0062 0000 00132 nop
|
||||
0063 0000 00133 nop
|
||||
0064 0000 00134 nop
|
||||
0065 0000 00135 nop
|
||||
0066 0000 00136 nop
|
||||
0067 0000 00137 nop
|
||||
0068 0000 00138 nop
|
||||
0069 0000 00139 nop
|
||||
006A 0000 00140 nop
|
||||
006B 0000 00141 nop
|
||||
006C 0000 00142 nop
|
||||
006D 0000 00143 nop
|
||||
006E 0000 00144 nop
|
||||
006F 0000 00145 nop
|
||||
0070 0000 00146 nop
|
||||
0071 0000 00147 nop
|
||||
0072 0000 00148 nop
|
||||
0073 0000 00149 nop
|
||||
0074 0000 00150 nop
|
||||
0075 0000 00151 nop
|
||||
0076 0000 00152 nop
|
||||
0077 0000 00153 nop
|
||||
0078 0000 00154 nop
|
||||
0079 0000 00155 nop
|
||||
007A 0000 00156 nop
|
||||
007B 0000 00157 nop
|
||||
007C 0000 00158 nop
|
||||
007D 0000 00159 nop
|
||||
007E 0000 00160 nop
|
||||
007F 0000 00161 nop
|
||||
0080 0000 00162 nop
|
||||
0081 0000 00163 nop
|
||||
0082 0000 00164 nop
|
||||
0083 0000 00165 nop
|
||||
0084 0000 00166 nop
|
||||
0085 0000 00167 nop
|
||||
0086 0000 00168 nop
|
||||
0087 0000 00169 nop
|
||||
0088 0000 00170 nop
|
||||
0089 0000 00171 nop
|
||||
008A 0000 00172 nop
|
||||
008B 0000 00173 nop
|
||||
008C 0000 00174 nop
|
||||
008D 0000 00175 nop
|
||||
008E 0000 00176 nop
|
||||
008F 0000 00177 nop
|
||||
0090 0000 00178 nop
|
||||
0091 0000 00179 nop
|
||||
0092 0000 00180 nop
|
||||
0093 0000 00181 nop
|
||||
0094 0000 00182 nop
|
||||
0095 0000 00183 nop
|
||||
0096 0000 00184 nop
|
||||
0097 0000 00185 nop
|
||||
0098 0000 00186 nop
|
||||
0099 0000 00187 nop
|
||||
009A 0000 00188 nop
|
||||
009B 0000 00189 nop
|
||||
009C 0000 00190 nop
|
||||
009D 0000 00191 nop
|
||||
009E 0000 00192 nop
|
||||
009F 0000 00193 nop
|
||||
00A0 0000 00194 nop
|
||||
00A1 0000 00195 nop
|
||||
00A2 0000 00196 nop
|
||||
00A3 0000 00197 nop
|
||||
00A4 0000 00198 nop
|
||||
00A5 0000 00199 nop
|
||||
00A6 0000 00200 nop
|
||||
00A7 0000 00201 nop
|
||||
00A8 0000 00202 nop
|
||||
00A9 0000 00203 nop
|
||||
00AA 0000 00204 nop
|
||||
00AB 0000 00205 nop
|
||||
00AC 0000 00206 nop
|
||||
00AD 0000 00207 nop
|
||||
00AE 0000 00208 nop
|
||||
00AF 0000 00209 nop
|
||||
00B0 0000 00210 nop
|
||||
00B1 0000 00211 nop
|
||||
00B2 0000 00212 nop
|
||||
00B3 0000 00213 nop
|
||||
00B4 0000 00214 nop
|
||||
00B5 0000 00215 nop
|
||||
00B6 0000 00216 nop
|
||||
00B7 0000 00217 nop
|
||||
00B8 0000 00218 nop
|
||||
00B9 0000 00219 nop
|
||||
00BA 0000 00220 nop
|
||||
00BB 0000 00221 nop
|
||||
00BC 0000 00222 nop
|
||||
00BD 0000 00223 nop
|
||||
00BE 0000 00224 nop
|
||||
00BF 0000 00225 nop
|
||||
00C0 0000 00226 nop
|
||||
00C1 0000 00227 nop
|
||||
00C2 0000 00228 nop
|
||||
00C3 0000 00229 nop
|
||||
00C4 0000 00230 nop
|
||||
00C5 0000 00231 nop
|
||||
00C6 0000 00232 nop
|
||||
00C7 0000 00233 nop
|
||||
00C8 0000 00234 nop
|
||||
00C9 0000 00235 nop
|
||||
00CA 0000 00236 nop
|
||||
00CB 0000 00237 nop
|
||||
00CC 0000 00238 nop
|
||||
00CD 0000 00239 nop
|
||||
00CE 0000 00240 nop
|
||||
00CF 0000 00241 nop
|
||||
00D0 0000 00242 nop
|
||||
00D1 0000 00243 nop
|
||||
00D2 0000 00244 nop
|
||||
00D3 0000 00245 nop
|
||||
00D4 0000 00246 nop
|
||||
00D5 0000 00247 nop
|
||||
00D6 0000 00248 nop
|
||||
00D7 0000 00249 nop
|
||||
00D8 0000 00250 nop
|
||||
00D9 0000 00251 nop
|
||||
00DA 0000 00252 nop
|
||||
00DB 0000 00253 nop
|
||||
00DC 0000 00254 nop
|
||||
00DD 0000 00255 nop
|
||||
00DE 0000 00256 nop
|
||||
00DF 0000 00257 nop
|
||||
00E0 0000 00258 nop
|
||||
00E1 0000 00259 nop
|
||||
00E2 0000 00260 nop
|
||||
00E3 0000 00261 nop
|
||||
00E4 0000 00262 nop
|
||||
00E5 0000 00263 nop
|
||||
00E6 0000 00264 nop
|
||||
00E7 0000 00265 nop
|
||||
00E8 0000 00266 nop
|
||||
00E9 0000 00267 nop
|
||||
00EA 0000 00268 nop
|
||||
00EB 0000 00269 nop
|
||||
00EC 0000 00270 nop
|
||||
00ED 0000 00271 nop
|
||||
00EE 0000 00272 nop
|
||||
00EF 0000 00273 nop
|
||||
00F0 0000 00274 nop
|
||||
00F1 0000 00275 nop
|
||||
00F2 0000 00276 nop
|
||||
00F3 0000 00277 nop
|
||||
00F4 0000 00278 nop
|
||||
00F5 0000 00279 nop
|
||||
00F6 0000 00280 nop
|
||||
00F7 0000 00281 nop
|
||||
00F8 0000 00282 nop
|
||||
00F9 0000 00283 nop
|
||||
00FA 0000 00284 nop
|
||||
00FB 0000 00285 nop
|
||||
00FC 0000 00286 nop
|
||||
00FD 0000 00287 nop
|
||||
00FE 0000 00288 nop
|
||||
00FF 0000 00289 nop
|
||||
0100 0000 00290 nop
|
||||
0101 0000 00291 nop
|
||||
0102 0000 00292 nop
|
||||
0103 0000 00293 nop
|
||||
0104 0000 00294 nop
|
||||
0105 0000 00295 nop
|
||||
0106 0000 00296 nop
|
||||
0107 0000 00297 nop
|
||||
0108 0000 00298 nop
|
||||
00299 Tabelle
|
||||
0109 0782 00300 addwf pcl
|
||||
010A 3460 00301 retlw 60h
|
||||
010B 3461 00302 retlw 61h
|
||||
010C 3462 00303 retlw 62h
|
||||
010D 3463 00304 retlw 63h
|
||||
010E 3464 00305 retlw 64h
|
||||
010F 3465 00306 retlw 65h
|
||||
0110 3466 00307 retlw 66h
|
||||
0111 3467 00308 retlw 67h
|
||||
0112 3468 00309 retlw 68h
|
||||
0113 3469 00310 retlw 69h
|
||||
0114 346A 00311 retlw 6Ah
|
||||
00312
|
||||
00313
|
||||
00314
|
||||
00001 ;TPicSim10
|
||||
00002 ;Programm zum Test des 16F84-Simulators.
|
||||
00003 ;Es wird die richtige Funktionsweise von PCL und PCLATH am Beispiel
|
||||
00004 ;eines Tabellenzugriffs getestet
|
||||
00005 ;(c) St. Lehmann
|
||||
00006 ;19.04.2014
|
||||
00007
|
||||
00008 list c=132 ;Zeilenl<6E>nge im LST auf 132 Zeichen setzen
|
||||
00009
|
||||
00010 ;Definition einiger Symbole
|
||||
00011 indirect equ 0
|
||||
00012 pcl equ 02h
|
||||
00013 status equ 03h
|
||||
00014 fsr equ 04h
|
||||
00015 ra equ 05h
|
||||
00016 rb equ 06h
|
||||
00017 pclath equ 0ah
|
||||
00018 intcon equ 0bh
|
||||
00019
|
||||
00020 ;Definition des Prozessors
|
||||
00021 device 16F84
|
||||
00022 ;Festlegen des Codebeginns
|
||||
00023 org 0
|
||||
00024 start
|
||||
0000 3000 00025 movlw 0 ;Index f<>r Tabellenzugriff in 0FH
|
||||
0001 008F 00026 movwf 0fh
|
||||
0002 3005 00027 movlw 5 ;insgesamt 5 Tabellenzugriffe
|
||||
0003 008E 00028 movwf 0eh
|
||||
0004 3010 00029 movlw 10h ;Ergebnis wird ab 10H abgespeichert
|
||||
0005 0084 00030 movwf fsr
|
||||
00031 loop
|
||||
0006 3001 00032 movlw 1 ;PCLATH setzen, damit auf den Bereich 256-511 zugegriffen werden kann
|
||||
0007 008A 00033 movwf pclath
|
||||
0008 080F 00034 movf 0fh,w
|
||||
0009 2109 00035 call tabelle
|
||||
000A 0080 00036 movwf indirect
|
||||
000B 0A84 00037 incf fsr
|
||||
000C 0A8F 00038 incf 0fh
|
||||
000D 0B8E 00039 decfsz 0eh
|
||||
000E 2806 00040 goto loop
|
||||
000F 018A 00041 clrf pclath
|
||||
0010 080F 00042 movf 0fh,w
|
||||
0011 2109 00043 call tabelle ;Fehler, der ADDWF PCL kommt nicht in die Tabelle. Grund: in W steht 5
|
||||
00044 ;im PC 109 bzw. nach dem Fetch 10A. Zu diesem Wert wird 5 addiert und
|
||||
00045 ;die oberen Bits auf 0 gesetzt (PCLATH=0). Damit steht im PC der Wert
|
||||
00046 ;0Fh. Dorthin springt der PIC durch den ADDWF-Befehl. Hier verweilt
|
||||
00047 ;das Programm w<>hrend der Stack immer weiter w<>chst.
|
||||
00048
|
||||
00049
|
||||
00050 ende
|
||||
0012 2812 00051 goto ende ;Endlosschleife, verhindert Nirwana
|
||||
00052
|
||||
0013 0000 00053 nop
|
||||
0014 0000 00054 nop
|
||||
0015 0000 00055 nop
|
||||
0016 0000 00056 nop
|
||||
0017 0000 00057 nop
|
||||
0018 0000 00058 nop
|
||||
0019 0000 00059 nop
|
||||
001A 0000 00060 nop
|
||||
001B 0000 00061 nop
|
||||
001C 0000 00062 nop
|
||||
001D 0000 00063 nop
|
||||
001E 0000 00064 nop
|
||||
001F 0000 00065 nop
|
||||
0020 0000 00066 nop
|
||||
0021 0000 00067 nop
|
||||
0022 0000 00068 nop
|
||||
0023 0000 00069 nop
|
||||
0024 0000 00070 nop
|
||||
0025 0000 00071 nop
|
||||
0026 0000 00072 nop
|
||||
0027 0000 00073 nop
|
||||
0028 0000 00074 nop
|
||||
0029 0000 00075 nop
|
||||
002A 0000 00076 nop
|
||||
002B 0000 00077 nop
|
||||
002C 0000 00078 nop
|
||||
002D 0000 00079 nop
|
||||
002E 0000 00080 nop
|
||||
002F 0000 00081 nop
|
||||
0030 0000 00082 nop
|
||||
0031 0000 00083 nop
|
||||
0032 0000 00084 nop
|
||||
0033 0000 00085 nop
|
||||
0034 0000 00086 nop
|
||||
0035 0000 00087 nop
|
||||
0036 0000 00088 nop
|
||||
0037 0000 00089 nop
|
||||
0038 0000 00090 nop
|
||||
0039 0000 00091 nop
|
||||
003A 0000 00092 nop
|
||||
003B 0000 00093 nop
|
||||
003C 0000 00094 nop
|
||||
003D 0000 00095 nop
|
||||
003E 0000 00096 nop
|
||||
003F 0000 00097 nop
|
||||
0040 0000 00098 nop
|
||||
0041 0000 00099 nop
|
||||
0042 0000 00100 nop
|
||||
0043 0000 00101 nop
|
||||
0044 0000 00102 nop
|
||||
0045 0000 00103 nop
|
||||
0046 0000 00104 nop
|
||||
0047 0000 00105 nop
|
||||
0048 0000 00106 nop
|
||||
0049 0000 00107 nop
|
||||
004A 0000 00108 nop
|
||||
004B 0000 00109 nop
|
||||
004C 0000 00110 nop
|
||||
004D 0000 00111 nop
|
||||
004E 0000 00112 nop
|
||||
004F 0000 00113 nop
|
||||
0050 0000 00114 nop
|
||||
0051 0000 00115 nop
|
||||
0052 0000 00116 nop
|
||||
0053 0000 00117 nop
|
||||
0054 0000 00118 nop
|
||||
0055 0000 00119 nop
|
||||
0056 0000 00120 nop
|
||||
0057 0000 00121 nop
|
||||
0058 0000 00122 nop
|
||||
0059 0000 00123 nop
|
||||
005A 0000 00124 nop
|
||||
005B 0000 00125 nop
|
||||
005C 0000 00126 nop
|
||||
005D 0000 00127 nop
|
||||
005E 0000 00128 nop
|
||||
005F 0000 00129 nop
|
||||
0060 0000 00130 nop
|
||||
0061 0000 00131 nop
|
||||
0062 0000 00132 nop
|
||||
0063 0000 00133 nop
|
||||
0064 0000 00134 nop
|
||||
0065 0000 00135 nop
|
||||
0066 0000 00136 nop
|
||||
0067 0000 00137 nop
|
||||
0068 0000 00138 nop
|
||||
0069 0000 00139 nop
|
||||
006A 0000 00140 nop
|
||||
006B 0000 00141 nop
|
||||
006C 0000 00142 nop
|
||||
006D 0000 00143 nop
|
||||
006E 0000 00144 nop
|
||||
006F 0000 00145 nop
|
||||
0070 0000 00146 nop
|
||||
0071 0000 00147 nop
|
||||
0072 0000 00148 nop
|
||||
0073 0000 00149 nop
|
||||
0074 0000 00150 nop
|
||||
0075 0000 00151 nop
|
||||
0076 0000 00152 nop
|
||||
0077 0000 00153 nop
|
||||
0078 0000 00154 nop
|
||||
0079 0000 00155 nop
|
||||
007A 0000 00156 nop
|
||||
007B 0000 00157 nop
|
||||
007C 0000 00158 nop
|
||||
007D 0000 00159 nop
|
||||
007E 0000 00160 nop
|
||||
007F 0000 00161 nop
|
||||
0080 0000 00162 nop
|
||||
0081 0000 00163 nop
|
||||
0082 0000 00164 nop
|
||||
0083 0000 00165 nop
|
||||
0084 0000 00166 nop
|
||||
0085 0000 00167 nop
|
||||
0086 0000 00168 nop
|
||||
0087 0000 00169 nop
|
||||
0088 0000 00170 nop
|
||||
0089 0000 00171 nop
|
||||
008A 0000 00172 nop
|
||||
008B 0000 00173 nop
|
||||
008C 0000 00174 nop
|
||||
008D 0000 00175 nop
|
||||
008E 0000 00176 nop
|
||||
008F 0000 00177 nop
|
||||
0090 0000 00178 nop
|
||||
0091 0000 00179 nop
|
||||
0092 0000 00180 nop
|
||||
0093 0000 00181 nop
|
||||
0094 0000 00182 nop
|
||||
0095 0000 00183 nop
|
||||
0096 0000 00184 nop
|
||||
0097 0000 00185 nop
|
||||
0098 0000 00186 nop
|
||||
0099 0000 00187 nop
|
||||
009A 0000 00188 nop
|
||||
009B 0000 00189 nop
|
||||
009C 0000 00190 nop
|
||||
009D 0000 00191 nop
|
||||
009E 0000 00192 nop
|
||||
009F 0000 00193 nop
|
||||
00A0 0000 00194 nop
|
||||
00A1 0000 00195 nop
|
||||
00A2 0000 00196 nop
|
||||
00A3 0000 00197 nop
|
||||
00A4 0000 00198 nop
|
||||
00A5 0000 00199 nop
|
||||
00A6 0000 00200 nop
|
||||
00A7 0000 00201 nop
|
||||
00A8 0000 00202 nop
|
||||
00A9 0000 00203 nop
|
||||
00AA 0000 00204 nop
|
||||
00AB 0000 00205 nop
|
||||
00AC 0000 00206 nop
|
||||
00AD 0000 00207 nop
|
||||
00AE 0000 00208 nop
|
||||
00AF 0000 00209 nop
|
||||
00B0 0000 00210 nop
|
||||
00B1 0000 00211 nop
|
||||
00B2 0000 00212 nop
|
||||
00B3 0000 00213 nop
|
||||
00B4 0000 00214 nop
|
||||
00B5 0000 00215 nop
|
||||
00B6 0000 00216 nop
|
||||
00B7 0000 00217 nop
|
||||
00B8 0000 00218 nop
|
||||
00B9 0000 00219 nop
|
||||
00BA 0000 00220 nop
|
||||
00BB 0000 00221 nop
|
||||
00BC 0000 00222 nop
|
||||
00BD 0000 00223 nop
|
||||
00BE 0000 00224 nop
|
||||
00BF 0000 00225 nop
|
||||
00C0 0000 00226 nop
|
||||
00C1 0000 00227 nop
|
||||
00C2 0000 00228 nop
|
||||
00C3 0000 00229 nop
|
||||
00C4 0000 00230 nop
|
||||
00C5 0000 00231 nop
|
||||
00C6 0000 00232 nop
|
||||
00C7 0000 00233 nop
|
||||
00C8 0000 00234 nop
|
||||
00C9 0000 00235 nop
|
||||
00CA 0000 00236 nop
|
||||
00CB 0000 00237 nop
|
||||
00CC 0000 00238 nop
|
||||
00CD 0000 00239 nop
|
||||
00CE 0000 00240 nop
|
||||
00CF 0000 00241 nop
|
||||
00D0 0000 00242 nop
|
||||
00D1 0000 00243 nop
|
||||
00D2 0000 00244 nop
|
||||
00D3 0000 00245 nop
|
||||
00D4 0000 00246 nop
|
||||
00D5 0000 00247 nop
|
||||
00D6 0000 00248 nop
|
||||
00D7 0000 00249 nop
|
||||
00D8 0000 00250 nop
|
||||
00D9 0000 00251 nop
|
||||
00DA 0000 00252 nop
|
||||
00DB 0000 00253 nop
|
||||
00DC 0000 00254 nop
|
||||
00DD 0000 00255 nop
|
||||
00DE 0000 00256 nop
|
||||
00DF 0000 00257 nop
|
||||
00E0 0000 00258 nop
|
||||
00E1 0000 00259 nop
|
||||
00E2 0000 00260 nop
|
||||
00E3 0000 00261 nop
|
||||
00E4 0000 00262 nop
|
||||
00E5 0000 00263 nop
|
||||
00E6 0000 00264 nop
|
||||
00E7 0000 00265 nop
|
||||
00E8 0000 00266 nop
|
||||
00E9 0000 00267 nop
|
||||
00EA 0000 00268 nop
|
||||
00EB 0000 00269 nop
|
||||
00EC 0000 00270 nop
|
||||
00ED 0000 00271 nop
|
||||
00EE 0000 00272 nop
|
||||
00EF 0000 00273 nop
|
||||
00F0 0000 00274 nop
|
||||
00F1 0000 00275 nop
|
||||
00F2 0000 00276 nop
|
||||
00F3 0000 00277 nop
|
||||
00F4 0000 00278 nop
|
||||
00F5 0000 00279 nop
|
||||
00F6 0000 00280 nop
|
||||
00F7 0000 00281 nop
|
||||
00F8 0000 00282 nop
|
||||
00F9 0000 00283 nop
|
||||
00FA 0000 00284 nop
|
||||
00FB 0000 00285 nop
|
||||
00FC 0000 00286 nop
|
||||
00FD 0000 00287 nop
|
||||
00FE 0000 00288 nop
|
||||
00FF 0000 00289 nop
|
||||
0100 0000 00290 nop
|
||||
0101 0000 00291 nop
|
||||
0102 0000 00292 nop
|
||||
0103 0000 00293 nop
|
||||
0104 0000 00294 nop
|
||||
0105 0000 00295 nop
|
||||
0106 0000 00296 nop
|
||||
0107 0000 00297 nop
|
||||
0108 0000 00298 nop
|
||||
00299 Tabelle
|
||||
0109 0782 00300 addwf pcl
|
||||
010A 3460 00301 retlw 60h
|
||||
010B 3461 00302 retlw 61h
|
||||
010C 3462 00303 retlw 62h
|
||||
010D 3463 00304 retlw 63h
|
||||
010E 3464 00305 retlw 64h
|
||||
010F 3465 00306 retlw 65h
|
||||
0110 3466 00307 retlw 66h
|
||||
0111 3467 00308 retlw 67h
|
||||
0112 3468 00309 retlw 68h
|
||||
0113 3469 00310 retlw 69h
|
||||
0114 346A 00311 retlw 6Ah
|
||||
00312
|
||||
00313
|
||||
00314
|
||||
|
@@ -1,312 +1,312 @@
|
||||
;TPicSim10
|
||||
;Programm zum Test des 16F84-Simulators.
|
||||
;Es wird die richtige Funktionsweise von PCL und PCLATH am Beispiel
|
||||
;eines Tabellenzugriffs getestet
|
||||
;(c) St. Lehmann
|
||||
;19.04.2014
|
||||
|
||||
|
||||
;Definition einiger Symbole
|
||||
indirect equ 0
|
||||
pcl equ 02h
|
||||
status equ 03h
|
||||
fsr equ 04h
|
||||
ra equ 05h
|
||||
rb equ 06h
|
||||
pclath equ 0ah
|
||||
intcon equ 0bh
|
||||
|
||||
;Definition des Prozessors
|
||||
device 16F84
|
||||
;Festlegen des Codebeginns
|
||||
org 0
|
||||
start
|
||||
movlw 0 ;Index f?r Tabellenzugriff in 0FH
|
||||
movwf 0fh
|
||||
movlw 5 ;insgesamt 5 Tabellenzugriffe
|
||||
movwf 0eh
|
||||
movlw 10h ;Ergebnis wird ab 10H abgespeichert
|
||||
movwf fsr
|
||||
loop
|
||||
movlw 1 ;PCLATH setzen, damit auf den Bereich 256-511 zugegriffen werden kann
|
||||
movwf pclath
|
||||
movf 0fh,w
|
||||
call tabelle
|
||||
movwf indirect
|
||||
incf fsr
|
||||
incf 0fh
|
||||
decfsz 0eh
|
||||
goto loop
|
||||
clrf pclath
|
||||
movf 0fh,w
|
||||
call tabelle ;Fehler, der ADDWF PCL kommt nicht in die Tabelle. Grund: in W steht 5
|
||||
;im PC 109 bzw. nach dem Fetch 10A. Zu diesem Wert wird 5 addiert und
|
||||
;die oberen Bits auf 0 gesetzt (PCLATH=0). Damit steht im PC der Wert
|
||||
;0Fh. Dorthin springt der PIC durch den ADDWF-Befehl. Hier verweilt
|
||||
;das Programm w?hrend der Stack immer weiter w?chst.
|
||||
|
||||
|
||||
ende
|
||||
goto ende ;Endlosschleife, verhindert Nirwana
|
||||
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
Tabelle
|
||||
addwf pcl
|
||||
retlw 60h
|
||||
retlw 61h
|
||||
retlw 62h
|
||||
retlw 63h
|
||||
retlw 64h
|
||||
retlw 65h
|
||||
retlw 66h
|
||||
retlw 67h
|
||||
retlw 68h
|
||||
retlw 69h
|
||||
retlw 6Ah
|
||||
|
||||
|
||||
;TPicSim10
|
||||
;Programm zum Test des 16F84-Simulators.
|
||||
;Es wird die richtige Funktionsweise von PCL und PCLATH am Beispiel
|
||||
;eines Tabellenzugriffs getestet
|
||||
;(c) St. Lehmann
|
||||
;19.04.2014
|
||||
|
||||
|
||||
;Definition einiger Symbole
|
||||
indirect equ 0
|
||||
pcl equ 02h
|
||||
status equ 03h
|
||||
fsr equ 04h
|
||||
ra equ 05h
|
||||
rb equ 06h
|
||||
pclath equ 0ah
|
||||
intcon equ 0bh
|
||||
|
||||
;Definition des Prozessors
|
||||
device 16F84
|
||||
;Festlegen des Codebeginns
|
||||
org 0
|
||||
start
|
||||
movlw 0 ;Index f?r Tabellenzugriff in 0FH
|
||||
movwf 0fh
|
||||
movlw 5 ;insgesamt 5 Tabellenzugriffe
|
||||
movwf 0eh
|
||||
movlw 10h ;Ergebnis wird ab 10H abgespeichert
|
||||
movwf fsr
|
||||
loop
|
||||
movlw 1 ;PCLATH setzen, damit auf den Bereich 256-511 zugegriffen werden kann
|
||||
movwf pclath
|
||||
movf 0fh,w
|
||||
call tabelle
|
||||
movwf indirect
|
||||
incf fsr
|
||||
incf 0fh
|
||||
decfsz 0eh
|
||||
goto loop
|
||||
clrf pclath
|
||||
movf 0fh,w
|
||||
call tabelle ;Fehler, der ADDWF PCL kommt nicht in die Tabelle. Grund: in W steht 5
|
||||
;im PC 109 bzw. nach dem Fetch 10A. Zu diesem Wert wird 5 addiert und
|
||||
;die oberen Bits auf 0 gesetzt (PCLATH=0). Damit steht im PC der Wert
|
||||
;0Fh. Dorthin springt der PIC durch den ADDWF-Befehl. Hier verweilt
|
||||
;das Programm w?hrend der Stack immer weiter w?chst.
|
||||
|
||||
|
||||
ende
|
||||
goto ende ;Endlosschleife, verhindert Nirwana
|
||||
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
Tabelle
|
||||
addwf pcl
|
||||
retlw 60h
|
||||
retlw 61h
|
||||
retlw 62h
|
||||
retlw 63h
|
||||
retlw 64h
|
||||
retlw 65h
|
||||
retlw 66h
|
||||
retlw 67h
|
||||
retlw 68h
|
||||
retlw 69h
|
||||
retlw 6Ah
|
||||
|
||||
|
||||
|
@@ -1,50 +1,50 @@
|
||||
00001 ;TPicSim11
|
||||
00002 ;Programm zum Test des 16F84-Simulators.
|
||||
00003 ;Es wird der Watchdog mit und ohne Vorteiler gepr<70>ft
|
||||
00004 ;(c) St. Lehmann
|
||||
00005 ;19.04.2014
|
||||
00006
|
||||
00007 list c=132 ;Zeilenl<6E>nge im LST auf 132 Zeichen setzen
|
||||
00008
|
||||
00009 ;Definition einiger Symbole
|
||||
00010 indirect equ 0
|
||||
00011 status equ 03h
|
||||
00012 fsr equ 04h
|
||||
00013 ra equ 05h
|
||||
00014 rb equ 06h
|
||||
00015 count equ 0ch
|
||||
00016
|
||||
00017 ;Definition des Prozessors
|
||||
00018 device 16F84
|
||||
00019 ;Festlegen des Codebeginns
|
||||
00020 org 0
|
||||
00021 start
|
||||
00022 ;zuerst wird der VT dem Timer zugewiesen. Damit bekommt der Watchdog
|
||||
00023 ;die kleinste Zeit (ca. 18 ms) zugewiesen
|
||||
0000 3000 00024 movlw 00000000B ;Option-Register entsp. initialisieren
|
||||
0001 1683 00025 bsf status,5 ;Bank umschalten
|
||||
0002 0081 00026 movwf 1 ;Option-Register
|
||||
0003 1283 00027 bcf status,5
|
||||
0004 01A0 00028 clrf 20h
|
||||
0005 01A1 00029 clrf 21h
|
||||
0006 01A2 00030 clrf 22h
|
||||
0007 01A3 00031 clrf 23h
|
||||
00032 loop1
|
||||
0008 0FA0 00033 incfsz 20h
|
||||
0009 2808 00034 goto loop1 ;kein <20>berlauf
|
||||
000A 0FA1 00035 incfsz 21h ;n<>chste Stelle
|
||||
000B 2808 00036 goto loop1 ;kein <20>berlauf
|
||||
000C 0FA2 00037 incfsz 22h ;ja
|
||||
000D 2808 00038 goto loop1
|
||||
000E 0FA3 00039 incfsz 23h
|
||||
000F 2808 00040 goto loop1
|
||||
00041
|
||||
00042 ;******************************************************************
|
||||
00043 ;in 20h steht ca. 5fH
|
||||
00044 ;in 21H ca. 17H
|
||||
00045 ;Z<>hlerstand 16-Bit ca. 175FH = 5983d
|
||||
00046
|
||||
00047 ende
|
||||
0010 2810 00048 goto ende ;Endlosschleife, verhindert Nirwana
|
||||
00049
|
||||
00050
|
||||
00001 ;TPicSim11
|
||||
00002 ;Programm zum Test des 16F84-Simulators.
|
||||
00003 ;Es wird der Watchdog mit und ohne Vorteiler gepr<70>ft
|
||||
00004 ;(c) St. Lehmann
|
||||
00005 ;19.04.2014
|
||||
00006
|
||||
00007 list c=132 ;Zeilenl<6E>nge im LST auf 132 Zeichen setzen
|
||||
00008
|
||||
00009 ;Definition einiger Symbole
|
||||
00010 indirect equ 0
|
||||
00011 status equ 03h
|
||||
00012 fsr equ 04h
|
||||
00013 ra equ 05h
|
||||
00014 rb equ 06h
|
||||
00015 count equ 0ch
|
||||
00016
|
||||
00017 ;Definition des Prozessors
|
||||
00018 device 16F84
|
||||
00019 ;Festlegen des Codebeginns
|
||||
00020 org 0
|
||||
00021 start
|
||||
00022 ;zuerst wird der VT dem Timer zugewiesen. Damit bekommt der Watchdog
|
||||
00023 ;die kleinste Zeit (ca. 18 ms) zugewiesen
|
||||
0000 3000 00024 movlw 00000000B ;Option-Register entsp. initialisieren
|
||||
0001 1683 00025 bsf status,5 ;Bank umschalten
|
||||
0002 0081 00026 movwf 1 ;Option-Register
|
||||
0003 1283 00027 bcf status,5
|
||||
0004 01A0 00028 clrf 20h
|
||||
0005 01A1 00029 clrf 21h
|
||||
0006 01A2 00030 clrf 22h
|
||||
0007 01A3 00031 clrf 23h
|
||||
00032 loop1
|
||||
0008 0FA0 00033 incfsz 20h
|
||||
0009 2808 00034 goto loop1 ;kein <20>berlauf
|
||||
000A 0FA1 00035 incfsz 21h ;n<>chste Stelle
|
||||
000B 2808 00036 goto loop1 ;kein <20>berlauf
|
||||
000C 0FA2 00037 incfsz 22h ;ja
|
||||
000D 2808 00038 goto loop1
|
||||
000E 0FA3 00039 incfsz 23h
|
||||
000F 2808 00040 goto loop1
|
||||
00041
|
||||
00042 ;******************************************************************
|
||||
00043 ;in 20h steht ca. 5fH
|
||||
00044 ;in 21H ca. 17H
|
||||
00045 ;Z<>hlerstand 16-Bit ca. 175FH = 5983d
|
||||
00046
|
||||
00047 ende
|
||||
0010 2810 00048 goto ende ;Endlosschleife, verhindert Nirwana
|
||||
00049
|
||||
00050
|
||||
|
@@ -1,48 +1,48 @@
|
||||
;TPicSim11
|
||||
;Programm zum Test des 16F84-Simulators.
|
||||
;Es wird der Watchdog mit und ohne Vorteiler gepr?ft
|
||||
;(c) St. Lehmann
|
||||
;19.04.2014
|
||||
|
||||
|
||||
;Definition einiger Symbole
|
||||
indirect equ 0
|
||||
status equ 03h
|
||||
fsr equ 04h
|
||||
ra equ 05h
|
||||
rb equ 06h
|
||||
count equ 0ch
|
||||
|
||||
;Definition des Prozessors
|
||||
device 16F84
|
||||
;Festlegen des Codebeginns
|
||||
org 0
|
||||
start
|
||||
;zuerst wird der VT dem Timer zugewiesen. Damit bekommt der Watchdog
|
||||
;die kleinste Zeit (ca. 18 ms) zugewiesen
|
||||
movlw 00000000B ;Option-Register entsp. initialisieren
|
||||
bsf status,5 ;Bank umschalten
|
||||
movwf 1 ;Option-Register
|
||||
bcf status,5
|
||||
clrf 20h
|
||||
clrf 21h
|
||||
clrf 22h
|
||||
clrf 23h
|
||||
loop1
|
||||
incfsz 20h
|
||||
goto loop1 ;kein ?berlauf
|
||||
incfsz 21h ;n?chste Stelle
|
||||
goto loop1 ;kein ?berlauf
|
||||
incfsz 22h ;ja
|
||||
goto loop1
|
||||
incfsz 23h
|
||||
goto loop1
|
||||
|
||||
;******************************************************************
|
||||
;in 20h steht ca. 5fH
|
||||
;in 21H ca. 17H
|
||||
;Z?hlerstand 16-Bit ca. 175FH = 5983d
|
||||
|
||||
ende
|
||||
goto ende ;Endlosschleife, verhindert Nirwana
|
||||
|
||||
;TPicSim11
|
||||
;Programm zum Test des 16F84-Simulators.
|
||||
;Es wird der Watchdog mit und ohne Vorteiler gepr?ft
|
||||
;(c) St. Lehmann
|
||||
;19.04.2014
|
||||
|
||||
|
||||
;Definition einiger Symbole
|
||||
indirect equ 0
|
||||
status equ 03h
|
||||
fsr equ 04h
|
||||
ra equ 05h
|
||||
rb equ 06h
|
||||
count equ 0ch
|
||||
|
||||
;Definition des Prozessors
|
||||
device 16F84
|
||||
;Festlegen des Codebeginns
|
||||
org 0
|
||||
start
|
||||
;zuerst wird der VT dem Timer zugewiesen. Damit bekommt der Watchdog
|
||||
;die kleinste Zeit (ca. 18 ms) zugewiesen
|
||||
movlw 00000000B ;Option-Register entsp. initialisieren
|
||||
bsf status,5 ;Bank umschalten
|
||||
movwf 1 ;Option-Register
|
||||
bcf status,5
|
||||
clrf 20h
|
||||
clrf 21h
|
||||
clrf 22h
|
||||
clrf 23h
|
||||
loop1
|
||||
incfsz 20h
|
||||
goto loop1 ;kein ?berlauf
|
||||
incfsz 21h ;n?chste Stelle
|
||||
goto loop1 ;kein ?berlauf
|
||||
incfsz 22h ;ja
|
||||
goto loop1
|
||||
incfsz 23h
|
||||
goto loop1
|
||||
|
||||
;******************************************************************
|
||||
;in 20h steht ca. 5fH
|
||||
;in 21H ca. 17H
|
||||
;Z?hlerstand 16-Bit ca. 175FH = 5983d
|
||||
|
||||
ende
|
||||
goto ende ;Endlosschleife, verhindert Nirwana
|
||||
|
||||
|
@@ -1,78 +1,78 @@
|
||||
00001 ;TPicSim12
|
||||
00002 ;Programm zum Test des 16F84-Simulators.
|
||||
00003 ;Funktion: Beschreiben und Lesen des EEPROMs
|
||||
00004 ;(c) St. Lehmann Ersterstellung: 11.05.2011
|
||||
00005 ;Definition einiger Symbole
|
||||
00006
|
||||
00007 list c=132 ;Zeilenl<6E>nge im LST auf 132 Zeichen setzen
|
||||
00008
|
||||
00009 indirect equ 0
|
||||
00010 status equ 03h
|
||||
00011 fsr equ 04h
|
||||
00012 ra equ 05h
|
||||
00013 rb equ 06h
|
||||
00014 count equ 0ch
|
||||
00015 eedata equ 08h
|
||||
00016 eeaddr equ 09h
|
||||
00017 eecon1 equ 08h ;auf Bank 1
|
||||
00018 eecon2 equ 09h ;auf Bank 1
|
||||
00019
|
||||
00020 ;Definition des Prozessors
|
||||
00021 device 16F84
|
||||
00022
|
||||
00023 ;Festlegen des Codebeginns
|
||||
00024 org 0
|
||||
00025 start
|
||||
0000 3000 00026 movlw 0 ;der EEPROM-Speicher von 0 bis 3FH (63) gef<65>llt
|
||||
0001 008C 00027 movwf count
|
||||
00028 schreiben
|
||||
0002 080C 00029 movf count,w
|
||||
0003 0089 00030 movwf eeaddr ;diese Adresse soll beschrieben werden
|
||||
0004 3AFF 00031 xorlw 255 ;Adresse invertieren
|
||||
0005 0088 00032 movwf eedata ;dieser Wert an obige Adresse schreiben
|
||||
00033
|
||||
0006 1683 00034 bsf status,5 ;auf Bank 1
|
||||
0007 1208 00035 bcf eecon1,4 ;EEIF zur<75>cksetzen, wird <20>berwacht
|
||||
0008 1508 00036 bsf eecon1,2 ;WREN-Bit setzen, sonst kein schreiben m<>glich
|
||||
0009 1488 00037 bsf eecon1,1 ;WR-Bit setzen
|
||||
00038
|
||||
000A 3055 00039 movlw 55h ;State-Machine anwerfen
|
||||
000B 0089 00040 movwf eecon2
|
||||
000C 30AA 00041 movlw 0AAh
|
||||
000D 0089 00042 movwf eecon2 ;Schreibvorgang beginnt jetzt
|
||||
00043
|
||||
00044 warte
|
||||
000E 1E08 00045 btfss eecon1,4 ;warte bis EEIF auf 1 ist
|
||||
000F 280E 00046 goto warte
|
||||
00047
|
||||
0010 1108 00048 bcf eecon1,2 ;WREN auf 0
|
||||
00049
|
||||
0011 1283 00050 bcf status,5 ;zur<75>ck auf Bank 0
|
||||
00051
|
||||
0012 0A8C 00052 incf count
|
||||
0013 080C 00053 movf count,w ;ist der Wert 40H erreicht
|
||||
0014 3C40 00054 sublw 40h
|
||||
0015 1D03 00055 btfss status,2 ;wenn 0, dann fertig
|
||||
0016 2802 00056 goto schreiben
|
||||
00057
|
||||
00058
|
||||
0017 018C 00059 clrf count ;jetzt gesamten Speicher lesen
|
||||
00060 lesen:
|
||||
0018 080C 00061 movf count,w
|
||||
0019 0089 00062 movwf eeaddr
|
||||
00063
|
||||
001A 1683 00064 bsf status,5 ;auf Bank 1
|
||||
001B 1408 00065 bsf eecon1,0 ;RD-Bit auf 1, wird vom PIC wieder auf 0 gesetzt
|
||||
001C 1283 00066 bcf status,5 ;zur<75>ck auf Bank 0
|
||||
00067
|
||||
001D 0808 00068 movf eedata,w ;Wert ins W-Register
|
||||
00069
|
||||
001E 0A8C 00070 incf count
|
||||
001F 080C 00071 movf count,w ;ist der Wert 40H erreicht
|
||||
0020 3C40 00072 sublw 40h
|
||||
0021 1D03 00073 btfss status,2 ;wenn 0, dann fertig
|
||||
0022 2818 00074 goto lesen
|
||||
00075
|
||||
00076 ende
|
||||
0023 2823 00077 goto ende
|
||||
00078
|
||||
00001 ;TPicSim12
|
||||
00002 ;Programm zum Test des 16F84-Simulators.
|
||||
00003 ;Funktion: Beschreiben und Lesen des EEPROMs
|
||||
00004 ;(c) St. Lehmann Ersterstellung: 11.05.2011
|
||||
00005 ;Definition einiger Symbole
|
||||
00006
|
||||
00007 list c=132 ;Zeilenl<6E>nge im LST auf 132 Zeichen setzen
|
||||
00008
|
||||
00009 indirect equ 0
|
||||
00010 status equ 03h
|
||||
00011 fsr equ 04h
|
||||
00012 ra equ 05h
|
||||
00013 rb equ 06h
|
||||
00014 count equ 0ch
|
||||
00015 eedata equ 08h
|
||||
00016 eeaddr equ 09h
|
||||
00017 eecon1 equ 08h ;auf Bank 1
|
||||
00018 eecon2 equ 09h ;auf Bank 1
|
||||
00019
|
||||
00020 ;Definition des Prozessors
|
||||
00021 device 16F84
|
||||
00022
|
||||
00023 ;Festlegen des Codebeginns
|
||||
00024 org 0
|
||||
00025 start
|
||||
0000 3000 00026 movlw 0 ;der EEPROM-Speicher von 0 bis 3FH (63) gef<65>llt
|
||||
0001 008C 00027 movwf count
|
||||
00028 schreiben
|
||||
0002 080C 00029 movf count,w
|
||||
0003 0089 00030 movwf eeaddr ;diese Adresse soll beschrieben werden
|
||||
0004 3AFF 00031 xorlw 255 ;Adresse invertieren
|
||||
0005 0088 00032 movwf eedata ;dieser Wert an obige Adresse schreiben
|
||||
00033
|
||||
0006 1683 00034 bsf status,5 ;auf Bank 1
|
||||
0007 1208 00035 bcf eecon1,4 ;EEIF zur<75>cksetzen, wird <20>berwacht
|
||||
0008 1508 00036 bsf eecon1,2 ;WREN-Bit setzen, sonst kein schreiben m<>glich
|
||||
0009 1488 00037 bsf eecon1,1 ;WR-Bit setzen
|
||||
00038
|
||||
000A 3055 00039 movlw 55h ;State-Machine anwerfen
|
||||
000B 0089 00040 movwf eecon2
|
||||
000C 30AA 00041 movlw 0AAh
|
||||
000D 0089 00042 movwf eecon2 ;Schreibvorgang beginnt jetzt
|
||||
00043
|
||||
00044 warte
|
||||
000E 1E08 00045 btfss eecon1,4 ;warte bis EEIF auf 1 ist
|
||||
000F 280E 00046 goto warte
|
||||
00047
|
||||
0010 1108 00048 bcf eecon1,2 ;WREN auf 0
|
||||
00049
|
||||
0011 1283 00050 bcf status,5 ;zur<75>ck auf Bank 0
|
||||
00051
|
||||
0012 0A8C 00052 incf count
|
||||
0013 080C 00053 movf count,w ;ist der Wert 40H erreicht
|
||||
0014 3C40 00054 sublw 40h
|
||||
0015 1D03 00055 btfss status,2 ;wenn 0, dann fertig
|
||||
0016 2802 00056 goto schreiben
|
||||
00057
|
||||
00058
|
||||
0017 018C 00059 clrf count ;jetzt gesamten Speicher lesen
|
||||
00060 lesen:
|
||||
0018 080C 00061 movf count,w
|
||||
0019 0089 00062 movwf eeaddr
|
||||
00063
|
||||
001A 1683 00064 bsf status,5 ;auf Bank 1
|
||||
001B 1408 00065 bsf eecon1,0 ;RD-Bit auf 1, wird vom PIC wieder auf 0 gesetzt
|
||||
001C 1283 00066 bcf status,5 ;zur<75>ck auf Bank 0
|
||||
00067
|
||||
001D 0808 00068 movf eedata,w ;Wert ins W-Register
|
||||
00069
|
||||
001E 0A8C 00070 incf count
|
||||
001F 080C 00071 movf count,w ;ist der Wert 40H erreicht
|
||||
0020 3C40 00072 sublw 40h
|
||||
0021 1D03 00073 btfss status,2 ;wenn 0, dann fertig
|
||||
0022 2818 00074 goto lesen
|
||||
00075
|
||||
00076 ende
|
||||
0023 2823 00077 goto ende
|
||||
00078
|
||||
|
@@ -1,76 +1,76 @@
|
||||
;TPicSim12
|
||||
;Programm zum Test des 16F84-Simulators.
|
||||
;Funktion: Beschreiben und Lesen des EEPROMs
|
||||
;(c) St. Lehmann Ersterstellung: 11.05.2011
|
||||
;Definition einiger Symbole
|
||||
|
||||
|
||||
indirect equ 0
|
||||
status equ 03h
|
||||
fsr equ 04h
|
||||
ra equ 05h
|
||||
rb equ 06h
|
||||
count equ 0ch
|
||||
eedata equ 08h
|
||||
eeaddr equ 09h
|
||||
eecon1 equ 08h ;auf Bank 1
|
||||
eecon2 equ 09h ;auf Bank 1
|
||||
|
||||
;Definition des Prozessors
|
||||
device 16F84
|
||||
|
||||
;Festlegen des Codebeginns
|
||||
org 0
|
||||
start
|
||||
movlw 0 ;der EEPROM-Speicher von 0 bis 3FH (63) gef?llt
|
||||
movwf count
|
||||
schreiben
|
||||
movf count,w
|
||||
movwf eeaddr ;diese Adresse soll beschrieben werden
|
||||
xorlw 255 ;Adresse invertieren
|
||||
movwf eedata ;dieser Wert an obige Adresse schreiben
|
||||
|
||||
bsf status,5 ;auf Bank 1
|
||||
bcf eecon1,4 ;EEIF zur?cksetzen, wird ?berwacht
|
||||
bsf eecon1,2 ;WREN-Bit setzen, sonst kein schreiben m?glich
|
||||
bsf eecon1,1 ;WR-Bit setzen
|
||||
|
||||
movlw 55h ;State-Machine anwerfen
|
||||
movwf eecon2
|
||||
movlw 0AAh
|
||||
movwf eecon2 ;Schreibvorgang beginnt jetzt
|
||||
|
||||
warte
|
||||
btfss eecon1,4 ;warte bis EEIF auf 1 ist
|
||||
goto warte
|
||||
|
||||
bcf eecon1,2 ;WREN auf 0
|
||||
|
||||
bcf status,5 ;zur?ck auf Bank 0
|
||||
|
||||
incf count
|
||||
movf count,w ;ist der Wert 40H erreicht
|
||||
sublw 40h
|
||||
btfss status,2 ;wenn 0, dann fertig
|
||||
goto schreiben
|
||||
|
||||
|
||||
clrf count ;jetzt gesamten Speicher lesen
|
||||
lesen:
|
||||
movf count,w
|
||||
movwf eeaddr
|
||||
|
||||
bsf status,5 ;auf Bank 1
|
||||
bsf eecon1,0 ;RD-Bit auf 1, wird vom PIC wieder auf 0 gesetzt
|
||||
bcf status,5 ;zur?ck auf Bank 0
|
||||
|
||||
movf eedata,w ;Wert ins W-Register
|
||||
|
||||
incf count
|
||||
movf count,w ;ist der Wert 40H erreicht
|
||||
sublw 40h
|
||||
btfss status,2 ;wenn 0, dann fertig
|
||||
goto lesen
|
||||
|
||||
ende
|
||||
goto ende
|
||||
;TPicSim12
|
||||
;Programm zum Test des 16F84-Simulators.
|
||||
;Funktion: Beschreiben und Lesen des EEPROMs
|
||||
;(c) St. Lehmann Ersterstellung: 11.05.2011
|
||||
;Definition einiger Symbole
|
||||
|
||||
|
||||
indirect equ 0
|
||||
status equ 03h
|
||||
fsr equ 04h
|
||||
ra equ 05h
|
||||
rb equ 06h
|
||||
count equ 0ch
|
||||
eedata equ 08h
|
||||
eeaddr equ 09h
|
||||
eecon1 equ 08h ;auf Bank 1
|
||||
eecon2 equ 09h ;auf Bank 1
|
||||
|
||||
;Definition des Prozessors
|
||||
device 16F84
|
||||
|
||||
;Festlegen des Codebeginns
|
||||
org 0
|
||||
start
|
||||
movlw 0 ;der EEPROM-Speicher von 0 bis 3FH (63) gef?llt
|
||||
movwf count
|
||||
schreiben
|
||||
movf count,w
|
||||
movwf eeaddr ;diese Adresse soll beschrieben werden
|
||||
xorlw 255 ;Adresse invertieren
|
||||
movwf eedata ;dieser Wert an obige Adresse schreiben
|
||||
|
||||
bsf status,5 ;auf Bank 1
|
||||
bcf eecon1,4 ;EEIF zur?cksetzen, wird ?berwacht
|
||||
bsf eecon1,2 ;WREN-Bit setzen, sonst kein schreiben m?glich
|
||||
bsf eecon1,1 ;WR-Bit setzen
|
||||
|
||||
movlw 55h ;State-Machine anwerfen
|
||||
movwf eecon2
|
||||
movlw 0AAh
|
||||
movwf eecon2 ;Schreibvorgang beginnt jetzt
|
||||
|
||||
warte
|
||||
btfss eecon1,4 ;warte bis EEIF auf 1 ist
|
||||
goto warte
|
||||
|
||||
bcf eecon1,2 ;WREN auf 0
|
||||
|
||||
bcf status,5 ;zur?ck auf Bank 0
|
||||
|
||||
incf count
|
||||
movf count,w ;ist der Wert 40H erreicht
|
||||
sublw 40h
|
||||
btfss status,2 ;wenn 0, dann fertig
|
||||
goto schreiben
|
||||
|
||||
|
||||
clrf count ;jetzt gesamten Speicher lesen
|
||||
lesen:
|
||||
movf count,w
|
||||
movwf eeaddr
|
||||
|
||||
bsf status,5 ;auf Bank 1
|
||||
bsf eecon1,0 ;RD-Bit auf 1, wird vom PIC wieder auf 0 gesetzt
|
||||
bcf status,5 ;zur?ck auf Bank 0
|
||||
|
||||
movf eedata,w ;Wert ins W-Register
|
||||
|
||||
incf count
|
||||
movf count,w ;ist der Wert 40H erreicht
|
||||
sublw 40h
|
||||
btfss status,2 ;wenn 0, dann fertig
|
||||
goto lesen
|
||||
|
||||
ende
|
||||
goto ende
|
||||
|
@@ -1,78 +1,78 @@
|
||||
00001 ;TPicSim12
|
||||
00002 ;Programm zum Test des 16F84-Simulators.
|
||||
00003 ;Funktion: Beschreiben und Lesen des EEPROMs
|
||||
00004 ;(c) St. Lehmann Ersterstellung: 11.05.2011
|
||||
00005 ;Definition einiger Symbole
|
||||
00006
|
||||
00007 list c=132 ;Zeilenl<6E>nge im LST auf 132 Zeichen setzen
|
||||
00008
|
||||
00009 indirect equ 0
|
||||
00010 status equ 03h
|
||||
00011 fsr equ 04h
|
||||
00012 ra equ 05h
|
||||
00013 rb equ 06h
|
||||
00014 count equ 0ch
|
||||
00015 eedata equ 08h
|
||||
00016 eeaddr equ 09h
|
||||
00017 eecon1 equ 08h ;auf Bank 1
|
||||
00018 eecon2 equ 09h ;auf Bank 1
|
||||
00019
|
||||
00020 ;Definition des Prozessors
|
||||
00021 device 16F84
|
||||
00022
|
||||
00023 ;Festlegen des Codebeginns
|
||||
00024 org 0
|
||||
00025 start
|
||||
0000 0020 00026 movlw 0 ;der EEPROM-Speicher von 0 bis 3FH (63) gef<65>llt
|
||||
0001 0060 00027 movwf count
|
||||
00028 schreiben
|
||||
0002 0040 00029 movf count,w
|
||||
0003 0000 00030 movwf eeaddr ;diese Adresse soll beschrieben werden
|
||||
0004 3AFF 00031 xorlw 255 ;Adresse invertieren
|
||||
0005 0088 00032 movwf eedata ;dieser Wert an obige Adresse schreiben
|
||||
00033
|
||||
0006 1683 00034 bsf status,5 ;auf Bank 1
|
||||
0007 1208 00035 bcf eecon1,4 ;EEIF zur<75>cksetzen, wird <20>berwacht
|
||||
0008 1508 00036 bsf eecon1,2 ;WREN-Bit setzen, sonst kein schreiben m<>glich
|
||||
0009 1488 00037 bsf eecon1,1 ;WR-Bit setzen
|
||||
00038
|
||||
000A 3055 00039 movlw 55h ;State-Machine anwerfen
|
||||
000B 0089 00040 movwf eecon2
|
||||
000C 30AA 00041 movlw 0AAh
|
||||
000D 0089 00042 movwf eecon2 ;Schreibvorgang beginnt jetzt
|
||||
00043
|
||||
00044 warte
|
||||
000E 1E08 00045 btfss eecon1,4 ;warte bis EEIF auf 1 ist
|
||||
000F 280E 00046 goto warte
|
||||
00047
|
||||
0010 1108 00048 bcf eecon1,2 ;WREN auf 0
|
||||
00049
|
||||
0011 1283 00050 bcf status,5 ;zur<75>ck auf Bank 0
|
||||
00051
|
||||
0012 0A8C 00052 incf count
|
||||
0013 080C 00053 movf count,w ;ist der Wert 40H erreicht
|
||||
0014 3C40 00054 sublw 40h
|
||||
0015 1D03 00055 btfss status,2 ;wenn 0, dann fertig
|
||||
0016 2802 00056 goto schreiben
|
||||
00057
|
||||
00058
|
||||
0017 018C 00059 clrf count ;jetzt gesamten Speicher lesen
|
||||
00060 lesen:
|
||||
0018 080C 00061 movf count,w
|
||||
0019 0089 00062 movwf eeaddr
|
||||
00063
|
||||
001A 1683 00064 bsf status,5 ;auf Bank 1
|
||||
001B 1408 00065 bsf eecon1,0 ;RD-Bit auf 1, wird vom PIC wieder auf 0 gesetzt
|
||||
001C 1283 00066 bcf status,5 ;zur<75>ck auf Bank 0
|
||||
00067
|
||||
001D 0808 00068 movf eedata,w ;Wert ins W-Register
|
||||
00069
|
||||
001E 0A8C 00070 incf count
|
||||
001F 080C 00071 movf count,w ;ist der Wert 40H erreicht
|
||||
0020 3C40 00072 sublw 40h
|
||||
0021 1D03 00073 btfss status,2 ;wenn 0, dann fertig
|
||||
0022 2818 00074 goto lesen
|
||||
00075
|
||||
00076 ende
|
||||
0023 2823 00077 goto ende
|
||||
00078
|
||||
00001 ;TPicSim12
|
||||
00002 ;Programm zum Test des 16F84-Simulators.
|
||||
00003 ;Funktion: Beschreiben und Lesen des EEPROMs
|
||||
00004 ;(c) St. Lehmann Ersterstellung: 11.05.2011
|
||||
00005 ;Definition einiger Symbole
|
||||
00006
|
||||
00007 list c=132 ;Zeilenl<6E>nge im LST auf 132 Zeichen setzen
|
||||
00008
|
||||
00009 indirect equ 0
|
||||
00010 status equ 03h
|
||||
00011 fsr equ 04h
|
||||
00012 ra equ 05h
|
||||
00013 rb equ 06h
|
||||
00014 count equ 0ch
|
||||
00015 eedata equ 08h
|
||||
00016 eeaddr equ 09h
|
||||
00017 eecon1 equ 08h ;auf Bank 1
|
||||
00018 eecon2 equ 09h ;auf Bank 1
|
||||
00019
|
||||
00020 ;Definition des Prozessors
|
||||
00021 device 16F84
|
||||
00022
|
||||
00023 ;Festlegen des Codebeginns
|
||||
00024 org 0
|
||||
00025 start
|
||||
0000 0020 00026 movlw 0 ;der EEPROM-Speicher von 0 bis 3FH (63) gef<65>llt
|
||||
0001 0060 00027 movwf count
|
||||
00028 schreiben
|
||||
0002 0040 00029 movf count,w
|
||||
0003 0000 00030 movwf eeaddr ;diese Adresse soll beschrieben werden
|
||||
0004 3AFF 00031 xorlw 255 ;Adresse invertieren
|
||||
0005 0088 00032 movwf eedata ;dieser Wert an obige Adresse schreiben
|
||||
00033
|
||||
0006 1683 00034 bsf status,5 ;auf Bank 1
|
||||
0007 1208 00035 bcf eecon1,4 ;EEIF zur<75>cksetzen, wird <20>berwacht
|
||||
0008 1508 00036 bsf eecon1,2 ;WREN-Bit setzen, sonst kein schreiben m<>glich
|
||||
0009 1488 00037 bsf eecon1,1 ;WR-Bit setzen
|
||||
00038
|
||||
000A 3055 00039 movlw 55h ;State-Machine anwerfen
|
||||
000B 0089 00040 movwf eecon2
|
||||
000C 30AA 00041 movlw 0AAh
|
||||
000D 0089 00042 movwf eecon2 ;Schreibvorgang beginnt jetzt
|
||||
00043
|
||||
00044 warte
|
||||
000E 1E08 00045 btfss eecon1,4 ;warte bis EEIF auf 1 ist
|
||||
000F 280E 00046 goto warte
|
||||
00047
|
||||
0010 1108 00048 bcf eecon1,2 ;WREN auf 0
|
||||
00049
|
||||
0011 1283 00050 bcf status,5 ;zur<75>ck auf Bank 0
|
||||
00051
|
||||
0012 0A8C 00052 incf count
|
||||
0013 080C 00053 movf count,w ;ist der Wert 40H erreicht
|
||||
0014 3C40 00054 sublw 40h
|
||||
0015 1D03 00055 btfss status,2 ;wenn 0, dann fertig
|
||||
0016 2802 00056 goto schreiben
|
||||
00057
|
||||
00058
|
||||
0017 018C 00059 clrf count ;jetzt gesamten Speicher lesen
|
||||
00060 lesen:
|
||||
0018 080C 00061 movf count,w
|
||||
0019 0089 00062 movwf eeaddr
|
||||
00063
|
||||
001A 1683 00064 bsf status,5 ;auf Bank 1
|
||||
001B 1408 00065 bsf eecon1,0 ;RD-Bit auf 1, wird vom PIC wieder auf 0 gesetzt
|
||||
001C 1283 00066 bcf status,5 ;zur<75>ck auf Bank 0
|
||||
00067
|
||||
001D 0808 00068 movf eedata,w ;Wert ins W-Register
|
||||
00069
|
||||
001E 0A8C 00070 incf count
|
||||
001F 080C 00071 movf count,w ;ist der Wert 40H erreicht
|
||||
0020 3C40 00072 sublw 40h
|
||||
0021 1D03 00073 btfss status,2 ;wenn 0, dann fertig
|
||||
0022 2818 00074 goto lesen
|
||||
00075
|
||||
00076 ende
|
||||
0023 2823 00077 goto ende
|
||||
00078
|
||||
|
@@ -1,41 +1,41 @@
|
||||
00001 ;TPicSim2
|
||||
00002 ;Programm zum Test des 16F84-Simulators.
|
||||
00003 ;Es werden CALL, GOTO, RETLW, RETURN gepr<70>ft (kein RETFIE)
|
||||
00004 ;(c) St. Lehmann
|
||||
00005 ;Ersterstellung: 23.03.2016
|
||||
00006 ;
|
||||
00007 list c=132 ;Zeilenl<6E>nge im LST auf 132 Zeichen setzen
|
||||
00008
|
||||
00009 ;Definition einiger Symbole
|
||||
00010 ;zuerst Hardware-Register
|
||||
00011 status equ 03h
|
||||
00012 ra equ 05h
|
||||
00013 rb equ 06h
|
||||
00014
|
||||
00015 ;f<>r den Benutzer frei verwendbare Register
|
||||
00016 count equ 0ch
|
||||
00017
|
||||
00018 ;Definition des Prozessors
|
||||
00019 device 16F84
|
||||
00020
|
||||
00021 ;Festlegen des Codebeginns
|
||||
00022 org 0
|
||||
00023 loop
|
||||
0000 3011 00024 movlw 11h ;in W steht nun 11h, Statusreg. unver<65>ndert
|
||||
0001 2006 00025 call up1 ;beim Call wird R<>cksprungadresse auf Stack gelegt
|
||||
0002 0000 00026 nop ;W = 36h, C=0, DC=0, Z=0
|
||||
0003 2008 00027 call up2 ;in W steht der R<>ckgabewert
|
||||
0004 0000 00028 nop ;W = 77h, DC=0, C=0, Z=0;
|
||||
0005 2800 00029 goto loop
|
||||
00030
|
||||
00031 ;UP1 z<>hlt zu W den Wert 25h hinzu und kehrt mit RETURN zur<75>ck
|
||||
0006 3E25 00032 up1 addlw 25h ;W = 36h, DC=0, C=0, Z=0
|
||||
0007 0008 00033 return
|
||||
00034
|
||||
00035 ;UP2 kehrt mit der Konstanten 77h zur<75>ck
|
||||
0008 3477 00036 up2 retlw 77h
|
||||
00037
|
||||
00038 ende
|
||||
0009 2809 00039 goto ende ;Endlosschleife, verhindert Nirwana
|
||||
00040
|
||||
00041
|
||||
00001 ;TPicSim2
|
||||
00002 ;Programm zum Test des 16F84-Simulators.
|
||||
00003 ;Es werden CALL, GOTO, RETLW, RETURN gepr<70>ft (kein RETFIE)
|
||||
00004 ;(c) St. Lehmann
|
||||
00005 ;Ersterstellung: 23.03.2016
|
||||
00006 ;
|
||||
00007 list c=132 ;Zeilenl<6E>nge im LST auf 132 Zeichen setzen
|
||||
00008
|
||||
00009 ;Definition einiger Symbole
|
||||
00010 ;zuerst Hardware-Register
|
||||
00011 status equ 03h
|
||||
00012 ra equ 05h
|
||||
00013 rb equ 06h
|
||||
00014
|
||||
00015 ;f<>r den Benutzer frei verwendbare Register
|
||||
00016 count equ 0ch
|
||||
00017
|
||||
00018 ;Definition des Prozessors
|
||||
00019 device 16F84
|
||||
00020
|
||||
00021 ;Festlegen des Codebeginns
|
||||
00022 org 0
|
||||
00023 loop
|
||||
0000 3011 00024 movlw 11h ;in W steht nun 11h, Statusreg. unver<65>ndert
|
||||
0001 2006 00025 call up1 ;beim Call wird R<>cksprungadresse auf Stack gelegt
|
||||
0002 0000 00026 nop ;W = 36h, C=0, DC=0, Z=0
|
||||
0003 2008 00027 call up2 ;in W steht der R<>ckgabewert
|
||||
0004 0000 00028 nop ;W = 77h, DC=0, C=0, Z=0;
|
||||
0005 2800 00029 goto loop
|
||||
00030
|
||||
00031 ;UP1 z<>hlt zu W den Wert 25h hinzu und kehrt mit RETURN zur<75>ck
|
||||
0006 3E25 00032 up1 addlw 25h ;W = 36h, DC=0, C=0, Z=0
|
||||
0007 0008 00033 return
|
||||
00034
|
||||
00035 ;UP2 kehrt mit der Konstanten 77h zur<75>ck
|
||||
0008 3477 00036 up2 retlw 77h
|
||||
00037
|
||||
00038 ende
|
||||
0009 2809 00039 goto ende ;Endlosschleife, verhindert Nirwana
|
||||
00040
|
||||
00041
|
||||
|
@@ -1,64 +1,64 @@
|
||||
00001 ;TPicSim3
|
||||
00002 ;Programm zum Test des 16F84-Simulators.
|
||||
00003 ;Es werden die Byte-orientieren File-Register Befehle gepr<70>ft
|
||||
00004 ;aber kein DECFSZ, INCFSZ, RLF, RRF
|
||||
00005 ;(c) St. Lehmann
|
||||
00006 ;Ersterstellung: 23.03.2016
|
||||
00007
|
||||
00008 ;Hinweis:
|
||||
00009 ;Bei diesen Befehlen entscheidet das d-Bit (Destination), ob das Ergebnis
|
||||
00010 ;dieser Operation ins W- oder File-Register geschrieben wird. Wird im
|
||||
00011 ;Assemblercode der Befehl mit ",W" geschrieben, bedeutet dies, dass das
|
||||
00012 ;d-Bit 0 ist und das Ergebnis ins W-Register kommt. Fehlt ",W" ist das
|
||||
00013 ;d-Bit 1 und das Ergebnis wird ins Fileregister geschrieben.
|
||||
00014 ;
|
||||
00015 ;Alle Befehle die eine Fileregister-Adresse haben, k<>nnen auch "indirekt"
|
||||
00016 ;adressieren. Dies ist im Testfile TPicSim6.LST beschrieben.
|
||||
00017 ;
|
||||
00018 list c=132 ;Zeilenl<6E>nge im LST auf 132 Zeichen setzen
|
||||
00019
|
||||
00020 ;Definition einiger Symbole
|
||||
00021 ;zuerst Hardware-Register
|
||||
00022 status equ 03h
|
||||
00023 ra equ 05h
|
||||
00024 rb equ 06h
|
||||
00025
|
||||
00026 ;f<>r den Benutzer frei verwendbare Register
|
||||
00027 wert1 equ 0ch ;Variable Nr.1
|
||||
00028 wert2 equ 0dh ;Variable Nr.2
|
||||
00029 ergeb equ 0eh ;Variable Nr.3
|
||||
00030
|
||||
00031 ;Definition des Prozessors
|
||||
00032 device 16F84
|
||||
00033
|
||||
00034 ;Festlegen des Codebeginns
|
||||
00035 org 0
|
||||
00036 loop
|
||||
0000 3011 00037 movlw 11h ;in W steht nun 11h, DC=?, C=?, Z=?
|
||||
0001 008C 00038 movwf wert1 ;diesen Wert abspeichern, DC=?, C=?, Z=?
|
||||
0002 3014 00039 movlw 14h ;W = 14h, DC=?, C=?, Z=?
|
||||
0003 070C 00040 addwf wert1,w ;W = 25h, DC=0, C=0, Z=0
|
||||
0004 078C 00041 addwf wert1 ;W = 25h, wert1 = 36h, DC=0, C=0, Z=0
|
||||
0005 050C 00042 andwf wert1,w ;W = 24h, wert1 = 36h, DC=0, C=0, Z=0
|
||||
0006 008D 00043 movwf wert2 ;W=24h, wert1=36, wert2=24h
|
||||
0007 018C 00044 clrf wert1 ;W=24h, wert1=0, wert2=24h, DC=0, C=0, Z=1
|
||||
0008 090D 00045 comf wert2,w ;W=DBh, wert1=0, wert2=24h, DC=0, C=0, Z=0
|
||||
0009 030C 00046 decf wert1,w ;W=FFh, wert1=0, wert2=24h, DC=0, C=0, Z=0
|
||||
000A 0A8D 00047 incf wert2 ;W=FFh, wert1=0, wert2=25h, DC=0, C=0, Z=0
|
||||
000B 088C 00048 movf wert1 ;W=FFh, wert1=0, wert2=25h, DC=0, C=0, Z=1
|
||||
000C 048C 00049 iorwf wert1 ;W=FFh, wert1=FFh, wert2=25h, DC=0, C=0, Z=0
|
||||
000D 020D 00050 subwf wert2,w ;W=26h, wert1=FFh, wert2=25h, DC=0, C=0, Z=0
|
||||
000E 0E8D 00051 swapf wert2 ;W=26h, wert1=FFh, wert2=52h, DC=0, C=0, Z=0
|
||||
000F 068C 00052 xorwf wert1 ;W=26h, wert1=D9h, wert2=52h, DC=0, C=0, Z=0
|
||||
0010 0100 00053 clrw ;W=00h, wert1=D9h, wert2=52h, DC=0, C=0, Z=1
|
||||
00054
|
||||
0011 020C 00055 subwf wert1,w ;W=D9h, wert1=D9h, wert2=52h, DC=1, C=1, Z=0
|
||||
0012 020D 00056 subwf wert2,w ;W=79h, wert1=D9h, wert2=52h, DC=0, C=0, Z=0
|
||||
0013 028D 00057 subwf wert2 ;W=79h, wert1=D9h, wert2=D9h, DC=0, C=0, Z=0
|
||||
0014 028D 00058 subwf wert2 ;W=79h, wert1=D9h, wert2=60h, DC=1, C=1, Z=0
|
||||
00059
|
||||
00060
|
||||
00061 ende
|
||||
0015 2815 00062 goto ende ;Endlosschleife, verhindert Nirwana
|
||||
00063
|
||||
00064
|
||||
00001 ;TPicSim3
|
||||
00002 ;Programm zum Test des 16F84-Simulators.
|
||||
00003 ;Es werden die Byte-orientieren File-Register Befehle gepr<70>ft
|
||||
00004 ;aber kein DECFSZ, INCFSZ, RLF, RRF
|
||||
00005 ;(c) St. Lehmann
|
||||
00006 ;Ersterstellung: 23.03.2016
|
||||
00007
|
||||
00008 ;Hinweis:
|
||||
00009 ;Bei diesen Befehlen entscheidet das d-Bit (Destination), ob das Ergebnis
|
||||
00010 ;dieser Operation ins W- oder File-Register geschrieben wird. Wird im
|
||||
00011 ;Assemblercode der Befehl mit ",W" geschrieben, bedeutet dies, dass das
|
||||
00012 ;d-Bit 0 ist und das Ergebnis ins W-Register kommt. Fehlt ",W" ist das
|
||||
00013 ;d-Bit 1 und das Ergebnis wird ins Fileregister geschrieben.
|
||||
00014 ;
|
||||
00015 ;Alle Befehle die eine Fileregister-Adresse haben, k<>nnen auch "indirekt"
|
||||
00016 ;adressieren. Dies ist im Testfile TPicSim6.LST beschrieben.
|
||||
00017 ;
|
||||
00018 list c=132 ;Zeilenl<6E>nge im LST auf 132 Zeichen setzen
|
||||
00019
|
||||
00020 ;Definition einiger Symbole
|
||||
00021 ;zuerst Hardware-Register
|
||||
00022 status equ 03h
|
||||
00023 ra equ 05h
|
||||
00024 rb equ 06h
|
||||
00025
|
||||
00026 ;f<>r den Benutzer frei verwendbare Register
|
||||
00027 wert1 equ 0ch ;Variable Nr.1
|
||||
00028 wert2 equ 0dh ;Variable Nr.2
|
||||
00029 ergeb equ 0eh ;Variable Nr.3
|
||||
00030
|
||||
00031 ;Definition des Prozessors
|
||||
00032 device 16F84
|
||||
00033
|
||||
00034 ;Festlegen des Codebeginns
|
||||
00035 org 0
|
||||
00036 loop
|
||||
0000 3011 00037 movlw 11h ;in W steht nun 11h, DC=?, C=?, Z=?
|
||||
0001 008C 00038 movwf wert1 ;diesen Wert abspeichern, DC=?, C=?, Z=?
|
||||
0002 3014 00039 movlw 14h ;W = 14h, DC=?, C=?, Z=?
|
||||
0003 070C 00040 addwf wert1,w ;W = 25h, DC=0, C=0, Z=0
|
||||
0004 078C 00041 addwf wert1 ;W = 25h, wert1 = 36h, DC=0, C=0, Z=0
|
||||
0005 050C 00042 andwf wert1,w ;W = 24h, wert1 = 36h, DC=0, C=0, Z=0
|
||||
0006 008D 00043 movwf wert2 ;W=24h, wert1=36, wert2=24h
|
||||
0007 018C 00044 clrf wert1 ;W=24h, wert1=0, wert2=24h, DC=0, C=0, Z=1
|
||||
0008 090D 00045 comf wert2,w ;W=DBh, wert1=0, wert2=24h, DC=0, C=0, Z=0
|
||||
0009 030C 00046 decf wert1,w ;W=FFh, wert1=0, wert2=24h, DC=0, C=0, Z=0
|
||||
000A 0A8D 00047 incf wert2 ;W=FFh, wert1=0, wert2=25h, DC=0, C=0, Z=0
|
||||
000B 088C 00048 movf wert1 ;W=FFh, wert1=0, wert2=25h, DC=0, C=0, Z=1
|
||||
000C 048C 00049 iorwf wert1 ;W=FFh, wert1=FFh, wert2=25h, DC=0, C=0, Z=0
|
||||
000D 020D 00050 subwf wert2,w ;W=26h, wert1=FFh, wert2=25h, DC=0, C=0, Z=0
|
||||
000E 0E8D 00051 swapf wert2 ;W=26h, wert1=FFh, wert2=52h, DC=0, C=0, Z=0
|
||||
000F 068C 00052 xorwf wert1 ;W=26h, wert1=D9h, wert2=52h, DC=0, C=0, Z=0
|
||||
0010 0100 00053 clrw ;W=00h, wert1=D9h, wert2=52h, DC=0, C=0, Z=1
|
||||
00054
|
||||
0011 020C 00055 subwf wert1,w ;W=D9h, wert1=D9h, wert2=52h, DC=1, C=1, Z=0
|
||||
0012 020D 00056 subwf wert2,w ;W=79h, wert1=D9h, wert2=52h, DC=0, C=0, Z=0
|
||||
0013 028D 00057 subwf wert2 ;W=79h, wert1=D9h, wert2=D9h, DC=0, C=0, Z=0
|
||||
0014 028D 00058 subwf wert2 ;W=79h, wert1=D9h, wert2=60h, DC=1, C=1, Z=0
|
||||
00059
|
||||
00060
|
||||
00061 ende
|
||||
0015 2815 00062 goto ende ;Endlosschleife, verhindert Nirwana
|
||||
00063
|
||||
00064
|
||||
|
@@ -1,80 +1,80 @@
|
||||
00001 ;TPicSim4
|
||||
00002 ;Programm zum Test des 16F84-Simulators.
|
||||
00003 ;Es werden die Befehle DECFSZ, INCFSZ, RLF, RRF gepr<70>ft
|
||||
00004 ;(c) St. Lehmann
|
||||
00005 ;Ersterstellung: 23.03.2016
|
||||
00006 ;
|
||||
00007 list c=132 ;Zeilenl<6E>nge im LST auf 132 Zeichen setzen
|
||||
00008
|
||||
00009 ;Definition einiger Symbole
|
||||
00010 ;zuerst Hardware-Register
|
||||
00011 status equ 03h
|
||||
00012 ra equ 05h
|
||||
00013 rb equ 06h
|
||||
00014
|
||||
00015 ;f<>r den Benutzer frei verwendbare Register
|
||||
00016 wert1 equ 0ch ;Variable Nr.1
|
||||
00017 wert2 equ 0dh ;Variable Nr.2
|
||||
00018 ergeb equ 0eh ;Variable Nr.3
|
||||
00019
|
||||
00020 ;Definition des Prozessors
|
||||
00021 device 16F84
|
||||
00022
|
||||
00023 ;Festlegen des Codebeginns
|
||||
00024 org 0
|
||||
00025 loop
|
||||
0000 3011 00026 movlw 11h ;in W steht nun 11h, DC=?, C=?, Z=?
|
||||
0001 008C 00027 movwf wert1 ;diesen Wert abspeichern, DC=?, C=?, Z=?
|
||||
0002 3E11 00028 addlw 11h ;l<>scht u.a. das Carry-Flag, DC=0, C=0, Z=0
|
||||
0003 0D8C 00029 rlf wert1 ;W=22h, wert1=22h, wert2=?? , DC=0, C=0, Z=0
|
||||
0004 0D8C 00030 rlf wert1 ;W=22h, wert1=44h, wert2=?? , DC=0, C=0, Z=0
|
||||
0005 0D8C 00031 rlf wert1 ;W=22h, wert1=88h, wert2=?? , DC=0, C=0, Z=0
|
||||
0006 0D0C 00032 rlf wert1,w ;W=10h, wert1=88h, wert2=?? , DC=0, C=1, Z=0
|
||||
0007 0D8C 00033 rlf wert1 ;W=10h, wert1=11h, wert2=?? , DC=0, C=1, Z=0
|
||||
0008 0D0C 00034 rlf wert1,w ;W=23h, wert1=11h, wert2=?? , DC=0, C=0, Z=0
|
||||
0009 0C8C 00035 rrf wert1 ;W=23h, wert1=08h, wert2=?? , DC=0, C=0, Z=0
|
||||
000A 008D 00036 movwf wert2 ;W=23h, wert1=08h, wert2=23h, DC=0, C=0, Z=0
|
||||
000B 0C8D 00037 rrf wert2 ;W=23h, wert1=08h, wert2=91h, DC=0, C=1, Z=0
|
||||
000C 0C0D 00038 rrf wert2,w ;W=C8h, wert1=08h, wert2=91h, DC=0, C=1, Z=0
|
||||
00039
|
||||
000D 3009 00040 movlw 9 ;W=09h, wert1=08h, wert2=10h, DC=0, C=1, Z=0
|
||||
000E 008C 00041 movwf wert1 ;W=09h, wert1=09h, wert2=10h, DC=0, C=1, Z=0
|
||||
000F 0100 00042 clrw ;W=00h, wert1=09h, wert2=10h, DC=0, C=1, Z=1
|
||||
00043 loop1
|
||||
0010 3E01 00044 addlw 1 ;W=01h, DC=0, C=0, Z=0
|
||||
00045 ;W=02h, DC=0, C=0, Z=0
|
||||
00046 ;W=03h, DC=0, C=0, Z=0
|
||||
00047 ;W=04h, DC=0, C=0, Z=0
|
||||
00048 ;W=05h, DC=0, C=0, Z=0
|
||||
00049 ;W=06h, DC=0, C=0, Z=0
|
||||
00050 ;W=07h, DC=0, C=0, Z=0
|
||||
00051 ;W=08h, DC=0, C=0, Z=0
|
||||
00052 ;W=09h, DC=0, C=0, Z=0
|
||||
0011 078D 00053 addwf wert2 ;wert2=92h, DC=0, C=0, Z=0
|
||||
00054 ;wert2=94h, DC=0, C=0, Z=0
|
||||
00055 ;wert2=97h, DC=0, C=0, Z=0
|
||||
00056 ;wert2=9Bh, DC=0, C=0, Z=0
|
||||
00057 ;wert2=A0h, DC=0, C=1, Z=0
|
||||
00058 ;wert2=A6h, DC=0, C=0, Z=0
|
||||
00059 ;wert2=ADh, DC=0, C=0, Z=0
|
||||
00060 ;wert2=B5h, DC=0, C=1, Z=0
|
||||
00061 ;wert2=BEh, DC=0, C=0, Z=0
|
||||
0012 0B8C 00062 decfsz wert1 ;wert1=08h, wert1=07h, ... DC,C und Z bleiben unver<65>ndert
|
||||
0013 2810 00063 goto loop1
|
||||
00064
|
||||
0014 30F0 00065 movlw 0f0h ;Wert wird bis 00h (<28>ber FFh) hochgez<65>hlt
|
||||
0015 008C 00066 movwf wert1
|
||||
0016 018D 00067 clrf wert2
|
||||
0017 0100 00068 clrw
|
||||
00069 loop2
|
||||
0018 070C 00070 addwf wert1,w ;W=F0h, DC=0, C=0, Z=0
|
||||
00071
|
||||
00072
|
||||
0019 0A8D 00073 incf wert2 ;wert2=F1h, DC=
|
||||
001A 0F8C 00074 incfsz wert1
|
||||
001B 2818 00075 goto loop2
|
||||
00076
|
||||
00077 ende
|
||||
001C 281C 00078 goto ende ;Endlosschleife, verhindert Nirwana
|
||||
00079
|
||||
00080
|
||||
00001 ;TPicSim4
|
||||
00002 ;Programm zum Test des 16F84-Simulators.
|
||||
00003 ;Es werden die Befehle DECFSZ, INCFSZ, RLF, RRF gepr<70>ft
|
||||
00004 ;(c) St. Lehmann
|
||||
00005 ;Ersterstellung: 23.03.2016
|
||||
00006 ;
|
||||
00007 list c=132 ;Zeilenl<6E>nge im LST auf 132 Zeichen setzen
|
||||
00008
|
||||
00009 ;Definition einiger Symbole
|
||||
00010 ;zuerst Hardware-Register
|
||||
00011 status equ 03h
|
||||
00012 ra equ 05h
|
||||
00013 rb equ 06h
|
||||
00014
|
||||
00015 ;f<>r den Benutzer frei verwendbare Register
|
||||
00016 wert1 equ 0ch ;Variable Nr.1
|
||||
00017 wert2 equ 0dh ;Variable Nr.2
|
||||
00018 ergeb equ 0eh ;Variable Nr.3
|
||||
00019
|
||||
00020 ;Definition des Prozessors
|
||||
00021 device 16F84
|
||||
00022
|
||||
00023 ;Festlegen des Codebeginns
|
||||
00024 org 0
|
||||
00025 loop
|
||||
0000 3011 00026 movlw 11h ;in W steht nun 11h, DC=?, C=?, Z=?
|
||||
0001 008C 00027 movwf wert1 ;diesen Wert abspeichern, DC=?, C=?, Z=?
|
||||
0002 3E11 00028 addlw 11h ;l<>scht u.a. das Carry-Flag, DC=0, C=0, Z=0
|
||||
0003 0D8C 00029 rlf wert1 ;W=22h, wert1=22h, wert2=?? , DC=0, C=0, Z=0
|
||||
0004 0D8C 00030 rlf wert1 ;W=22h, wert1=44h, wert2=?? , DC=0, C=0, Z=0
|
||||
0005 0D8C 00031 rlf wert1 ;W=22h, wert1=88h, wert2=?? , DC=0, C=0, Z=0
|
||||
0006 0D0C 00032 rlf wert1,w ;W=10h, wert1=88h, wert2=?? , DC=0, C=1, Z=0
|
||||
0007 0D8C 00033 rlf wert1 ;W=10h, wert1=11h, wert2=?? , DC=0, C=1, Z=0
|
||||
0008 0D0C 00034 rlf wert1,w ;W=23h, wert1=11h, wert2=?? , DC=0, C=0, Z=0
|
||||
0009 0C8C 00035 rrf wert1 ;W=23h, wert1=08h, wert2=?? , DC=0, C=0, Z=0
|
||||
000A 008D 00036 movwf wert2 ;W=23h, wert1=08h, wert2=23h, DC=0, C=0, Z=0
|
||||
000B 0C8D 00037 rrf wert2 ;W=23h, wert1=08h, wert2=91h, DC=0, C=1, Z=0
|
||||
000C 0C0D 00038 rrf wert2,w ;W=C8h, wert1=08h, wert2=91h, DC=0, C=1, Z=0
|
||||
00039
|
||||
000D 3009 00040 movlw 9 ;W=09h, wert1=08h, wert2=10h, DC=0, C=1, Z=0
|
||||
000E 008C 00041 movwf wert1 ;W=09h, wert1=09h, wert2=10h, DC=0, C=1, Z=0
|
||||
000F 0100 00042 clrw ;W=00h, wert1=09h, wert2=10h, DC=0, C=1, Z=1
|
||||
00043 loop1
|
||||
0010 3E01 00044 addlw 1 ;W=01h, DC=0, C=0, Z=0
|
||||
00045 ;W=02h, DC=0, C=0, Z=0
|
||||
00046 ;W=03h, DC=0, C=0, Z=0
|
||||
00047 ;W=04h, DC=0, C=0, Z=0
|
||||
00048 ;W=05h, DC=0, C=0, Z=0
|
||||
00049 ;W=06h, DC=0, C=0, Z=0
|
||||
00050 ;W=07h, DC=0, C=0, Z=0
|
||||
00051 ;W=08h, DC=0, C=0, Z=0
|
||||
00052 ;W=09h, DC=0, C=0, Z=0
|
||||
0011 078D 00053 addwf wert2 ;wert2=92h, DC=0, C=0, Z=0
|
||||
00054 ;wert2=94h, DC=0, C=0, Z=0
|
||||
00055 ;wert2=97h, DC=0, C=0, Z=0
|
||||
00056 ;wert2=9Bh, DC=0, C=0, Z=0
|
||||
00057 ;wert2=A0h, DC=0, C=1, Z=0
|
||||
00058 ;wert2=A6h, DC=0, C=0, Z=0
|
||||
00059 ;wert2=ADh, DC=0, C=0, Z=0
|
||||
00060 ;wert2=B5h, DC=0, C=1, Z=0
|
||||
00061 ;wert2=BEh, DC=0, C=0, Z=0
|
||||
0012 0B8C 00062 decfsz wert1 ;wert1=08h, wert1=07h, ... DC,C und Z bleiben unver<65>ndert
|
||||
0013 2810 00063 goto loop1
|
||||
00064
|
||||
0014 30F0 00065 movlw 0f0h ;Wert wird bis 00h (<28>ber FFh) hochgez<65>hlt
|
||||
0015 008C 00066 movwf wert1
|
||||
0016 018D 00067 clrf wert2
|
||||
0017 0100 00068 clrw
|
||||
00069 loop2
|
||||
0018 070C 00070 addwf wert1,w ;W=F0h, DC=0, C=0, Z=0
|
||||
00071
|
||||
00072
|
||||
0019 0A8D 00073 incf wert2 ;wert2=F1h, DC=
|
||||
001A 0F8C 00074 incfsz wert1
|
||||
001B 2818 00075 goto loop2
|
||||
00076
|
||||
00077 ende
|
||||
001C 281C 00078 goto ende ;Endlosschleife, verhindert Nirwana
|
||||
00079
|
||||
00080
|
||||
|
@@ -1,50 +1,50 @@
|
||||
00001 ;TPicSim5
|
||||
00002 ;Programm zum Test des 16F84-Simulators.
|
||||
00003 ;Es werden die Befehle BCF, BSF, BTFSC und BTFSS gepr<70>ft
|
||||
00004 ;(c) St. Lehmann
|
||||
00005 ;Ersterstellung: 23.03.2016
|
||||
00006 ;
|
||||
00007 list c=132 ;Zeilenl<6E>nge im LST auf 132 Zeichen setzen
|
||||
00008
|
||||
00009 ;Definition einiger Symbole
|
||||
00010 ;zuerst Hardware-Register
|
||||
00011 status equ 03h
|
||||
00012 ra equ 05h
|
||||
00013 rb equ 06h
|
||||
00014
|
||||
00015 ;f<>r den Benutzer frei verwendbare Register
|
||||
00016 wert1 equ 0ch ;Variable Nr.1
|
||||
00017 wert2 equ 0dh ;Variable Nr.2
|
||||
00018 ergeb equ 0eh ;Variable Nr.3
|
||||
00019
|
||||
00020 ;Definition des Prozessors
|
||||
00021 device 16F84
|
||||
00022
|
||||
00023 ;Festlegen des Codebeginns
|
||||
00024 org 0
|
||||
00025 loop
|
||||
0000 3011 00026 movlw 11h ;in W steht nun 11h, DC=?, C=?, Z=?
|
||||
0001 008C 00027 movwf wert1 ;diesen Wert abspeichern, DC=?, C=?, Z=?
|
||||
0002 018D 00028 clrf wert2 ;W=11h, wert1=11h, wert2=00h, DC=?, C=?, Z=1
|
||||
0003 178C 00029 bsf wert1,7 ;W=11h, wert1=91h, wert2=00h, DC=?, C=?, Z=1
|
||||
0004 158C 00030 bsf wert1,3 ;W=11h, wert1=99h, wert2=00h, DC=?, C=?, Z=1
|
||||
0005 120C 00031 bcf wert1,4 ;W=11h, wert1=89h, wert2=00h, DC=?, C=?, Z=1
|
||||
0006 100C 00032 bcf wert1,0 ;W=11h, wert1=88h, wert2=00h, DC=?, C=?, Z=1
|
||||
00033
|
||||
0007 180C 00034 btfsc wert1,0
|
||||
0008 0A8D 00035 incf wert2
|
||||
0009 0A8D 00036 incf wert2
|
||||
000A 198C 00037 btfsc wert1,3
|
||||
000B 0A8D 00038 incf wert2
|
||||
000C 0A8D 00039 incf wert2
|
||||
000D 1D0C 00040 btfss wert1,2
|
||||
000E 0A8D 00041 incf wert2
|
||||
000F 0A8D 00042 incf wert2
|
||||
0010 1F8C 00043 btfss wert1,7
|
||||
0011 0A8D 00044 incf wert2
|
||||
0012 038D 00045 decf wert2 ;in wert2 muss 04h stehen
|
||||
00046
|
||||
00047 ende
|
||||
0013 2813 00048 goto ende ;Endlosschleife, verhindert Nirwana
|
||||
00049
|
||||
00050
|
||||
00001 ;TPicSim5
|
||||
00002 ;Programm zum Test des 16F84-Simulators.
|
||||
00003 ;Es werden die Befehle BCF, BSF, BTFSC und BTFSS gepr<70>ft
|
||||
00004 ;(c) St. Lehmann
|
||||
00005 ;Ersterstellung: 23.03.2016
|
||||
00006 ;
|
||||
00007 list c=132 ;Zeilenl<6E>nge im LST auf 132 Zeichen setzen
|
||||
00008
|
||||
00009 ;Definition einiger Symbole
|
||||
00010 ;zuerst Hardware-Register
|
||||
00011 status equ 03h
|
||||
00012 ra equ 05h
|
||||
00013 rb equ 06h
|
||||
00014
|
||||
00015 ;f<>r den Benutzer frei verwendbare Register
|
||||
00016 wert1 equ 0ch ;Variable Nr.1
|
||||
00017 wert2 equ 0dh ;Variable Nr.2
|
||||
00018 ergeb equ 0eh ;Variable Nr.3
|
||||
00019
|
||||
00020 ;Definition des Prozessors
|
||||
00021 device 16F84
|
||||
00022
|
||||
00023 ;Festlegen des Codebeginns
|
||||
00024 org 0
|
||||
00025 loop
|
||||
0000 3011 00026 movlw 11h ;in W steht nun 11h, DC=?, C=?, Z=?
|
||||
0001 008C 00027 movwf wert1 ;diesen Wert abspeichern, DC=?, C=?, Z=?
|
||||
0002 018D 00028 clrf wert2 ;W=11h, wert1=11h, wert2=00h, DC=?, C=?, Z=1
|
||||
0003 178C 00029 bsf wert1,7 ;W=11h, wert1=91h, wert2=00h, DC=?, C=?, Z=1
|
||||
0004 158C 00030 bsf wert1,3 ;W=11h, wert1=99h, wert2=00h, DC=?, C=?, Z=1
|
||||
0005 120C 00031 bcf wert1,4 ;W=11h, wert1=89h, wert2=00h, DC=?, C=?, Z=1
|
||||
0006 100C 00032 bcf wert1,0 ;W=11h, wert1=88h, wert2=00h, DC=?, C=?, Z=1
|
||||
00033
|
||||
0007 180C 00034 btfsc wert1,0
|
||||
0008 0A8D 00035 incf wert2
|
||||
0009 0A8D 00036 incf wert2
|
||||
000A 198C 00037 btfsc wert1,3
|
||||
000B 0A8D 00038 incf wert2
|
||||
000C 0A8D 00039 incf wert2
|
||||
000D 1D0C 00040 btfss wert1,2
|
||||
000E 0A8D 00041 incf wert2
|
||||
000F 0A8D 00042 incf wert2
|
||||
0010 1F8C 00043 btfss wert1,7
|
||||
0011 0A8D 00044 incf wert2
|
||||
0012 038D 00045 decf wert2 ;in wert2 muss 04h stehen
|
||||
00046
|
||||
00047 ende
|
||||
0013 2813 00048 goto ende ;Endlosschleife, verhindert Nirwana
|
||||
00049
|
||||
00050
|
||||
|
@@ -1,95 +1,95 @@
|
||||
00001 ;TPicSim6
|
||||
00002 ;Programm zum Test des 16F84-Simulators.
|
||||
00003 ;Es werden die Byte-orientieren File-Register-Befehle im
|
||||
00004 ;Zusammenhang mit der indirekten Adressierung gepr<70>ft
|
||||
00005 ;
|
||||
00006 ;(c) St. Lehmann
|
||||
00007 ;Ersterstellung: 23.03.2016
|
||||
00008
|
||||
00009 ;Hinweis:
|
||||
00010 ;Bei der indirekten Adressierung werden die Register "IND" oder auch als
|
||||
00011 ;"indirect addr" bezeichnet und das Register FSR (File Select Register)
|
||||
00012 ;benutzt. Dabei beinhaltet das FSR-Register die Zieladresse in die etwas
|
||||
00013 ;geschrieben oder von der etwas gelesen werden soll. Der eigentliche
|
||||
00014 ;Zugriff erfolgt <20>ber das Ansprechen der Registeradresse 0 (IND). Der PIC
|
||||
00015 ;ersetzt in dem Falle die Adresse 0 durch die Adresse im FSR-Register.
|
||||
00016 ;Da die Adresse im FSR-Register 8-Bit umfasst, die Adresse bei der direkten
|
||||
00017 ;Adressierung jedoch nur 7 Bit, kann man durch die indirekte Adressierung
|
||||
00018 ;auch auf Bank 1 zugreifen ohne das RP0-Bit zu setzen.
|
||||
00019 ;
|
||||
00020 ;Bei diesen Befehlen entscheidet das d-Bit (Destination), ob das Ergebnis
|
||||
00021 ;dieser Operation ins W- oder File-Register geschrieben wird. Wird im
|
||||
00022 ;Assemblercode der Befehl mit ",W" geschrieben, bedeutet dies, dass das
|
||||
00023 ;d-Bit 0 ist und das Ergebnis ins W-Register kommt. Fehlt ",W" ist das
|
||||
00024 ;d-Bit 1 und das Ergebnis wird ins Fileregister geschrieben.
|
||||
00025 ;
|
||||
00026 list c=132 ;Zeilenl<6E>nge im LST auf 132 Zeichen setzen
|
||||
00027
|
||||
00028 ;Definition einiger Symbole
|
||||
00029 ;zuerst Hardware-Register
|
||||
00030 indirect equ 00h
|
||||
00031 status equ 03h
|
||||
00032 fsr equ 04h
|
||||
00033 ra equ 05h
|
||||
00034 rb equ 06h
|
||||
00035
|
||||
00036 ;f<>r den Benutzer frei verwendbare Register
|
||||
00037 wert1 equ 0ch ;Variable Nr.1
|
||||
00038 wert2 equ 0dh ;Variable Nr.2
|
||||
00039 ergeb equ 0eh ;Variable Nr.3
|
||||
00040
|
||||
00041 ;Definition des Prozessors
|
||||
00042 device 16F84
|
||||
00043
|
||||
00044 ;Festlegen des Codebeginns
|
||||
00045 org 0
|
||||
00046 loop
|
||||
0000 3020 00047 movlw 20h ;in W steht nun 20h, DC=?, C=?, Z=?
|
||||
0001 008C 00048 movwf wert1 ;diesen Wert abspeichern, DC=?, C=?, Z=?
|
||||
0002 3010 00049 movlw 10h ;W = 10h, DC=?, C=?, Z=?
|
||||
0003 0084 00050 movwf fsr ;W=10h, FSR=10h, wert1=20h, wert2=?? , DC=?, C=?, Z=?
|
||||
0004 008D 00051 movwf wert2 ;W=10h, FSR=10h, wert1=20h, wert2=10h, DC=?, C=?, Z=?
|
||||
0005 080C 00052 movf wert1,w ;W=20h
|
||||
00053 ;der Speicherbereich von 10h bis 1Fh wird mit Zahlen 20h, 21h, etc. gef<65>llt
|
||||
00054 loop1
|
||||
0006 0080 00055 movwf indirect ;W=20h, FSR=10h, F10=20h
|
||||
0007 3E01 00056 addlw 1 ;W=20h, 21h, 22h, etc
|
||||
0008 0A84 00057 incf fsr ;FSR=11h, 12h, etc
|
||||
0009 0B8D 00058 decfsz wert2
|
||||
000A 2806 00059 goto loop1
|
||||
00060
|
||||
000B 301F 00061 movlw 1fh ;FSR-Zeiger wieder auf Anfang stellen
|
||||
000C 0084 00062 movwf fsr
|
||||
000D 30F0 00063 movlw 0f0h
|
||||
000E 008D 00064 movwf wert2
|
||||
000F 0100 00065 clrw
|
||||
00066 loop2
|
||||
0010 0700 00067 addwf indirect,w
|
||||
0011 0384 00068 decf fsr
|
||||
0012 0F8D 00069 incfsz wert2
|
||||
0013 2810 00070 goto loop2
|
||||
00071 ;im W-Register muss 78h stehen
|
||||
0014 008D 00072 movwf wert2
|
||||
0015 0A84 00073 incf fsr
|
||||
0016 0C80 00074 rrf indirect ;F10=10h
|
||||
0017 0A80 00075 incf indirect ;F10=11h
|
||||
0018 0C80 00076 rrf indirect ;F10=08h, C=1
|
||||
0019 1780 00077 bsf indirect,7 ;F10=88h
|
||||
001A 1003 00078 bcf status,0 ;C=0
|
||||
001B 0D80 00079 rlf indirect ;F10=10h, C=1
|
||||
001C 0A84 00080 incf fsr ;fsr=11h
|
||||
001D 0D80 00081 rlf indirect ;F11=43h, C=0
|
||||
001E 0E80 00082 swapf indirect ;F11=34h
|
||||
001F 0680 00083 xorwf indirect ;F11=4Ch
|
||||
0020 1A80 00084 btfsc indirect,5
|
||||
0021 2800 00085 goto loop
|
||||
0022 1D00 00086 btfss indirect,2
|
||||
0023 2800 00087 goto loop
|
||||
0024 1980 00088 btfsc indirect,3
|
||||
0025 2827 00089 goto ende
|
||||
0026 2800 00090 goto loop
|
||||
00091
|
||||
00092 ende
|
||||
0027 2827 00093 goto ende ;Endlosschleife, verhindert Nirwana
|
||||
00094
|
||||
00095
|
||||
00001 ;TPicSim6
|
||||
00002 ;Programm zum Test des 16F84-Simulators.
|
||||
00003 ;Es werden die Byte-orientieren File-Register-Befehle im
|
||||
00004 ;Zusammenhang mit der indirekten Adressierung gepr<70>ft
|
||||
00005 ;
|
||||
00006 ;(c) St. Lehmann
|
||||
00007 ;Ersterstellung: 23.03.2016
|
||||
00008
|
||||
00009 ;Hinweis:
|
||||
00010 ;Bei der indirekten Adressierung werden die Register "IND" oder auch als
|
||||
00011 ;"indirect addr" bezeichnet und das Register FSR (File Select Register)
|
||||
00012 ;benutzt. Dabei beinhaltet das FSR-Register die Zieladresse in die etwas
|
||||
00013 ;geschrieben oder von der etwas gelesen werden soll. Der eigentliche
|
||||
00014 ;Zugriff erfolgt <20>ber das Ansprechen der Registeradresse 0 (IND). Der PIC
|
||||
00015 ;ersetzt in dem Falle die Adresse 0 durch die Adresse im FSR-Register.
|
||||
00016 ;Da die Adresse im FSR-Register 8-Bit umfasst, die Adresse bei der direkten
|
||||
00017 ;Adressierung jedoch nur 7 Bit, kann man durch die indirekte Adressierung
|
||||
00018 ;auch auf Bank 1 zugreifen ohne das RP0-Bit zu setzen.
|
||||
00019 ;
|
||||
00020 ;Bei diesen Befehlen entscheidet das d-Bit (Destination), ob das Ergebnis
|
||||
00021 ;dieser Operation ins W- oder File-Register geschrieben wird. Wird im
|
||||
00022 ;Assemblercode der Befehl mit ",W" geschrieben, bedeutet dies, dass das
|
||||
00023 ;d-Bit 0 ist und das Ergebnis ins W-Register kommt. Fehlt ",W" ist das
|
||||
00024 ;d-Bit 1 und das Ergebnis wird ins Fileregister geschrieben.
|
||||
00025 ;
|
||||
00026 list c=132 ;Zeilenl<6E>nge im LST auf 132 Zeichen setzen
|
||||
00027
|
||||
00028 ;Definition einiger Symbole
|
||||
00029 ;zuerst Hardware-Register
|
||||
00030 indirect equ 00h
|
||||
00031 status equ 03h
|
||||
00032 fsr equ 04h
|
||||
00033 ra equ 05h
|
||||
00034 rb equ 06h
|
||||
00035
|
||||
00036 ;f<>r den Benutzer frei verwendbare Register
|
||||
00037 wert1 equ 0ch ;Variable Nr.1
|
||||
00038 wert2 equ 0dh ;Variable Nr.2
|
||||
00039 ergeb equ 0eh ;Variable Nr.3
|
||||
00040
|
||||
00041 ;Definition des Prozessors
|
||||
00042 device 16F84
|
||||
00043
|
||||
00044 ;Festlegen des Codebeginns
|
||||
00045 org 0
|
||||
00046 loop
|
||||
0000 3020 00047 movlw 20h ;in W steht nun 20h, DC=?, C=?, Z=?
|
||||
0001 008C 00048 movwf wert1 ;diesen Wert abspeichern, DC=?, C=?, Z=?
|
||||
0002 3010 00049 movlw 10h ;W = 10h, DC=?, C=?, Z=?
|
||||
0003 0084 00050 movwf fsr ;W=10h, FSR=10h, wert1=20h, wert2=?? , DC=?, C=?, Z=?
|
||||
0004 008D 00051 movwf wert2 ;W=10h, FSR=10h, wert1=20h, wert2=10h, DC=?, C=?, Z=?
|
||||
0005 080C 00052 movf wert1,w ;W=20h
|
||||
00053 ;der Speicherbereich von 10h bis 1Fh wird mit Zahlen 20h, 21h, etc. gef<65>llt
|
||||
00054 loop1
|
||||
0006 0080 00055 movwf indirect ;W=20h, FSR=10h, F10=20h
|
||||
0007 3E01 00056 addlw 1 ;W=20h, 21h, 22h, etc
|
||||
0008 0A84 00057 incf fsr ;FSR=11h, 12h, etc
|
||||
0009 0B8D 00058 decfsz wert2
|
||||
000A 2806 00059 goto loop1
|
||||
00060
|
||||
000B 301F 00061 movlw 1fh ;FSR-Zeiger wieder auf Anfang stellen
|
||||
000C 0084 00062 movwf fsr
|
||||
000D 30F0 00063 movlw 0f0h
|
||||
000E 008D 00064 movwf wert2
|
||||
000F 0100 00065 clrw
|
||||
00066 loop2
|
||||
0010 0700 00067 addwf indirect,w
|
||||
0011 0384 00068 decf fsr
|
||||
0012 0F8D 00069 incfsz wert2
|
||||
0013 2810 00070 goto loop2
|
||||
00071 ;im W-Register muss 78h stehen
|
||||
0014 008D 00072 movwf wert2
|
||||
0015 0A84 00073 incf fsr
|
||||
0016 0C80 00074 rrf indirect ;F10=10h
|
||||
0017 0A80 00075 incf indirect ;F10=11h
|
||||
0018 0C80 00076 rrf indirect ;F10=08h, C=1
|
||||
0019 1780 00077 bsf indirect,7 ;F10=88h
|
||||
001A 1003 00078 bcf status,0 ;C=0
|
||||
001B 0D80 00079 rlf indirect ;F10=10h, C=1
|
||||
001C 0A84 00080 incf fsr ;fsr=11h
|
||||
001D 0D80 00081 rlf indirect ;F11=43h, C=0
|
||||
001E 0E80 00082 swapf indirect ;F11=34h
|
||||
001F 0680 00083 xorwf indirect ;F11=4Ch
|
||||
0020 1A80 00084 btfsc indirect,5
|
||||
0021 2800 00085 goto loop
|
||||
0022 1D00 00086 btfss indirect,2
|
||||
0023 2800 00087 goto loop
|
||||
0024 1980 00088 btfsc indirect,3
|
||||
0025 2827 00089 goto ende
|
||||
0026 2800 00090 goto loop
|
||||
00091
|
||||
00092 ende
|
||||
0027 2827 00093 goto ende ;Endlosschleife, verhindert Nirwana
|
||||
00094
|
||||
00095
|
||||
|
@@ -1,83 +1,83 @@
|
||||
00001 ;TPicSim7
|
||||
00002 ;Programm zum Test des 16F84-Simulators.
|
||||
00003 ;Es wird der Timer0 mit und ohne Vorteiler gepr<70>ft
|
||||
00004 ;(c) St. Lehmann Ersterstellung: 23.01.2003
|
||||
00005 ;19.04.2014 <20>berarbeitet
|
||||
00006
|
||||
00007 list c=132 ;Zeilenl<6E>nge im LST auf 132 Zeichen setzen
|
||||
00008
|
||||
00009 ;Definition einiger Symbole
|
||||
00010 indirect equ 0
|
||||
00011 status equ 03h
|
||||
00012 fsr equ 04h
|
||||
00013 ra equ 05h
|
||||
00014 rb equ 06h
|
||||
00015 count equ 0ch
|
||||
00016
|
||||
00017 ;Definition des Prozessors
|
||||
00018 device 16F84
|
||||
00019 ;Festlegen des Codebeginns
|
||||
00020 org 0
|
||||
00021 start
|
||||
00022 ;zuerst Timer0 intern durch den Befehlstakt erh<72>hen VT = 1:4
|
||||
00023 ;somit wird nach jedem 4. Befehlstakt (Achtung GOTO etc) TMR0 erh<72>ht
|
||||
0000 3001 00024 movlw 00000001B ;Option-Register entsp. initialisieren
|
||||
0001 1683 00025 bsf status,5 ;Bank umschalten
|
||||
0002 0081 00026 movwf 1 ;Option-Register
|
||||
0003 1283 00027 bcf status,5
|
||||
0004 3001 00028 movlw 1 ;Timer 1 auf 1
|
||||
0005 0081 00029 movwf 1
|
||||
0006 0190 00030 clrf 10h ;z<>hler
|
||||
00031 loop1
|
||||
0007 0000 00032 nop
|
||||
0008 0000 00033 nop
|
||||
0009 0000 00034 nop
|
||||
000A 0A90 00035 incf 10h
|
||||
000B 0801 00036 movf 1,w ;lese Timerwert aus
|
||||
000C 1D03 00037 btfss status,2 ;wenn Timer = 0, dann fertig
|
||||
000D 2807 00038 goto loop1
|
||||
00039 ;num muss 80H in 10h stehen
|
||||
00040
|
||||
00041 ;nun mit einem VT = 1:16
|
||||
00042 ;somit wird nach jedem 16. Befehlstakt (Achtung GOTO etc) TMR0 erh<72>ht
|
||||
000E 3003 00043 movlw 00000011B ;Option-Register entsp. initialisieren
|
||||
000F 1683 00044 bsf status,5 ;Bank umschalten
|
||||
0010 0081 00045 movwf 1 ;Option-Register
|
||||
0011 1283 00046 bcf status,5
|
||||
0012 3001 00047 movlw 1 ;Timer 1 auf 1
|
||||
0013 0081 00048 movwf 1
|
||||
0014 0190 00049 clrf 10h ;z<>hler
|
||||
00050 loop2
|
||||
0015 0A90 00051 incf 10h
|
||||
0016 0801 00052 movf 1,w ;lese Timerwert aus
|
||||
0017 1D03 00053 btfss status,2 ;wenn Timer = 0, dann fertig
|
||||
0018 2815 00054 goto loop2
|
||||
00055 ;num muss 31H in 10h stehen
|
||||
00056 ;*****************************************************************
|
||||
00057 ;jetzt wird der Timer0 durch den externen Takt an RA4 hochgez<65>hlt.
|
||||
00058 ;zuerst ohne VT, damit z<>hlt jede fallende Flanke an RA
|
||||
0019 3038 00059 movlw 00111000B ;Option-Register initialisieren
|
||||
001A 1683 00060 bsf status,5
|
||||
001B 0081 00061 movwf 1 ;Wert ins Option-Register
|
||||
001C 1283 00062 bcf status,5
|
||||
001D 0181 00063 clrf 1 ;Timer l<>schen
|
||||
00064 loop3
|
||||
001E 1E01 00065 btfss 1,4 ;bis im Timer0 der Wert 16 erreicht wird
|
||||
001F 281E 00066 goto loop3
|
||||
00067
|
||||
00068 ;jetzt auch mit VT 1:4, damit z<>hlt jede 4. fallende Flanke an RA
|
||||
0020 3031 00069 movlw 00110001B ;Option-Register initialisieren
|
||||
0021 1683 00070 bsf status,5
|
||||
0022 0081 00071 movwf 1 ;Wert ins Option-Register
|
||||
0023 1283 00072 bcf status,5
|
||||
0024 0181 00073 clrf 1 ;Timer l<>schen
|
||||
00074 loop4
|
||||
0025 1D81 00075 btfss 1,3 ;bis im Timer0 der Wert 8 erreicht wird
|
||||
0026 2825 00076 goto loop4
|
||||
00077
|
||||
00078 ;******************************************************************
|
||||
00079
|
||||
00080 ende
|
||||
0027 2827 00081 goto ende ;Endlosschleife, verhindert Nirwana
|
||||
00082
|
||||
00083
|
||||
00001 ;TPicSim7
|
||||
00002 ;Programm zum Test des 16F84-Simulators.
|
||||
00003 ;Es wird der Timer0 mit und ohne Vorteiler gepr<70>ft
|
||||
00004 ;(c) St. Lehmann Ersterstellung: 23.01.2003
|
||||
00005 ;19.04.2014 <20>berarbeitet
|
||||
00006
|
||||
00007 list c=132 ;Zeilenl<6E>nge im LST auf 132 Zeichen setzen
|
||||
00008
|
||||
00009 ;Definition einiger Symbole
|
||||
00010 indirect equ 0
|
||||
00011 status equ 03h
|
||||
00012 fsr equ 04h
|
||||
00013 ra equ 05h
|
||||
00014 rb equ 06h
|
||||
00015 count equ 0ch
|
||||
00016
|
||||
00017 ;Definition des Prozessors
|
||||
00018 device 16F84
|
||||
00019 ;Festlegen des Codebeginns
|
||||
00020 org 0
|
||||
00021 start
|
||||
00022 ;zuerst Timer0 intern durch den Befehlstakt erh<72>hen VT = 1:4
|
||||
00023 ;somit wird nach jedem 4. Befehlstakt (Achtung GOTO etc) TMR0 erh<72>ht
|
||||
0000 3001 00024 movlw 00000001B ;Option-Register entsp. initialisieren
|
||||
0001 1683 00025 bsf status,5 ;Bank umschalten
|
||||
0002 0081 00026 movwf 1 ;Option-Register
|
||||
0003 1283 00027 bcf status,5
|
||||
0004 3001 00028 movlw 1 ;Timer 1 auf 1
|
||||
0005 0081 00029 movwf 1
|
||||
0006 0190 00030 clrf 10h ;z<>hler
|
||||
00031 loop1
|
||||
0007 0000 00032 nop
|
||||
0008 0000 00033 nop
|
||||
0009 0000 00034 nop
|
||||
000A 0A90 00035 incf 10h
|
||||
000B 0801 00036 movf 1,w ;lese Timerwert aus
|
||||
000C 1D03 00037 btfss status,2 ;wenn Timer = 0, dann fertig
|
||||
000D 2807 00038 goto loop1
|
||||
00039 ;num muss 80H in 10h stehen
|
||||
00040
|
||||
00041 ;nun mit einem VT = 1:16
|
||||
00042 ;somit wird nach jedem 16. Befehlstakt (Achtung GOTO etc) TMR0 erh<72>ht
|
||||
000E 3003 00043 movlw 00000011B ;Option-Register entsp. initialisieren
|
||||
000F 1683 00044 bsf status,5 ;Bank umschalten
|
||||
0010 0081 00045 movwf 1 ;Option-Register
|
||||
0011 1283 00046 bcf status,5
|
||||
0012 3001 00047 movlw 1 ;Timer 1 auf 1
|
||||
0013 0081 00048 movwf 1
|
||||
0014 0190 00049 clrf 10h ;z<>hler
|
||||
00050 loop2
|
||||
0015 0A90 00051 incf 10h
|
||||
0016 0801 00052 movf 1,w ;lese Timerwert aus
|
||||
0017 1D03 00053 btfss status,2 ;wenn Timer = 0, dann fertig
|
||||
0018 2815 00054 goto loop2
|
||||
00055 ;num muss 31H in 10h stehen
|
||||
00056 ;*****************************************************************
|
||||
00057 ;jetzt wird der Timer0 durch den externen Takt an RA4 hochgez<65>hlt.
|
||||
00058 ;zuerst ohne VT, damit z<>hlt jede fallende Flanke an RA
|
||||
0019 3038 00059 movlw 00111000B ;Option-Register initialisieren
|
||||
001A 1683 00060 bsf status,5
|
||||
001B 0081 00061 movwf 1 ;Wert ins Option-Register
|
||||
001C 1283 00062 bcf status,5
|
||||
001D 0181 00063 clrf 1 ;Timer l<>schen
|
||||
00064 loop3
|
||||
001E 1E01 00065 btfss 1,4 ;bis im Timer0 der Wert 16 erreicht wird
|
||||
001F 281E 00066 goto loop3
|
||||
00067
|
||||
00068 ;jetzt auch mit VT 1:4, damit z<>hlt jede 4. fallende Flanke an RA
|
||||
0020 3031 00069 movlw 00110001B ;Option-Register initialisieren
|
||||
0021 1683 00070 bsf status,5
|
||||
0022 0081 00071 movwf 1 ;Wert ins Option-Register
|
||||
0023 1283 00072 bcf status,5
|
||||
0024 0181 00073 clrf 1 ;Timer l<>schen
|
||||
00074 loop4
|
||||
0025 1D81 00075 btfss 1,3 ;bis im Timer0 der Wert 8 erreicht wird
|
||||
0026 2825 00076 goto loop4
|
||||
00077
|
||||
00078 ;******************************************************************
|
||||
00079
|
||||
00080 ende
|
||||
0027 2827 00081 goto ende ;Endlosschleife, verhindert Nirwana
|
||||
00082
|
||||
00083
|
||||
|
@@ -1,116 +1,116 @@
|
||||
00001 ;TPicSim8
|
||||
00002 ;Programm zum Test des 16F84-Simulators.
|
||||
00003 ;Es werden die Interrupts f<>r TMR0, RB0 (INT) und RB4-7 gepr<70>ft
|
||||
00004 ;(c) St. Lehmann
|
||||
00005 ;19.04.2014
|
||||
00006
|
||||
00007 list c=132 ;Zeilenl<6E>nge im LST auf 132 Zeichen setzen
|
||||
00008
|
||||
00009 ;Definition einiger Symbole
|
||||
00010 indirect equ 0
|
||||
00011 status equ 03h
|
||||
00012 fsr equ 04h
|
||||
00013 ra equ 05h
|
||||
00014 rb equ 06h
|
||||
00015 intcon equ 0bh
|
||||
00016
|
||||
00017 ;Definition des Prozessors
|
||||
00018 device 16F84
|
||||
00019 ;Festlegen des Codebeginns
|
||||
00020 org 0
|
||||
00021 start
|
||||
0000 281C 00022 goto main
|
||||
0001 0000 00023 nop
|
||||
0002 0000 00024 nop
|
||||
0003 0000 00025 nop
|
||||
00026
|
||||
00027 ;Interrupt-Service-Routine muss an Adresse 4 stehen, deshalb die 3 NOPs
|
||||
00028 ISR
|
||||
0004 1D0B 00029 btfss intcon,2 ;war es ein Timer-Interrupt?
|
||||
0005 280B 00030 goto isr1 ;nein
|
||||
0006 3054 00031 movlw 54h ;ja, 54h = T in 20h schreiben
|
||||
0007 00A0 00032 movwf 20h
|
||||
0008 128B 00033 bcf intcon,5 ;Timer-Interrupt sperren
|
||||
0009 110B 00034 bcf intcon,2 ;Interrupt-Flag zur<75>cksetzen
|
||||
000A 281B 00035 goto isrend
|
||||
00036 ISR1
|
||||
000B 1C8B 00037 btfss intcon,1 ;war es ein RB0-Interrupt?
|
||||
000C 2812 00038 goto isr2 ;nein
|
||||
000D 3049 00039 movlw 'I' ;schreibe ein I an 21h
|
||||
000E 00A1 00040 movwf 21h
|
||||
000F 120B 00041 bcf intcon,4 ;RB0-Interrupt sperren
|
||||
0010 108B 00042 bcf intcon,1 ;RB0-Interrupt-Flag l<>schen
|
||||
0011 281B 00043 goto isrend
|
||||
00044 ISR2
|
||||
0012 1C0B 00045 btfss intcon,0 ;war es ein RB4-7 Interrupt?
|
||||
0013 2819 00046 goto isr3 ;d<>rfte nie passieren
|
||||
0014 3052 00047 movlw 'R' ;schreibe ein R nach 22h
|
||||
0015 00A2 00048 movwf 22h
|
||||
0016 118B 00049 bcf intcon,3 ;keine RB4-7 Interrupts erlauben
|
||||
0017 100B 00050 bcf intcon,0 ;auch das Flag l<>schen
|
||||
0018 281B 00051 goto isrend
|
||||
00052 ISR3
|
||||
0019 3046 00053 movlw 'F' ;Fehlermeldung
|
||||
001A 00A3 00054 movwf 23h
|
||||
00055
|
||||
00056 isrend
|
||||
001B 0009 00057 retfie ;Ende der Inetrrupt-Service-Routine
|
||||
00058
|
||||
00059
|
||||
00060 main:
|
||||
00061 ;Der TMR0 wird vom Befehlstakt incrementiert. beim <20>berlauf wird ein Interrupt ausgel<65>st
|
||||
001C 3001 00062 movlw 00000001B ;Option-Register entsp. initialisieren
|
||||
001D 1683 00063 bsf status,5 ;Bank umschalten
|
||||
001E 0081 00064 movwf 1 ;Option-Register
|
||||
001F 1283 00065 bcf status,5
|
||||
0020 3020 00066 movlw 20h ;nur Timer-Interrupt erlauben
|
||||
0021 008B 00067 movwf intcon
|
||||
0022 178B 00068 bsf intcon,7 ;Globale Freigabe, ab jetzt kann ein Interrupt durchkommen
|
||||
00069 loop1
|
||||
0023 1A8B 00070 btfsc intcon,5 ;fertig, wenn ISR dieses Bit zur<75>cksetzt
|
||||
0024 2823 00071 goto loop1 ;bis Timer <20>berl<72>uft
|
||||
00072
|
||||
00073 ;zuerst die wirksame Flanke f<>r RB0 festlegen (hier die fallende Flanke)
|
||||
0025 300F 00074 movlw 00001111b
|
||||
0026 1683 00075 bsf status,5
|
||||
0027 0081 00076 movwf 1
|
||||
0028 1283 00077 bcf status,5
|
||||
00078 ;nun den RB0-Interrupt freigeben, Rest sperren
|
||||
0029 3010 00079 movlw 10h
|
||||
002A 008B 00080 movwf intcon
|
||||
002B 178B 00081 bsf intcon,7
|
||||
00082 loop2
|
||||
002C 1A0B 00083 btfsc intcon,4
|
||||
002D 282C 00084 goto loop2
|
||||
00085
|
||||
00086 ;Beim RB4-7 Interrupts wird ein Flankenwechsel nur an den Pins die als Eingang arbeiten erkannt
|
||||
002E 3008 00087 movlw 08h ;RB4-7 Interrupt freigeben
|
||||
002F 008B 00088 movwf intcon
|
||||
0030 178B 00089 bsf intcon,7 ;GIE
|
||||
00090 loop3
|
||||
0031 198B 00091 btfsc intcon,3 ;wird in ISR zur<75>ckgesetzt
|
||||
0032 2831 00092 goto loop3
|
||||
00093
|
||||
00094 ;das gleiche nochmals, nur sind RB4-6 Ausg<73>nge und werden deshalb ignoriert
|
||||
0033 308F 00095 movlw 10001111B
|
||||
0034 1683 00096 bsf status,5
|
||||
0035 0086 00097 movwf 6 ;TRIS RB
|
||||
0036 1283 00098 bcf status,5
|
||||
0037 3008 00099 movlw 08h ;RB4-7 Interrupt freigeben
|
||||
0038 008B 00100 movwf intcon ;aber nur RB7 ist aktiv
|
||||
0039 178B 00101 bsf intcon,7 ;GIE
|
||||
00102 loop4
|
||||
003A 198B 00103 btfsc intcon,3 ;wird in ISR zur<75>ckgesetzt
|
||||
003B 283A 00104 goto loop4
|
||||
00105
|
||||
00106
|
||||
00107 ;******************************************************************
|
||||
00108 ;wenn alles richtig, dann
|
||||
00109 ;in 20h steht 54H
|
||||
00110 ;in 21H ein 49H
|
||||
00111 ;in 22H ein 53H
|
||||
00112
|
||||
00113 ende
|
||||
003C 283C 00114 goto ende ;Endlosschleife, verhindert Nirwana
|
||||
00115
|
||||
00116
|
||||
00001 ;TPicSim8
|
||||
00002 ;Programm zum Test des 16F84-Simulators.
|
||||
00003 ;Es werden die Interrupts f<>r TMR0, RB0 (INT) und RB4-7 gepr<70>ft
|
||||
00004 ;(c) St. Lehmann
|
||||
00005 ;19.04.2014
|
||||
00006
|
||||
00007 list c=132 ;Zeilenl<6E>nge im LST auf 132 Zeichen setzen
|
||||
00008
|
||||
00009 ;Definition einiger Symbole
|
||||
00010 indirect equ 0
|
||||
00011 status equ 03h
|
||||
00012 fsr equ 04h
|
||||
00013 ra equ 05h
|
||||
00014 rb equ 06h
|
||||
00015 intcon equ 0bh
|
||||
00016
|
||||
00017 ;Definition des Prozessors
|
||||
00018 device 16F84
|
||||
00019 ;Festlegen des Codebeginns
|
||||
00020 org 0
|
||||
00021 start
|
||||
0000 281C 00022 goto main
|
||||
0001 0000 00023 nop
|
||||
0002 0000 00024 nop
|
||||
0003 0000 00025 nop
|
||||
00026
|
||||
00027 ;Interrupt-Service-Routine muss an Adresse 4 stehen, deshalb die 3 NOPs
|
||||
00028 ISR
|
||||
0004 1D0B 00029 btfss intcon,2 ;war es ein Timer-Interrupt?
|
||||
0005 280B 00030 goto isr1 ;nein
|
||||
0006 3054 00031 movlw 54h ;ja, 54h = T in 20h schreiben
|
||||
0007 00A0 00032 movwf 20h
|
||||
0008 128B 00033 bcf intcon,5 ;Timer-Interrupt sperren
|
||||
0009 110B 00034 bcf intcon,2 ;Interrupt-Flag zur<75>cksetzen
|
||||
000A 281B 00035 goto isrend
|
||||
00036 ISR1
|
||||
000B 1C8B 00037 btfss intcon,1 ;war es ein RB0-Interrupt?
|
||||
000C 2812 00038 goto isr2 ;nein
|
||||
000D 3049 00039 movlw 'I' ;schreibe ein I an 21h
|
||||
000E 00A1 00040 movwf 21h
|
||||
000F 120B 00041 bcf intcon,4 ;RB0-Interrupt sperren
|
||||
0010 108B 00042 bcf intcon,1 ;RB0-Interrupt-Flag l<>schen
|
||||
0011 281B 00043 goto isrend
|
||||
00044 ISR2
|
||||
0012 1C0B 00045 btfss intcon,0 ;war es ein RB4-7 Interrupt?
|
||||
0013 2819 00046 goto isr3 ;d<>rfte nie passieren
|
||||
0014 3052 00047 movlw 'R' ;schreibe ein R nach 22h
|
||||
0015 00A2 00048 movwf 22h
|
||||
0016 118B 00049 bcf intcon,3 ;keine RB4-7 Interrupts erlauben
|
||||
0017 100B 00050 bcf intcon,0 ;auch das Flag l<>schen
|
||||
0018 281B 00051 goto isrend
|
||||
00052 ISR3
|
||||
0019 3046 00053 movlw 'F' ;Fehlermeldung
|
||||
001A 00A3 00054 movwf 23h
|
||||
00055
|
||||
00056 isrend
|
||||
001B 0009 00057 retfie ;Ende der Inetrrupt-Service-Routine
|
||||
00058
|
||||
00059
|
||||
00060 main:
|
||||
00061 ;Der TMR0 wird vom Befehlstakt incrementiert. beim <20>berlauf wird ein Interrupt ausgel<65>st
|
||||
001C 3001 00062 movlw 00000001B ;Option-Register entsp. initialisieren
|
||||
001D 1683 00063 bsf status,5 ;Bank umschalten
|
||||
001E 0081 00064 movwf 1 ;Option-Register
|
||||
001F 1283 00065 bcf status,5
|
||||
0020 3020 00066 movlw 20h ;nur Timer-Interrupt erlauben
|
||||
0021 008B 00067 movwf intcon
|
||||
0022 178B 00068 bsf intcon,7 ;Globale Freigabe, ab jetzt kann ein Interrupt durchkommen
|
||||
00069 loop1
|
||||
0023 1A8B 00070 btfsc intcon,5 ;fertig, wenn ISR dieses Bit zur<75>cksetzt
|
||||
0024 2823 00071 goto loop1 ;bis Timer <20>berl<72>uft
|
||||
00072
|
||||
00073 ;zuerst die wirksame Flanke f<>r RB0 festlegen (hier die fallende Flanke)
|
||||
0025 300F 00074 movlw 00001111b
|
||||
0026 1683 00075 bsf status,5
|
||||
0027 0081 00076 movwf 1
|
||||
0028 1283 00077 bcf status,5
|
||||
00078 ;nun den RB0-Interrupt freigeben, Rest sperren
|
||||
0029 3010 00079 movlw 10h
|
||||
002A 008B 00080 movwf intcon
|
||||
002B 178B 00081 bsf intcon,7
|
||||
00082 loop2
|
||||
002C 1A0B 00083 btfsc intcon,4
|
||||
002D 282C 00084 goto loop2
|
||||
00085
|
||||
00086 ;Beim RB4-7 Interrupts wird ein Flankenwechsel nur an den Pins die als Eingang arbeiten erkannt
|
||||
002E 3008 00087 movlw 08h ;RB4-7 Interrupt freigeben
|
||||
002F 008B 00088 movwf intcon
|
||||
0030 178B 00089 bsf intcon,7 ;GIE
|
||||
00090 loop3
|
||||
0031 198B 00091 btfsc intcon,3 ;wird in ISR zur<75>ckgesetzt
|
||||
0032 2831 00092 goto loop3
|
||||
00093
|
||||
00094 ;das gleiche nochmals, nur sind RB4-6 Ausg<73>nge und werden deshalb ignoriert
|
||||
0033 308F 00095 movlw 10001111B
|
||||
0034 1683 00096 bsf status,5
|
||||
0035 0086 00097 movwf 6 ;TRIS RB
|
||||
0036 1283 00098 bcf status,5
|
||||
0037 3008 00099 movlw 08h ;RB4-7 Interrupt freigeben
|
||||
0038 008B 00100 movwf intcon ;aber nur RB7 ist aktiv
|
||||
0039 178B 00101 bsf intcon,7 ;GIE
|
||||
00102 loop4
|
||||
003A 198B 00103 btfsc intcon,3 ;wird in ISR zur<75>ckgesetzt
|
||||
003B 283A 00104 goto loop4
|
||||
00105
|
||||
00106
|
||||
00107 ;******************************************************************
|
||||
00108 ;wenn alles richtig, dann
|
||||
00109 ;in 20h steht 54H
|
||||
00110 ;in 21H ein 49H
|
||||
00111 ;in 22H ein 53H
|
||||
00112
|
||||
00113 ende
|
||||
003C 283C 00114 goto ende ;Endlosschleife, verhindert Nirwana
|
||||
00115
|
||||
00116
|
||||
|
@@ -1,40 +1,40 @@
|
||||
00001 ;TPicSim9
|
||||
00002 ;Programm zum Test des 16F84-Simulators.
|
||||
00003 ;Funktion: SLEEP-Befehl
|
||||
00004 ;(c) St. Lehmann Ersterstellung: 31.03.2016
|
||||
00005 ;Definition einiger Symbole
|
||||
00006
|
||||
00007 list c=132 ;Zeilenl<6E>nge im LST auf 132 Zeichen setzen
|
||||
00008
|
||||
00009 status equ 03h
|
||||
00010 rb equ 06h
|
||||
00011 var equ 0ch
|
||||
00012 liste1 equ 10h
|
||||
00013 liste2 equ 11h
|
||||
00014 liste3 equ 12h
|
||||
00015 liste4 equ 13h
|
||||
00016
|
||||
00017 ;Definition des Prozessors
|
||||
00018 device 16F84
|
||||
00019
|
||||
00020 ;Festlegen des Codebeginns
|
||||
00021 org 0
|
||||
00022 ;wenn mit eingeschaltetem Watchdog-Timer der SLEEP-Befehl aktiviert wird,
|
||||
00023 ;dann wird das Programm nach ca. 2,3ms weiter laufen.
|
||||
00024
|
||||
00025 ;wenn der Watchdog-Timer ausgeschaltet ist, beendet ein RESET den SLEEP-Modus
|
||||
00026
|
||||
00027 ;Auch ein Interrupt an RB0 oder RB4 bis RB7 beendet den SLEEP-Modus
|
||||
00028 start
|
||||
0000 018C 00029 clrf var ;
|
||||
0001 0E03 00030 swapf status,w
|
||||
0002 0090 00031 movwf liste1 ;T0=1 , PD=1
|
||||
0003 0063 00032 sleep ;warte bis Watchdogtimer anspricht
|
||||
0004 0E03 00033 swapf status,w
|
||||
0005 0091 00034 movwf liste2 ;T0=1 , PD=0 bei Watchdog-Timeout
|
||||
00035 ;T0=0 , PD=0 bei RESET oder Interrupt
|
||||
00036
|
||||
00037
|
||||
00038 ende
|
||||
0006 2806 00039 goto ende
|
||||
00040
|
||||
00001 ;TPicSim9
|
||||
00002 ;Programm zum Test des 16F84-Simulators.
|
||||
00003 ;Funktion: SLEEP-Befehl
|
||||
00004 ;(c) St. Lehmann Ersterstellung: 31.03.2016
|
||||
00005 ;Definition einiger Symbole
|
||||
00006
|
||||
00007 list c=132 ;Zeilenl<6E>nge im LST auf 132 Zeichen setzen
|
||||
00008
|
||||
00009 status equ 03h
|
||||
00010 rb equ 06h
|
||||
00011 var equ 0ch
|
||||
00012 liste1 equ 10h
|
||||
00013 liste2 equ 11h
|
||||
00014 liste3 equ 12h
|
||||
00015 liste4 equ 13h
|
||||
00016
|
||||
00017 ;Definition des Prozessors
|
||||
00018 device 16F84
|
||||
00019
|
||||
00020 ;Festlegen des Codebeginns
|
||||
00021 org 0
|
||||
00022 ;wenn mit eingeschaltetem Watchdog-Timer der SLEEP-Befehl aktiviert wird,
|
||||
00023 ;dann wird das Programm nach ca. 2,3ms weiter laufen.
|
||||
00024
|
||||
00025 ;wenn der Watchdog-Timer ausgeschaltet ist, beendet ein RESET den SLEEP-Modus
|
||||
00026
|
||||
00027 ;Auch ein Interrupt an RB0 oder RB4 bis RB7 beendet den SLEEP-Modus
|
||||
00028 start
|
||||
0000 018C 00029 clrf var ;
|
||||
0001 0E03 00030 swapf status,w
|
||||
0002 0090 00031 movwf liste1 ;T0=1 , PD=1
|
||||
0003 0063 00032 sleep ;warte bis Watchdogtimer anspricht
|
||||
0004 0E03 00033 swapf status,w
|
||||
0005 0091 00034 movwf liste2 ;T0=1 , PD=0 bei Watchdog-Timeout
|
||||
00035 ;T0=0 , PD=0 bei RESET oder Interrupt
|
||||
00036
|
||||
00037
|
||||
00038 ende
|
||||
0006 2806 00039 goto ende
|
||||
00040
|
||||
|
@@ -1,46 +1,46 @@
|
||||
F<EFBFBD>r die Test, ob ihr Simulator richtig funktioniert, gibt es
|
||||
dieverse Testprogramme. Sie sind bewusst kurz gehalten, damit
|
||||
der <20>berblick nicht verloren geht.
|
||||
|
||||
|
||||
Die Testprogramme f<>r den PIC-Simulator haben folgende Aufgaben:
|
||||
|
||||
TPicSim1
|
||||
Es werden die Literal-Befehle getestet
|
||||
|
||||
TPicSim2
|
||||
Test von CALL, GOTO, RETLW und RETURN (RETFIE in TPicSim8)
|
||||
|
||||
TPicSim3
|
||||
Pr<EFBFBD>fen der Byte-orientierten Befehle, ohne die aus TPicSim4
|
||||
|
||||
TPicSim4
|
||||
DECFSZ, INCFSZ, RLF und RRF werden hier gesondert getestet
|
||||
|
||||
TPicSim5
|
||||
Hier werden die Bit-orientierten Befehle gepr<70>ft.
|
||||
|
||||
TPicSim6
|
||||
Die indirekte Adressierung ist wichtig und kommt sehr oft vor.
|
||||
|
||||
TPicSim7
|
||||
Der Timer0 wird mit und ohne Vorteiler gepr<70>ft.
|
||||
|
||||
TPicSim8
|
||||
Es gibt neben dem RB0, RB4-RB7 und dem Timer-Interrupt auch den
|
||||
EEPROM-Interrupt, der aber nicht gepr<70>ft wird.
|
||||
|
||||
TPicSim9
|
||||
Der SLEEP-Befehl verlangt etwas mehr <20>berlegung bei den Tests.
|
||||
(Siehe auch TPicSim11)
|
||||
|
||||
TPicSim10
|
||||
Das PCL- und das PCLATH-Register sind etwas Besonderes beim PIC
|
||||
und ben<65>tigt mehr Detailkenntisse als die <20>brigen Befehle
|
||||
|
||||
TPicSim11
|
||||
Diese Funktion ist grundlegend f<>r das TPicSim9-Testprogramm.
|
||||
|
||||
TPicSim12
|
||||
Lesen und Beschreiben des internen Daten-EEPROMs.
|
||||
|
||||
F<EFBFBD>r die Test, ob ihr Simulator richtig funktioniert, gibt es
|
||||
dieverse Testprogramme. Sie sind bewusst kurz gehalten, damit
|
||||
der <20>berblick nicht verloren geht.
|
||||
|
||||
|
||||
Die Testprogramme f<>r den PIC-Simulator haben folgende Aufgaben:
|
||||
|
||||
TPicSim1
|
||||
Es werden die Literal-Befehle getestet
|
||||
|
||||
TPicSim2
|
||||
Test von CALL, GOTO, RETLW und RETURN (RETFIE in TPicSim8)
|
||||
|
||||
TPicSim3
|
||||
Pr<EFBFBD>fen der Byte-orientierten Befehle, ohne die aus TPicSim4
|
||||
|
||||
TPicSim4
|
||||
DECFSZ, INCFSZ, RLF und RRF werden hier gesondert getestet
|
||||
|
||||
TPicSim5
|
||||
Hier werden die Bit-orientierten Befehle gepr<70>ft.
|
||||
|
||||
TPicSim6
|
||||
Die indirekte Adressierung ist wichtig und kommt sehr oft vor.
|
||||
|
||||
TPicSim7
|
||||
Der Timer0 wird mit und ohne Vorteiler gepr<70>ft.
|
||||
|
||||
TPicSim8
|
||||
Es gibt neben dem RB0, RB4-RB7 und dem Timer-Interrupt auch den
|
||||
EEPROM-Interrupt, der aber nicht gepr<70>ft wird.
|
||||
|
||||
TPicSim9
|
||||
Der SLEEP-Befehl verlangt etwas mehr <20>berlegung bei den Tests.
|
||||
(Siehe auch TPicSim11)
|
||||
|
||||
TPicSim10
|
||||
Das PCL- und das PCLATH-Register sind etwas Besonderes beim PIC
|
||||
und ben<65>tigt mehr Detailkenntisse als die <20>brigen Befehle
|
||||
|
||||
TPicSim11
|
||||
Diese Funktion ist grundlegend f<>r das TPicSim9-Testprogramm.
|
||||
|
||||
TPicSim12
|
||||
Lesen und Beschreiben des internen Daten-EEPROMs.
|
||||
|
||||
|
Reference in New Issue
Block a user