For each problem list all references used or students consul
Solution
1)Assembler Instruction is a task to the processor that is to be carried out during run time. They are converted in to machine code and are linked with the executale code. hence they occupy the memory.
The Assembler directive is the instruction to the assembler to how to treat the data. it is responsible for how the task is running but it does not provide any machine code hence does not consume any memmory.
EQU VAR1 0x2F: this assigns a value of 0x2F to literal VAR1.
VAR1=0x2F
MOVLW VAR1 :- move contents of literal VAR1 to W register(Accumulator) i.e Move The contents of VAR1 To W . So now W contains 0x2F.
W=VAR1
MOVWF VAR1: move the contents of W to VAR1
VAR1=W
2)
The main adressing modes are
1)Immediate addressing mode
2)Direct addressing mode
3)indirect addressing mode
Immediate:Here the operand part of the instruction is either a number or constant;the operand section does not contain any address. It is the fastest mode.
eg:MOVLW 43h
MOVLW 0Fh
Direct: this uses the 9 bit addressing.The last 7 bits i.e the operand part of the instruction is used to idenfy the address of the register memory and the remaining two bits are taken from the status register(RP1,RP0).
since the instructio directly provides address it is called direct addressing
eg:movwf TRISA
ADDLW k
indirect: in this the instruction does not provide any address. the adress is fetched using the IRP bit of STATUS register and FSR. The address is accessed by INDF . INDF holds the address given FSR.
It is very Helpfull while using arrays.
eg: movwf FSR
clrf INDF //clear address indicated by FSR
3)MOVLW 0xAA //W=0xAA
MOVWF a //a=W
MOVLW 0xF0 //W=0xF0
ANDWF a,b //b=a AND W
MOVLW 0x34 //W=0x34
MOVWF a //a=w
MOVLW 0x12 //W=0x12
IORWF a,c //c=w OR a
MOVLW 0x42 //W=0x42
ADDWF b,a //a=W+b
MOVLW 0x00 //W=0x00
MOVWF d //d=0x00
MOVF c,d //W=c SINCE d=0x00
SUBWF a,VAR1 //VAR1=a-W

