Welcome to our forums...

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.

Forum Statistics

  • Forum Members:
  • Total Threads:
  • Total Posts: 1
There are 1 users currently browsing forums.
General Programming Here you can talk about scripting in other languages such as Perl, Delphi, Pascal and Python.

Reply
  #1  
Old 4 Weeks Ago
Toddler
 
Join Date: Feb 2010
Posts: 11
Rep Power: 0
asbo is on a distinguished road
Fetch-Execute cycle and boot-up

This is useful for anybody who wants to program low-level languages.
Some examples of low-level software would be drivers, BIOS and Operating Systems.
Yet this theory can be usefull in all software you ever program.

Basic Outline:
1.The fetch-execute cycle begins as soon as power is introduced to the system.
2.The data is read from memory.
3.Then the instruction read is executed.
4.Either return to 2 or power-off.

Fuller Outline:
1. Power initiated
2. PC loaded to address lines
3. One word read from memory, fed through IR into CPU
4. PC iterated
5. If all data needed read from memory, jump to 8, else continue
6. PC used as memory address then incremented
7. Next word read and stored where programmed to go
8. execute phase if all data read, else go to 6.

pseudo-code:
Code:
    while(power on){
        pc loaded to address lines
        word read from memory, fed to IR
        PC++
        while(not all data read){
            PC loaded to address lines
            word read from memory
            PC++
        }
        execute instruction
    }
More information:
R/W line set to 1 to signify read operation, placing the address in pc to the address bus. Data from address read into IR(Instruction Reagister)
The data is then interpreted by the ID(Instruction Decoder).
The data needed to run the instruction which has been decoded by the ID is either in a specified address, or in the next few words of data.
If the data is in a specified address, the address is loaded to the MAR(Memory Address Register) and then read from,else the next word of data is read until all data required is read.
Once all data is read it is then executed, aslong as power is still supplied to the system, return to beginning of process.

To elaborate more on the fetch-execute cycle I shall mention how the PC is set at start-up, thus how the MBR(master boot record) most likely works.

On initiation of the fetch-execute cycle, the first byte in memory read is 0x0000 (assuming a 16-bit microcontroller).

The start of the memory device is the BIOS which is hard-coded into the Hard Drive when designed to be the master drive, (hence importance of not mixing up the slave and master drive cables). The BIOS can be programmed in various ways as we all know.

The BIOS then loads up the Operating System bringing users back to the system they feel safe in.
Reply With Quote


Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On