How shingareom/microprocessordiplomaproject works
Project type and purpose
• This is a single-module, console-based assembly language program written for the x86/DOS environment.
• Its sole function is to prompt the user for a number, search a hard-coded array, and report the index or a “not found” message.
File structure
• Top level:
• DiplomaProject.asm: the complete source code (data and code segments).
• README.md: project overview, features, flow, and usage.
• LICENSE: MIT license.
• No subdirectories, no external libraries or services, no build scripts beyond assembling with MASM/TASM.
README for additional insights
• Data segment contains:
• myarr (the array), num (user input), index, isfound flag, prompt/result strings.
• Code segment implements:
• DOS interrupts (int 21h) for I/O.
• A loop/compare sequence for the search.
• Conditional jumps to display either “found” or “not found.”
a. Main components:
• User (console)
• DOS I/O interface (int 21h)
• Data Segment (myarr, num, index, flags, strings)
• Code Segment (initialization, input routine, search loop, output routine)
b. Relationships / interactions:
1. User → Console Input Routine (via int 21h) → stores value in num
2. Code Segment’s Search Loop reads myarr & num → updates index & isfound
3. Search Loop → branches to either Found Routine or Not-Found Routine
4. Output Routine → Console Output (via int 21h) → back to DOS / program exit
c. Architectural patterns / principles:
• Separation of Data vs. Code segments (DS: data definitions; CS: logic)
• Linear control-flow with conditional branching (no subroutines or modules)
• Direct hardware/OS calls via interrupts
d. Key technologies / libraries:
• x86 Assembly (MASM/TASM)
• DOS Interrupt 21h (services for keyboard input, screen output, program exit)
• DOS or DOSBox Emulator
Detailed breakdown to capture essential elements
• Initialization block: DS setup, clear flags, set index = 0
• Input block: prompt string → int 21h, read key(s) → convert to numeric value → store in num
• Search Loop block:
• Compare myarr[index] with num
• If equal → set isfound, jump to Found block
• Else index++; if index < array_length, loop; else jump to Not-Found
• Found block: display “found” message + index → Exit
• Not-Found block: display “not found” message → Exit
• Exit block: int 21h service to terminate program