hardware help...!!!!

Discussion in 'Programmer's Corner' started by agent1988, Dec 7, 2008.

  1. agent1988

    Thread Starter New Member

    Aug 16, 2008
    1
    0
    Well, i am a newbie here.And there are some points which haunt me day and night.Especially in low level machine programming for the microcontroller applications.

    my quest is as follows..:-

    Wenever we write any instruction code in the text editor of the assembler program, the instruction codes get converted to the machine level or the object code understandable by the CPU.But how..??The series of these 0's and 1's as 001100011....how these get converted to the voltage level in the microprocessor....coz as we are working in the text editor in the textual format then how come the assembler understands and decodes these instructions in the corresponding bit series....and how these this series gets transformed in the voltage levels understandable by the sequential clock driven microprocessor......and gets executed as the output...
     
  2. Papabravo

    Expert

    Feb 24, 2006
    10,135
    1,786
    The basic abstraction is language translation. If you know each of two languages, and they are fixed, then you can construct a "translator" that accepts one language as input, and produces another language as output. You can apply this abstraction at any number of levels. If you can create a memory device that you can read and write, then you can interpret the contens of that device in any convenient way.

    At the dawn of the computer era many samll programs called "bootstrap" programs were entered into a memory using toggle switches and incandescent lamps. These "bootstrap" programs would be used to load larger programs from paper tape or magnetic tape or disk. Later these "bootstrap" programs were replaced by ROM(Read Only Memory) chips.
     
  3. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    To expand a bit, the assembler parses the instructions on a line by line basis. It can recognize each line end by the carriage return code. Everything it reads is coded in ASCII (the text).

    By following rules, it determines things like labels, instructions, and operands. Going through the input text, it determines how much space must be alotted for the machine code, and if the test is apparently valid - that is, if there are any errors that violate the rules (compile time errors).

    The assembled machine code is generated in the next pass. When loaded into menory, it can be executed for instruct the computer as to what to do. A computer is a numeric engine, a machine that runs on numbers. Some numbers are instuctions, like loading a value into a register. Some direct the computer to take a branch is the number in a register is, say, equal to another. And so on.

    When you start a program, the address register is set to the starting address of the program. That memory loaction's contents are read out of memory and placrd in the instruction register. The numeric value there causes a specific action to take place.

    Read your instruction set and the assembler manual for greater understanding. Your only concern is in constructing an instruction list that performs a task and gives the desired result.
     
Loading...