how to write this program on keil, Anyone please give full informatio by including the header file

 Assembly Language for Addition, Aubtraction, Multiplication and Division:

/********simple addition program*********/
 
AREA   program, code, read-only     / Directives, this allow programmer to specify memory
entry                                         /Enter into the specified memory to create program
main
MOV    R1, #0X000000003;            / GET 1st VALUE
MOV    R2, #0X000000005;            /GET 2nd VALUE
ADD    R3, R1, R2;                        /R3=R1+R2
END

org 0000h main: mov a,po;

org 0000h
main:
mov a,po; /get value from port and store in an accumulator
mov R1,a; /mov from acc to r1 reg
mov a,p1; /get another value from pi and store in an acc
add a,R1; /add  acc and reg r1
mov p3,a; /move result to p3
end

("select inputs from the port window of the keil soft")

Share |