use What gate to set bits
Or gate and use 1
use What gate to clears bits
And gate and use 0
use What gate to toggle bits
Use xor gate and use 1
Write a program to compute 1 + 2 + 3 + … + n and save the sum at 0x11 and 0x10.
DCOUNT EQU 10
ACOUNT EQU 0C
MOVLW DCOUNT
MOVWF ACOUNT, f
CLRW
LOOP ADDWF ACOUNT, w
DECFSZ ACOUNT, f
GOTO LOOP
MOVWF 11
MOVWF 10Write a program to do the NOP instruction 50000 times.
DCOUNT1 EQU 100
DCOUNT2 EQU 500
ACOUNT1 EQU 0C
ACOUNT2 EQU 0D
MOVLW DCOUNT1
MOVWF ACOUNT1
LOOP1 MOVLW DCOUNT2
MOVWF ACOUNT2
LOOP2 NOP
DECFSZ ACOUNT2,1
GOTO LOOP2
DECFSZ ACOUNT1,1
GOTO LOOP1