- Published on
KembaraXtra – Computer Terms – * :
The asterisk, also called the star symbol, is widely used in various computing environments. In programming, it often means multiplication. For example, 5 * 3 equals 15. In operating systems like Windows and MS-DOS, it works as a wildcard character to replace one or more characters in a filename. For instance, *.txt would refer to all text files. In C and C++ programming, the asterisk is also used for pointer operations—it helps retrieve the actual value stored at a memory location pointed to by a pointer variable.
The asterisk, also called the star symbol, is widely used in various computing environments. In programming, it often means multiplication. For example, 5 * 3 equals 15. In operating systems like Windows and MS-DOS, it works as a wildcard character to replace one or more characters in a filename. For instance, *.txt would refer to all text files. In C and C++ programming, the asterisk is also used for pointer operations—it helps retrieve the actual value stored at a memory location pointed to by a pointer variable.
- Published on
KembaraXtra – Computer Terms – . means:
This symbol combination is a wildcard pattern used mainly in command-line environments like MS-DOS and Windows. It represents every possible file name and every possible extension. For example, *.* could be used to copy, move, or delete all files in a directory, regardless of their names or file types. It is especially useful when performing actions on many files at once.
This symbol combination is a wildcard pattern used mainly in command-line environments like MS-DOS and Windows. It represents every possible file name and every possible extension. For example, *.* could be used to copy, move, or delete all files in a directory, regardless of their names or file types. It is especially useful when performing actions on many files at once.
- Published on
KembaraXtra – Computer Terms – .. means:
Two dots used together in file system navigation refer to the parent directory—the folder above the current one in the directory structure. This is a common shorthand used in UNIX and MS-DOS. A single dot (.) refers to the current directory. Together, .. is essential for moving up levels in command-line interfaces.
Two dots used together in file system navigation refer to the parent directory—the folder above the current one in the directory structure. This is a common shorthand used in UNIX and MS-DOS. A single dot (.) refers to the current directory. Together, .. is essential for moving up levels in command-line interfaces.
- Published on
- Published on
- Published on
KembaraXtra-Case Law-C and Python: High-Level Programming
I. Introduction
I. Introduction
- The best way to learn high-level programming is by examining programming languages and writing programs.
- This study guide focuses on C and Python.
- Both are powerful and useful languages that illustrate common programming functionalities with different approaches.
- History: Dates back to the early 1970s; initially used to write Unix OS.
- Level: High-level, but relatively close to machine code.
- Strengths:
- Good for operating system development and hardware interfacing.
- High-performance applications (e.g., games).
- Useful for educational purposes to show the mapping between low-level and high-level concepts.
- Weaknesses:
- Complex.
- Few safeguards against programmer errors.
- Related Language: C++ (developed in the 1980s) is an updated version of C.
- History: Initially released in the 1990s.
- Level: High-level, further removed from hardware than C.
- Strengths:
- Easy to read and simple for beginners.
- Suitable for complex software projects.
- "Batteries included" philosophy: Includes a comprehensive standard library.
- Good for teaching programming concepts.
- High-level languages provide abstractions of CPU instructions.
- CPUs provide instructions for:
- Memory access
- Math and logic operations
- Control of program flow
- The goal is to familiarize yourself with common programming ideas, not to become proficient in a specific language.
- Published on
KembaraXtra-Computer Science-High-Level Programming
1. The Need for High-Level Languages
1. The Need for High-Level Languages
- Problem with Assembly Language:
- Time-consuming and error-prone.
- Difficult to maintain.
- CPU architecture-specific (not portable).
- Solution: High-Level Languages
- More human-readable syntax.
- CPU-independent.
- Promotes portability.
- Compiler: A program that translates high-level language code into machine code.
- Portability: High-level languages allow you to compile code for different processors with minimal changes.
- Output: The compiler produces an object file containing machine code for a specific processor.
- Object Files: The output of compilation, but not directly executable.
- Linker: A program that combines one or more object files into a single executable file.
- Resolves dependencies and includes necessary code libraries.
- Prepares the executable for the operating system to run.
- Building Software: The complete process of converting source code to an executable file, encompassing compilation and linking.
- Common Usage: Developers often say "compiling" to mean the entire build process.
- Automation: Compilers often automatically invoke the linker, which obscures the linking step.
- Published on
- Published on
KembaraXtra-Computer Science- Machine Instruction
ARM Processor Example: Moving the Number 4 into Register r7
ARM Processor Example: Moving the Number 4 into Register r7
- Context: The example focuses on an ARM processor instruction, commonly found in smartphones.
- Instruction Goal: The instruction moves the number 4 into the r7 register. Registers are small storage locations within the CPU.
- Binary Representation: The instruction in binary form is: 11100011101000000111000000000100
- Decoding the Binary:
- Condition (1110): Specifies when the instruction is executed. 1110 means it's always executed (not conditional).
- Immediate Bit (1): Indicates whether the instruction uses a direct value (immediate value) or a value from another register. 1 means it uses an immediate value (the number 4 in this case).
- Opcode (mov): Represents the operation to be performed. mov means "move" data.
- Destination Register (0111): Indicates the register where the value will be moved. 0111 is binary for 7, representing register r7.
- Immediate Value (00000100): The actual value to be moved. 00000100 is binary for 4.
- Summary: The binary translates to: "Move the number 4 into register r7."
- Purpose: A more compact and readable representation than binary.
- Example: The same instruction in hexadecimal is: e3a07004
- Definition: A programming language where each statement directly represents a machine language instruction. Each machine language has its assembly language (e.g., x86 assembly, ARM assembly).
- Structure: Consists of a mnemonic (human-readable opcode) and operands (registers, values).
- Mnemonic Example: mov is the mnemonic for the "move" operation.
- Example Instruction: The same instruction in ARM assembly language is: mov r7, #4
- Advantages: More readable and understandable for humans.
- Important Note: CPUs only execute binary code. Assembly language is a human convenience.
- Function: A program that translates assembly language statements into machine code (binary).
- Process:
- An assembly language text file (source code) is input.
- The assembler translates it into a binary object file (machine code).
- Published on
KembaraXtra-Case Law-Software Terms Defined
I. Key Definitions:
I. Key Definitions:
- Software: Instructions that tell a computer what to do. Contrast: Hardware (physical components).
- Program: An ordered set of software instructions that accomplishes a task. Related term: Programming (writing such programs).
- Application: Often used synonymously with "program", but implies direct interaction with humans. Can consist of multiple programs. Related term: App (modern usage, connotations to be covered later).
- Code (Computer Code): Another name for a set of software instructions.
- Source Code: The text of a program as originally written by developers. Written in a higher-level programming language. Requires additional steps before execution.
- Machine Code: Software in binary machine language instructions that a CPU can directly execute.
- Machine Language: The set of instructions a specific CPU architecture understands.
- Source Code --> Machine Code: Source code, written by developers, must be converted into machine code for the CPU to execute.
- Universal Conversion: Regardless of the initial programming language or technologies used, all programs ultimately become a series of 0s and 1s representing CPU instructions.
- "It's Just Code": Even complex software, when examined at its most fundamental level, is simply a series of instructions (0s and 1s) that a CPU interprets.
- Human Language vs. Machine Language:
- Vocabulary words are like CPU instructions.
- Sentences formed from words are like programs formed from instructions. Both convey meaning.