More Thoughts on Computer Programming
06/06/2013
Part 2 – Basic CPU Comparisons
Solutions-For-Education.com/Programming.html
For anyone interested in methods used by any Processor (CPU), you should take a look at "Accessing Memory", as this explains the various processes or methods to address or locate a specific location, or series of locations in memory (RAM). An important consideration in that just about all CPU Instruction sets, the only difference between "Load Data" and "Store Data" is a single data bit in the instruction command, with the data bit being high (1) for one and low (0) for the other. Other bit locations in the instruction command, are often used to determine which Register is to be employed as a Memory Address Pointer, and other data bits in that instruction command are often used as "Modifiers" as for additional information for either the Register or Memory during the Memory Access. Some of these Modifiers may indicate a +/- Offset of the indicated memory location, Increment or Decrement the value in the Register or in the contents of the memory pointed to.
Other general instructions (which may be a series of complex steps) might accomplish mathematical operations, conditional operations, Indexing (Setup &/or Incrementing/Decrementing Registers), Device I/O controls, Data I/O, Logicical Decisions.
In reality, many of the instructions that might seem to be somewhat complex are actually clusters of similar instructions, that are conditional on "Status Flags". These flags (composed of specific flag bits) come about from previous operations, be they from devices or mathematical operations. These same "Status" situations bubble up into the so-called High-Level Languages, and are dealt with in the same manner.
-
An individual can compose a set or block of desired machine-codes manually and then input these codes into the CPU system by some means. A number of Systems have a "Front-Panel Binary Switches", that will allow an individual to set in specific instructions directly, and may be useful for troubleshooting a problem.
-
An "Assembler" is a specific program tailored to the CPU to be used. The Assembler takes Mnemonics (in text form) that relate to specific Machine-Code Instructions, and generates the necessary Binary-Code for that Instruction that can be loaded into memory for CPU usage. Each CPU requires an Assembler tailored to the Machine-Code for that CPU. In this case, it requires a program to generate another program, often in an multi-step process.
-
Some of the best Assemblers (called "Macro-Assemblers") provide a method for identifying a Cluster of Machine-Codes under an user-defined name. This block of code is available to the programmer like a sub-routine, under reference to that defined name, but the block of code is not printed out unless desired. Perhaps you can begin to see that "Modularized by Macros" starts looking like any number of High-Level Languages.
-
There are quite often various special programs that operate on a "Base-Level", that allow inspection and/or modification of the actual binary code as seen by the CPU.
Go to Programming - Part-1 (Introduction)
Return to Programming (Menu)