Maker Pro
Maker Pro

how processor understand assembly command from memory??

lets think I have micro controller 89c51 ,LED,switch,compiler(keil),programmer (flesh magic)
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
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
when we write code it end some hardware
example when we write command SETB P1.1 that means 0100 0000

1) how the processor understand this command FIRST it will take information from rom memory or ram memory?

3) how the data create with logic gates in ROM memory?
3)how address create with logic gate in RAM memory ?
 

Harald Kapp

Moderator
Moderator
1) That depends. It can fetch code from either of the two, depending on the layout of the processors's address space.
3) You don't create dat with logic gates in eiter RAM or ROM. These memories have a storage cell whose data is put on the data bus when the memory cell is correctly addressed.

Start here and read teh several linked sections about the different kinds of memory.
 
look at this in another way
l I have micro controller 89c51 ,LED,switch,compiler(keil),programmer (flesh magic)
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 for example
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
assembler convert this code into machine code
for example
:10000000743811221142740F112211427406112208
:100010001142748411221142744E112F1142744FF7
:10002000112FF590C2A0C2A1D2A21142C2A222F504
:1000300090D2A0C2A1D2A21142C2A222741811224F
:0B00400080FA7B647CFFDCFEDBFA2210
:00000001FF
this hexa code burn into the memory of controller

1) I don't know where this hexa code burn into the RAM memory or ROM memory ?

2)I don't know this hexa code contain the data or address of data or both data and address?

3)software side ROM memory is use to write code but what is the work of rom memory on hardware

4)software side RAM memory is used to store address of data but what is work of RAM memory on hardware ?

5)micro controller take input from switch how the signal goes in internal circuit of micro controller throw the ALU , CONTROL unit, RAM, ROM , switch , LED, data register, address register, instruction register

simple controller take input and processor perform the task and LED will blink

how this process done ?


I have searched lot of about microcontroller and waste most of time to find out internal circuitry how they work but still I did not get correct logic please anyone help me to working of microcontroller with internal circuit
 
What you are asking is hardly suitable to answer on a forum; it requires several lectures.

google 'circuit for simple machine instruction'

It will return several links that describe the circuits and how they work.
 

Harald Kapp

Moderator
Moderator
I'm afraid Shumifan is right and as I noted in response to a previous post of you it seems that you should get a basic grasp of what a (micro)computer or -controller is and how it works.

1) You don't "burn" data into RAM, only into ROM, EPROM, FLASh etc.

2) The code can contain both. The program memory is addressed by a unit called program counter within the CPU. The program counter holds the address of the next instruction to be fetched from program memory. The program counter is automatically incremented to the address of the next instruction once an instruction has been fetched. The increment (number of bytes to add to the current address) depends on the length of the instruction and can vary. Also, the program counter can be manipulated by the program itself. It can be set to a new address (e.g. by a "jump" instruction).
The data can also contain addresses of data that is used by the program (e.g. addresses of variables or of ports).

3) There is no such thing as "software side ROM". ROM is a piece of hardware.
4) The same goes for RAM.
What do you mean by these questions?

5) Impossible to explain in a few words here. You need to understand how a processor operates. Google "microprocessor architecture basics", read this.
 
ok I will search on google but just tell me when we take input from sensor or switch, where is signal goes?
 
Do you understand English?
Which bit of the above help don't you understand?
The articles referenced will explain all.
 
In its simplest form and remembering each memory location is 8 bits wide:
The signal from the switch goes into an input port which is addressed like any other memory location by the processor. The program tells the processor to look at the location and If the switch is open, the location will hold 0000 0000. If the switch is closed, the location will hold 0000 0001. The program must fetch this binary number from this address location in the input/output (I/O) and store it in Random Access Memory, (RAM) or use it to make decisions, depending on the program commands. In this case turn on output location connected to the LED.
As long as the program is running the processor will keep reading the I/O and process the results.

Hope this helps, keep in mind the processor can only follow the program line for line.
 
Last edited:
Top