This Repository is a collection of different ethical hacking tools and malware's for penetration testing and research purpose written in python, ruby, rust, c++, go and c.
JavaScript algorithmsartificial-intelligencebugbountycryptographycyber-threat-intelligencecybersecurity-projectsethical-hackinghacking-toolsmalwarenessusnetwork-monitoringnetwork-securitynmapportscannerpythonpythonprojectsthreat-intelligencevirus-scanning
Create Differentiate between absolute addressing and relative addressing.md
Abdul Wahab Junaid1261dc5b2b6e
diff --git a/Assembly language/Basics of Assembly language/Differentiate between absolute addressing and relative addressing.md b/Assembly language/Basics of Assembly language/Differentiate between absolute addressing and relative addressing.mdnew file mode 100644index 0000000..a43953c--- /dev/null+++ b/Assembly language/Basics of Assembly language/Differentiate between absolute addressing and relative addressing.md@@ -0,0 +1,61 @@+# Absolute Addressing vs. Relative Addressing in Assembly Language++## Absolute Addressing:++### Definition:+- **Absolute addressing** involves specifying the exact memory location or address of an operand.++### Example:+```assembly+MOV AX, [1234] ; Move the value at memory address 1234 into register AX+```++### Characteristics:+- The operand's memory address is directly specified in the instruction.+- The address is constant and does not change during program execution.+- Suitable for accessing specific variables or data located at known memory addresses.++## Relative Addressing:++### Definition:+- **Relative addressing** involves specifying the location of an operand relative to the current program counter or instruction pointer.++### Example:+```assembly+JMP Label ; Jump to the location marked by the label+```++### Characteristics:+- The operand's location is specified as an offset or distance from the current instruction.+- The address is calculated dynamically during program execution.+- Suitable for implementing control flow instructions like jumps, branches, and loops.++## Key Differences:++1. **Operand Specification:**+ - **Absolute Addressing:** Operand's memory address is directly specified in the instruction.+ - **Relative Addressing:** Operand's location is specified relative to the current program counter or instruction pointer.++2. **Address Stability:**+ - **Absolute Addressing:** The address is constant and does not change during program execution.+ - **Relative Addressing:** The address is calculated dynamically based on the program counter, allowing for flexibility.++3. **Use Cases:**+ - **Absolute Addressing:** Suitable for accessing specific data or variables at known and fixed memory addresses.+ - **Relative Addressing:** Used in control flow instructions (jumps, branches, loops) where the target location is determined dynamically based on the current program counter.++4. **Examples:**+ - **Absolute Addressing Example:**+ ```assembly+ MOV AX, [1234] ; Move the value at memory address 1234 into register AX+ ```+ - **Relative Addressing Example:**+ ```assembly+ JMP Label ; Jump to the location marked by the label+ ```++5. **Flexibility:**+ - **Absolute Addressing:** Less flexible as the addresses are fixed at assembly or compile time.+ - **Relative Addressing:** More flexible as addresses can be determined dynamically, allowing for adaptable program structures.++Understanding the distinction between absolute and relative addressing is crucial for writing assembly code, particularly when dealing with memory access and control flow instructions. The choice between them depends on the specific requirements of the task or program being developed.