One-Page Reference Tables
C, C++, Java, Python, JavaScript & 8085 Assembly Exam Traps Cheat-Sheet
Polyglot Language Semantics Comparison (GATE & UGC NET Traps)
| Behavior / Feature | C (C99/C11) | C++ (C++17) | Java | Python 3 | JavaScript (ES6+) |
|---|---|---|---|---|---|
| Parameter Passing | Pass-by-Value (pointers simulate ref) | Value, Reference T&, Move T&& | 100% Pass-by-Value (of refs) | Pass-by-Object-Reference | Pass-by-Value (of refs) |
-7 / 3 and -7 % 3 | -2 and -1 (truncates toward 0) | -2 and -1 | -2 and -1 | -3 and +2 (floors toward !) | -2.333.. and -1 |
| Default Method Dispatch | Function pointers | Static (unless virtual) | Dynamic (virtual) by default | Dynamic duck typing | Prototype chain lookup |
| Memory Reclamation | Manual malloc/free | RAII + unique_ptr/shared_ptr | Tracing GC (Heap) | Ref-Counting + Cycle GC | Mark-and-Sweep V8 GC |
| Multiple Inheritance | — | ✅ Classes (virtual solves diamond) | ❌ Classes; ✅ interfaces | ✅ C3 Linearization MRO | Single prototype chain |
Intel 8085 Interrupts & Instruction T-State Quick Sheet
| Interrupt / Opcode | Key Exam Fact | Hex Vector / T-States |
|---|---|---|
TRAP (RST 4.5) | Highest priority, Non-Maskable, Edge + Level triggered | 0024H |
RST 7.5 / 6.5 / 5.5 | Maskable via SIM; 7.5 is rising-edge, 6.5/5.5 level | 003CH / 0034H / 002CH |
LDA addr / STA addr | 3-byte Direct memory access (4 Machine Cycles) | 13 T-States |
LHLD addr / SHLD addr | 3-byte 16-bit HL load/store (5 Machine Cycles) | 16 T-States |
CALL addr | 3-byte subroutine jump (6T opcode fetch + 2 reads + 2 stack pushes) | 18 T-States |
INX rp / DCX rp | 16-bit increment/decrement — updates ZERO flags! | 6 T-States |