Welcome to the assembly-coded wonderland of SIMON! Are you ready to test your memory skills and relive some retro magic? This game isn't just about winningโit's about embracing the pure, unfiltered awesomeness of assembly coding. So grab your virtual joystick, and letโs jump into this nostalgic ride! ๐โจ
- ๐ About the Game
- โจ Features
- ๐ง Getting Started
- ๐ฎ How to Play
- ๐ผ๏ธ Gameplay Preview
- ๐ Code Logic
- ๐ค Contributing
- ๐ License
- ๐จ Contact
SIMON is the classic memory game we all know and loveโbrought back to life in Assembly language for DOS! ๐ฅ๏ธโจ Your mission, should you choose to accept it, is to remember and repeat increasingly complex sequences of keys. It's more than a game; it's an 8-bit retro party for your brain! ๐
Think you're up for the challenge? Put your memory to the ultimate test and let's find out! ๐ง ๐ช
- Pure Assembly Code: Forget about fancy high-level programmingโthis game is made from scratch with the raw magic of assembly! ๐ป๐งค
- Interactive Gameplay: Think you have what it takes to follow the sequence? SIMON is here to put you to the test! ๐ฐ๏ธ
- Colorful Interface: Okay, maybe โcolorfulโ by DOS standards... but hey, it's got character! ๐๐
- Sound Effects: Beeps, boops, and bloopsโclassic gaming sounds to make you feel right at home! ๐๐ถ
- Retro Vibes: Immerse yourself in the nostalgia of yesteryear, when floppy disks ruled and graphics were... well, simpler. ๐๐น๏ธ
To hop into this time machine and play SIMON, you'll need:
- A DOS emulator like DOSBox. Yep, we're going old-school! ๐พ
- An assembler like MASM or TASM. (Gotta get those assembly vibes!) ๐ง
- Basic knowledge of how to assemble and run assembly programs. You got this! ๐ช
-
Clone the Repository:
git clone https://github.com/yourusername/simon-assembly-game.git
Easy-peasy! ๐
-
Assemble the Code:
Open your DOS emulator and navigate to the game directory. Time to work your magic! ๐ฆ
masm simon.asm; link simon.obj;
Who knew coding could feel so nostalgic? ๐
-
Run the Game:
simon.exe
And boomโyouโre ready to rock 'n' roll! ๐ธ
-
Start the Game:
After running
simon.exe, you'll be greeted by the legendary title screen. Get ready for the ultimate brain workout! ๐ฅ -
Understand the Keys:
- q = Green ๐ฟ
- w = Red ๐ด
- a = Blue ๐ต
- s = Yellow ๐ผ
- ESC = End Game ๐ญ
-
Game Mechanics:
-
Press ENTER to Start: And let the fun begin! ๐
-
Watch the Sequence: The game will show you a sequence of keys. Keep those eyes peeled! ๐
-
Repeat the Sequence: Got it memorized? Now it's your turn! Tap those keys! โจ๏ธโจ
-
Progress: Each round, the sequence gets longer, and your brain gets a bigger workout! How far can you go before your memory says โnopeโ? ๐คฏ
-
Victory: Nailed it? Awesome! Revel in your moment of triumph! ๐๐
-
Defeat: Slip up? Donโt worry, it happens to the best of us! Dust yourself off and try again! ๐๐ฐ๏ธ
-
-
Exit the Game:
- Press ESC at any time to bow out.
- After the game ends, press ENTER to return to DOS and bask in the glow of your assembly journey. โจ
Check out the action behind the scenes! ๐๐ฎ
Ever wondered what's happening under the hood of this assembly masterpiece? Let's dive into the code logic and explore how SIMON comes to life! ๐๐ง
The game is written in 8086 Assembly language for DOS, utilizing BIOS and DOS interrupts for screen manipulation, keyboard input, and sound generation. Here's a high-level breakdown of the code structure:
- Initialization: Set up data segments and display the start screen.
- Main Game Loop: Generate and display the sequence, get user input, and check for correctness.
- Display Functions: Handle drawing the game interface and updating the squares.
- Sound Functions: Play tones corresponding to each square.
- Utility Functions: Clear the screen, position the cursor, hide the cursor, etc.
Defines messages for display, key mappings, and temporary variables.
.data
titleMsg db "SIMON - A MEMORY GAME$", 0Dh, 0Ah, "$"
; ... other messages
keysToMove db 'w', 'a', 'q', 's' ; Key sequence
temp dw 3 ; Sequence lengthStarts the game by displaying the title and instructions, waits for the player to press ENTER, and then enters the main game loop.
main proc
; Setup data segment
mov ax, @data
mov ds, ax
; Display start screen
call clearScreen
; ... display messages
; Wait for ENTER key
waitForEnter:
mov ah, 00h
int 16h
cmp al, 0dh
jne waitForEnter
; Start the game
call clearScreenWithoutBlink
call cursorHider
call drawSquares
; Main game loop
loopTheGame:
inc temp ; Increase sequence length
; ... display sequence, get user input, check correctnessDisplays the sequence to the player by lighting up squares and playing corresponding sounds.
displayInSeq:
mov al, [si]
call PlayAndDraw
inc si
inc cx
cmp cx, temp
jb displayInSeqCaptures the player's input and compares it with the generated sequence.
userInputSeq:
push cx
mov ah, 07h
int 21h
call PlayAndDraw
cmp al, 1bh ; ESC key to exit
jne notCancel
jmp exit
notCancel:
cmp al, [si]
jne wrongInput
inc si
pop cx
inc cx
cmp cx, temp
jb userInputSeqHandles the logic for updating the display and playing sounds based on the key pressed.
PlayAndDraw proc
push ax
; Check which key was pressed and call corresponding functions
cmp al, 'q'
jne ifNotGreen
call newGreen
mov bx, 5709 ; Sound frequency for green
call playMusic
call newGreen2
jmp incomplete
; ... similar blocks for other keys
incomplete:
pop ax
ret
PlayAndDraw endpFunctions like newGreen, newGreen2, newred, etc., draw the colored squares on the screen.
newGreen proc
mov bl, 0aah ; Light green color code
mov dl, 29 ; X-axis
mov dh, 5 ; Y-axis
call drawLines
ret
newGreen endpThe playMusic procedure plays a tone corresponding to the square's color.
playMusic proc
push cx
mov al, 10110110B
out 43H, al
mov ax, bx
out 42H, al
mov al, ah
out 42H, al
; ... wait and stop sound
pop cx
ret
playMusic endp- clearScreen: Clears the screen.
- cursorHider: Hides the blinking cursor during gameplay.
- positioningTheCursor: Positions the cursor at a specific location.
- printString: Prints strings to the screen.
- Start Screen: Displays the title and instructions.
- Waiting for Start: The game waits for the player to press ENTER.
- Sequence Display: Shows the sequence by lighting up squares and playing sounds.
- Player Input: Waits for the player to repeat the sequence.
- Checking Input: Compares the player's input with the sequence.
- Correct Input: If the input matches, the game increases the sequence length and loops back.
- Incorrect Input: Displays the defeat message and exits the game.
- End Game: Upon completion or exit, displays a message and waits for ENTER to return to DOS.
- Sequence Generation: The sequence is currently static, stored in
keysToMove. To make it dynamic, you could implement random key selection. - Game Loop: The game attempts to loop indefinitely, increasing the difficulty each time.
- Sound and Graphics: Uses low-level BIOS interrupts for sound and graphics, giving it an authentic retro feel.
- Randomized Sequences: Implement a random number generator to create unpredictable sequences.
- Score Tracking: Keep track of the player's score or highest level reached.
- Optimized Code: Refine the assembly code for efficiency and readability.
- Error Handling: Add more robust input validation and error messages.
Feel free to dive into the code and tinker around! The beauty of assembly is that it gives you complete control over the hardware. Happy coding! ๐ฉโ๐ป๐จโ๐ป
Think you can make SIMON even more awesome? We'd love your help!
- Report Bugs: If you spot a glitch, shout it out! ๐๐ข
- Enhance Features: Have an idea for a new twist? Code it up and submit a pull request! ๐ก๐
- Optimize Code: Attention, assembly wizards! If you know how to make this faster or cleaner, we want you! ๐งโโ๏ธโจ
This project is open-source and available under the MIT License. Feel free to make it your own! ๐๐
Got questions, want to collaborate, or just feel like saying hi? We're all ears! ๐
- Email: dean97531@gmail.com ๐ง
- GitHub: LeitAtar ๐
Enjoy the game and may your memory be unbeatable! ๐ง ๐
Happy coding and gaming! ๐พ๐




