Free Web Hosting by Netfirms
Web Hosting by Netfirms | Free Domain Names by Netfirms

 
7.4 checksum.inc

checksum.inc implements two macros for calculating checksum (8bit and 16bit):

  CheckSum8(...)
  CheckSum16(...)

Both macros return new name - 'CheckSumRet8'/'CheckSumRet16' that represents checksum:

  .device p16c84

  .include <p16c84.inc>

  .include <checksum.inc>
   Check1 = 0x20
  start:
           CheckSum8(1,2,3,4,5)
   movlw CheckSumRet8
   movwf Check1

Notice that this macro calculate checkum for constants not for value of file registers, so this two macros do not generate any code!

Thans to Even S. F. for some ideas.
 

[PREV][INDEX][NEXT]