; ; Just check out MPLAB INCLUDE "p16f873.inc" ; Register Usage CBLOCK 0x020 ; registers start after special registers i, j,k ; reserve space for three byte variables ENDC __CONFIG _CP_OFF & _DEBUG_OFF & _WRT_ENABLE_OFF & _CPD_OFF & _LVP_OFF & _PWRTE_ON & _WDT_OFF & _XT_OSC ; C Program equivalent ; #define myid 100 ; unsigned char i,j,k; ; ; i = myid; /* myvalue = 100 */ ; i = i + 1; /* i++, i = 101 */ ; j = i; /* j is 101 */ ; j = j - 1; /* j--, j is 100 */ ; k = j + i; /* k = 201 */ ; myid equ D'100' ; change this number (100) to the LAST two digits ; of your Student ID. If the last two digits ; of your Student ID are '00', then use the first ; two digits of you student ID. org 0 ; i = 100; movlw myid ; w <- 100 movwf i ; i <- w; ; i = i + 1; incf i,f ; i <- i + 1 ; j = i movf i,w ; w <- i movwf j ; j <- w ; j = j - 1; decf j,f ; j <- j - 1 ; k = j + i movf i,w ; w <- i addwf j,w ; w <- w + j movwf k ; k <- w here goto here ; loop forever end