lets think I have micro controller 89c51 ,LED,switch,compiler(keil),programmer (flesh magic)Ask if you don´t understand anything.
SWITCH is input device connected port pin P0.1
LED is output device connected port pin P1.1
I have written assembly code in keil software
Rich (BB code):
ORG OH
ON:
SETB P1.1 ; LED IS ON
OFF:
CLRB P1.1 ; LED IS OFF
LOOP:
JB P0.1 ; SWITCH ON
JNB P0.1 ; SWITCH OFF
SJMP LOOP
END
LED on:lets say the P1.1 is data bit that means 0100 0000 and its address something likr 0010 0000 stored into ram memory
LED off: lets say P1.1 is data bit that mean 0000 0000 and its address something like 0001 0000 stored into ram memory
1)how the processor fetch and execute the command SETB P1.1, CLR p1.1 ?
I want to understand how the ALU, control unit, RAM, rom work togather with this example
Last edited: