📌 Solved problems to help better understand the important concepts of Display Memory (Video Card Memory), String Manipulation, Software Interrupts and Hardware Interrupts in context of x86 Assembly Language (8086 Assembly)
I solved all these questions and shared the solutions here so that you can have a strong grip on these concepts with ready to run interesting solved problems.
Assembly Language Programming by Belal Hashmi and Junaid Haroon
Its an excellent book for understanding the language and concepts of 8086 Assembly. It starts from the very basics and then takes you to advanced concepts in an efficient manner. Highly Recommended!
1- Download this code and move the ‘assembly_code’ folder to C: directory.
2- Install DOSBOX from this link: Download DOSBOX Emulator
3- After complete installation, go to DOSBOX installation directory and run “DOSBox 0.74 Options.bat”. This will save you from the pain of searching the configuration file yourself and will open that file for you.
Copy these lines at the end of that file:
mount c: c:\assembly_code
c:
4- Now to run any question (say named ‘q1.asm’), run DOSBOX 0.74 and type
nasm q1.asm -o q1.com
To run the code, type
q1.com
To examine step by step working of the code, type
afd q1.com
Q3. Write a subroutine to copy a given area on the screen at the center of the screen without using a temporary array. The routine will be passed top, left, bottom, and right in that order through the stack. The parameters passed will always be within range the height will be odd and the width will be even so that it can be exactly centered.
Q4. Write a subroutine findSubstr that takes a null terminated string and a null terminated substring as its parameters and prints “Substring Found.” on video screen if that substring is found in that string and prints “Substring Not Found.” otherwise.
Sample :
str: db ‘Marry has a little lamb.’,0
substr1: db ‘lamb’,0 ; findSubstr prints “Substring Found.” for this substring.
Substr2: db ‘lame’,0 ; findSubstr prints “Substring Not Found.” for this substring.
Starting with the given number, replace that number by the sum of the squares of its digits. Repeat the process on the replaced number until the number either equals 1 within 256 iterations of the process. The number for which this process ends in 1 within 256 iterations is called a happy number; otherwise it is called an unhappy number. Use ah =01 service of int 21h to take input from user and ah=09 service of int 21h to print string on the screen.
You can get in touch with me on my LinkedIn Profile:
You can also follow my GitHub Profile to stay updated about my latest projects:
If you liked the repo then kindly support it by giving it a star ⭐ and share in your circles so more people can benefit from the effort.
If you find any bugs, have suggestions, or face issues:
This project thrives on community collaboration! Members are encouraged to take the initiative, support one another, and actively engage in all aspects of the project. Whether it’s debugging, fixing issues, or brainstorming new ideas, your contributions are what keep this project moving forward.
With modern AI tools like ChatGPT, solving challenges and contributing effectively is easier than ever. Let’s work together to make this project the best it can be! 🚀
Copyright (c) 2018-present, harismuneer
🛠️ Product Builder: Agile Product Manager with 5+ years of hands-on experience delivering SaaS solutions across sales, recruiting, AI, social media, and public sector domains. Background in Computer Science, with a proven track record of scaling products from inception to $XXM+ ARR, launching 3 top-ranking tools on Product Hunt, and developing solutions adopted by 250+ B2B clients in 40+ countries.
🌟 Open Source Advocate: Passionate about making technology accessible, I’ve developed and open-sourced several software projects for web, mobile, desktop, and AI on my GitHub profile. These projects have been used by thousands of learners worldwide to enhance their skills and knowledge.
📫 How to Reach Me: To learn more about my skills and work, visit my LinkedIn profile. For collaboration or inquiries, feel free to reach out via email.