|
-
June 29th, 2003, 11:59 PM
#10
A computer works by performing mathmatical operations on data stored in memory. 1's and 0's are all that is required for this(binary or base-2) .The fact that humans like base-10 and letters, has nothing to with the computer so dont blame your CPU. How can 1's and 0's become programs? Take this for example:
00111100
01100110
11000011
11000011
11111111
11111111
11000011
11000011
Congratulations, you now have a letter 'A' from an 8-bit Nintendo. Every operation performed by a CPU is hardwired into it and is an instruction(This is your chip's instruction set). Each instruction or opcode usually accepts operands. These instructions are numbers (binary to the CPU,or hex, or octal if you're old school, doesnt matter)as are the operands.For our sake opcodes have been given mneumonic names to help programmers keep their sanity (I seem to remember reading that Steve Wozniak could program without a single letter) for instance 0010.1000 (binary) is also 0x28 which some of you ASM prgrammers may know as the opcode "SUB", which- thats right folks subtracts. The CPU maintains a pointer to the next instruction to execute via an Instruction Pointer or IP(or program counter PC. Note: Discussion of registers is beyond the scope of this post) Typically instructions execute from the top of the stack(aka your memory). This is like a stack of dishes executing the first(top) plate then the next.Keep in mind the last plate in the stack is usually the first to be placed on the stack(hence the bottom). This is what allows bufferoverflow attacks, aka some jackass puts more food on his plate then it can hold and it spills onto the plate beneath it which is then executed next(This is of course an extremely basic explanantion as many attacks will attempt to modify the instruction pointer adress to jump to their dirty ass plate somewhere in your stack) Of course these opcodes can not only be used to inspect data within the memory for a decision(this is a branch, wich typically means the address the IP points to will be changed based on inspection of some data) but modify this data as well. This means programs are nothing more than pushing little 1's and 0's around in memory.Fortunately for us we do not have to re-invent the wheel and much of the extremely simple processes such as Basic Input and Output Systems(Thats correct, your BIOS) have been written by poor wretches which preceded us(and were doubtlessly far smarter), enabling us to concentrate on more important things like Unreal Tournament. After a while of using all these opcodes people decided it was terribly in-convienent to write 4 pages of assembly code to perform long division and someone decided to just build libraries of all these basic functions and allow programmers to build programs in a way more suited to the human brain and then just convert it all later, aka a Compiler was born. One of the these was the BCPL compiler the great great great grand daddy of our beloved C++.
"C was originally developed in 1969-1973 at Bell Labs about the same time the UNIX operating system was being developed. Its parent was the language B and its grandparent was the language BPCL. Derived from the typeless language BCPL, it evolved a type structure; created on a tiny machine as a tool to improve a meager programming environment, it has become one of the dominant languages of today. Even today it continually evolves, C++, C#, etc are all inspired by C."
And the rest was history.I hope someone gained some sort of insight from this piece of electronic nostalgia.
-Maestr0
\"If computers are to become smart enough to design their own successors, initiating a process that will lead to God-like omniscience after a number of ever swifter passages from one generation of computers to the next, someone is going to have to write the software that gets the process going, and humans have given absolutely no evidence of being able to write such software.\" -Jaron Lanier
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|