Just a glimps at assembly programming....
lets say you wanted to calculate this
rpm = 1/(period of revolutiuon)
pretty simple eh?
this is what it look like in a assembly
Line Address Opcode Label Disassembly
162 0142 F019 NOP
163 0144 0EFF MOVLW 0xff
164 0146 6E20 MOVWF 0,
165 0148 6E21 MOVWF 0,
166 014A C016 MOVFF DIFFL, DIVISORL
167 014C F026 NOP
168 014E C015 MOVFF DIFFH, DIVISORH
169 0150 F025 NOP
170 0152 0E10 MOVLW 0x10
171 0154 6E22 MOVWF 0,
172 0156 6A24 CLRF 0,
173 0158 6A23 CLRF 0,
174 015A 3620DIV16 RLCF 0x1, 0,
175 015C 3621 RLCF 0x1, 0,
176 015E 3624 RLCF 0x1, 0,
177 0160 3623 RLCF 0x1, 0,
178 0162 5026 MOVF 0, 0,
179 0164 5C24 SUBWF 0, 0,
180 0166 6E27 MOVWF 0,
181 0168 5025 MOVF 0, 0,
182 016A 5823 SUBWFB 0, 0,
183 016C 6E28 MOVWF 0,
184 016E A0D8 BTFSS STATUS, 0, 0
185 0170 EFC1 GOTO NOFITS
186 0172 F000 NOP
187 0174 8020FITS BSF 0, 0,
188 0176 C027 MOVFF TEMPL, REML
189 0178 F024 NOP
190 017A C028 MOVFF TEMPH, REMH
191 017C F023 NOP
192 017E EFC2 GOTO END16DIV
193 0180 F000 NOP
194 0182 9020NOFITS BCF 0, 0,
195 0184 2E22END16DIV DECFSZ 0x1, 0,
196 0186 EFAD GOTO DIV16
197 0188 F000 NOP
198 018A C020 MOVFF TOPL, RPML
199 018C F02A NOP
200 018E C021 MOVFF TOPH, RPMH
201 0190 F029 NOP
202 0192 C020 MOVFF TOPL, ACKEN
203 0194 F004 NOP
204 0196 C021 MOVFF TOPH, ACKDT
205 0198 F005 NOP
206 019A A0A1DONE16DIV BTFSS PIR2, 0, 0
207 019C EFD2 GOTO ENDSPARKFIRESECTION3
208 019E F000 NOP
209 01A0 90A1 BCF PIR2, 0, 0
210 01A2 9083 BCF PORTD, 0, 0
Isn't that great?