Page 125 - CITS - Electronic Mechanic - TP (Volume 1) - Hindi
P. 125
इले ॉिन मैके िनक - CITS
12 आपके ारा बनाई गई फ़ाइल म ो ाम को नीचे िदए अनुसार िलख ।
1 org 00h; //Set origin to address 00h
2 L1: mov a,p1; //Moves the value of Port 1 to accumulator A
3 anl a,#01h; //Bitwise AND operation with 01h (Binary: 0000 0001) and accumulator A
4 j: L1; //Jump to Label Ll if accumulator A is zero
5 mov a, #0ffh; //Moves OKAA (255 in decimal) to accumulator A
6 mov p2a; //Moves the Value of accumulator A to porta
7 &call delay call subroutine delay
8 mov a, #00h; //Moves 0X00 to accumulator A
9 mov p2, a; //Moves the accumulator A to port2
10 &call delay; //call subroutine delay again
11 sjmp L1; //Jump to the Label Li (loop indefinitely)
12
13 delay: mov R0, #0ffh; //Move Oxff to register zo
14 L2: mov R1, #offh; //Move Oxff to register R1
15 L3: djnz R1,L3 Decrement R1, jump to label L3 if R1 is not zero
16 djnz R0, L2 Decrement R0, Jump to Label L2 if R0 is not zero
17 ret: Return from subroutine delay
18 end
105
CITS : इले ॉिन & हाड वेयर - इले ॉिन मैके िनक - अ ास 38

