Assembly Programming:Simple, Short, And Straightforward Way Of Learning Assembly Language
5/5
()
About this ebook
This book is intended for beginners who would like to learn the basics of Assembly Programming. This book uses Simple words, Short sentences and Straightforward paragraphs. The triple S way to learn Assembly Programming. The topics covered in this book includes a brief introduction to assembly, common arithmetic instructions, character and string input and display routines, flow controls including conditional and looping statements, stack, and procedures. This assembly language book is intended for complete beginners in assembly programming. However, it is assumed that the reader has prior or basic knowledge with other programming language. This book includes screenshots of step by step of how to code, compile, link and run assembly programs. This book is packed with working sample assembly programs and after reading this book, the reader would be able to develop assembly programs based particularly from problems given in computer science courses.
Sherwyn Allibang
Sherwyn Allibang has 10 years experience in the academe as college professor handling business and IT related subjects. Aside from his career as an academe, he is also a freelance software developer catering system development from project management to core programming. With the degree in Bachelor of Science in Information Technology, Master in Business Administration, Master in Information Technology, and Doctor in Business Administration, Sherwyn is a solutions-focused, team oriented IT Specialist, with broad-based experience and hands-on skill in the successful implementation of highly effective technical support strategies. A proven ability to successfully analyze an organization's critical support requirements, identifies deficiencies and potential opportunities, and develops innovative solutions for increasing reliability and improving productivity.
Read more from Sherwyn Allibang
Methods of Research: Simple, Short, And Straightforward Way Of Learning Methods Of Research Rating: 4 out of 5 stars4/5C++ Programming Language: Simple, Short, and Straightforward Way of Learning C++ Programming Rating: 4 out of 5 stars4/5
Related to Assembly Programming:Simple, Short, And Straightforward Way Of Learning Assembly Language
Related ebooks
Assembly Language Coding in Color: ARM and NEON Rating: 0 out of 5 stars0 ratingsC Programming For Dummies Rating: 0 out of 5 stars0 ratingsAdvanced C Concepts and Programming: First Edition Rating: 3 out of 5 stars3/5Programming Concepts in C++ Rating: 0 out of 5 stars0 ratingsBeginning C++ Game Programming Rating: 4 out of 5 stars4/5Computer Programming In C Language Rating: 4 out of 5 stars4/5C Programming Concepts Rating: 0 out of 5 stars0 ratingsBeginning C++ Programming Rating: 3 out of 5 stars3/5Beginning Programming with C++ For Dummies Rating: 0 out of 5 stars0 ratingsProgramming Problems: A Primer for The Technical Interview Rating: 4 out of 5 stars4/5C Programming: C Programming Language for beginners, teaching you how to learn to code in C fast! Rating: 0 out of 5 stars0 ratingsVisualizing Data Structures Rating: 0 out of 5 stars0 ratingsModern C++ Programming Rating: 0 out of 5 stars0 ratingsC Programming for Arduino Rating: 4 out of 5 stars4/5C Clearly - Programming With C In Linux and On Raspberry Pi Rating: 0 out of 5 stars0 ratingsSchaum's Outline of Principles of Computer Science Rating: 0 out of 5 stars0 ratingsLearning Linux Binary Analysis: Learning Linux Binary Analysis Rating: 4 out of 5 stars4/5Assembly Language: From Basics to Expert Proficiency Rating: 0 out of 5 stars0 ratingsC All-in-One Desk Reference For Dummies Rating: 5 out of 5 stars5/5C Programming For Beginners: The Simple Guide to Learning C Programming Language Fast! Rating: 5 out of 5 stars5/5C++17 STL Cookbook Rating: 3 out of 5 stars3/5Teach Yourself C++ Rating: 4 out of 5 stars4/5Learn C++ Rating: 4 out of 5 stars4/5Modern C++ Programming Cookbook Rating: 5 out of 5 stars5/5Going Text: Mastering the Command Line Rating: 4 out of 5 stars4/5Computer Programming Using C Rating: 0 out of 5 stars0 ratingsProfessional C++ Rating: 2 out of 5 stars2/5Essential Algorithms: A Practical Approach to Computer Algorithms Using Python and C# Rating: 5 out of 5 stars5/5
Computers For You
The Self-Taught Computer Scientist: The Beginner's Guide to Data Structures & Algorithms Rating: 0 out of 5 stars0 ratingsThe Innovators: How a Group of Hackers, Geniuses, and Geeks Created the Digital Revolution Rating: 4 out of 5 stars4/5Quantum Computing For Dummies Rating: 3 out of 5 stars3/5Dark Aeon: Transhumanism and the War Against Humanity Rating: 3 out of 5 stars3/5CompTIA Security+ Get Certified Get Ahead: SY0-701 Study Guide Rating: 5 out of 5 stars5/5Tor and the Dark Art of Anonymity Rating: 5 out of 5 stars5/5A Guide to Electronic Dance Music Volume 1: Foundations Rating: 5 out of 5 stars5/5The ChatGPT Millionaire Handbook: Make Money Online With the Power of AI Technology Rating: 4 out of 5 stars4/5Visual Studio 2022 In-Depth: Explore the Fantastic Features of Visual Studio 2022 - 2nd Edition Rating: 0 out of 5 stars0 ratingsUX/UI Design Playbook Rating: 4 out of 5 stars4/5Storytelling with Data: Let's Practice! Rating: 4 out of 5 stars4/5Networking Fundamentals: Develop the networking skills required to pass the Microsoft MTA Networking Fundamentals Exam 98-366 Rating: 0 out of 5 stars0 ratingsAlan Turing: The Enigma: The Book That Inspired the Film The Imitation Game - Updated Edition Rating: 4 out of 5 stars4/5Microsoft Azure For Dummies Rating: 0 out of 5 stars0 ratings2022 Adobe® Premiere Pro Guide For Filmmakers and YouTubers Rating: 5 out of 5 stars5/5The Professional Voiceover Handbook: Voiceover training, #1 Rating: 5 out of 5 stars5/5Technical Writing For Dummies Rating: 0 out of 5 stars0 ratingsStandard Deviations: Flawed Assumptions, Tortured Data, and Other Ways to Lie with Statistics Rating: 4 out of 5 stars4/5Mindhacker: 60 Tips, Tricks, and Games to Take Your Mind to the Next Level Rating: 4 out of 5 stars4/5Fundamentals of Programming: Using Python Rating: 5 out of 5 stars5/5Some Future Day: How AI Is Going to Change Everything Rating: 0 out of 5 stars0 ratingsLearning the Chess Openings Rating: 5 out of 5 stars5/5Microsoft Office 365 for Business Rating: 4 out of 5 stars4/5Pro Tools All-in-One For Dummies Rating: 5 out of 5 stars5/5
2 ratings0 reviews
Book preview
Assembly Programming:Simple, Short, And Straightforward Way Of Learning Assembly Language - Sherwyn Allibang
Assembly Language: Simple, Short, and Straightforward Way of Learning Assembly Programming
2nd Edition
Copyright 2020
Dr. Sherwyn Allibang
Edition License Notes
This book is authorized for your own personal use. This book may not be re-sold or offered away to other individuals. Much thanks to you for regarding the diligent work of the author.
Introduction
This book is intended for beginners who would like to learn the basics of Assembly Programming. This book uses Simple words, Short sentences and Straightforward paragraphs. The triple S way to learn Assembly Programming. The topics covered in this book includes a brief introduction to assembly, common arithmetic instructions, character and string input and display routines, flow controls including conditional and looping statements, stack, and procedures. This assembly language book is intended for complete beginners in assembly programming. However, it is assumed that the reader has prior or basic knowledge with other programming language. This book includes screenshots of step by step of how to code, compile, link and run assembly programs. This book is packed with working sample assembly programs and after reading this book, the reader would be able to develop assembly programs based particularly from problems given in computer science courses.
TO GOD BE THE GLORY!
The resources used in this book are:
1. Personal Computer running Windows 7 Operating System
2. Notepad ++ for editing codes available at https://notepad-plus-plus.org
3. DosBox emulator for DOS and TASM (Assembler) available at https://techapple.net/2013/01/tasm-windows-7-windows-8-full-screen-64bit-version-single-installer
Other windows os versions can also be used as long as it supports the above mentioned software. All links provided in this book are updated periodically.
NOTE: The sample programs in this book considers processors that support x86 assembly instructions.
Table of Contents
Acknowledgement
1. Chapter 1 - Introduction to Assembly Language
1.1 Definition of Assembly Language
1.2 CPU REGISTERS
1.2.1 General Purpose Register
1.2.2 Segment Registers
1.2.3 Pointer Registers
1.2.4 Index Registers
1.2.5 Control Registers
1.3 Self-assessment questions
2. Chapter 2 - Our First Assembly Program
2.1 Assembly Program Structure
2.1.1 Fundamentals of Assembly Instructions
2.1.2 The MOV instruction in Assembly
2.1.3 The INT instruction in Assembly
2.1.4 Reserved words in assembly
2.2 Running our first Assembly program
2.2.1 How to install TASM?
2.2.2 Writing the Assembly Program Codes
2.2.3 Compiling (Assembling), Linking and Running the Program
2.3 Self-assessment questions
3. Chapter 3 - Input/Output Routines in Assembly Language
3.1 Simplified Segment Directives
3.2 Output Routines
3.3 Input Routines
4. Chapter 4 - Arithmetic Instructions in Assembly
4.1 Introduction to Arithmetic Instruction
4.2 The ADD Instruction (Addition)
4.3 The SUB Instruction (Subtraction)
4.4 The INC Instruction (Increment)
4.5 The DEC Instruction (Decrement)
4.6 The IMUL and MUL Instructions (Multiplication)
4.7 The IDIV and DIV Instructions (Division)
4.8 Handling numeric data
4.8.1 Algorithm in printing 2 digit numbers
4.8.2 Algorithm in printing 3 digit numbers
4.8.3 Algorithm in accepting 2 digit numbers
4.8.4 Algorithm in accepting 3 digit numbers
4.9 Self-assessment questions
5. Chapter 5 - Flow Control Instructions in Assembly
5.1 Conditional Control
5.1.1 Conditional Jumps
5.1.2 Unconditional Jump
5.2 Loop Control
5.2.1 Conditional Loop
5.2.2 Counter Controlled Loop
5.3 Self-assessment questions
6. Chapter 6 - Stack in Assembly
6.1 Definition of Stack?
6.1.1 PUSH operation
6.1.2 POP operation
6.2 Stack Simulation
6.3 Stack Oriented Program
6.4 Self-assessment questions
7. Chapter 7 - Procedures/Subroutines in Assembly
7.1 Defining a Procedure
7.2 Calling a Procedure
7.3 Procedure Oriented Program
7.4 Self-assessment questions
8. Chapter 8 - More assembly sample programs
8.1 OddEven Program
8.2 Legal Age Program
8.3 Alphabet Program
Answers to self-assessment questions
Disclaimer
Ending Notes
About the Author
List of sample programs:
1. Prints Char 'X'
2. prints 'x' 10times in red text over black BG
3. Prints 2 string variables
4. Clears screen and print a string
5. Sets color attribute on-screen
6. Sets cursor position on-screen
7. Accepts 1 char and prints it 5 times
8. Ask username and prints a welcome message
9. Prints sum of 2 numbers
10. Increments and decrements an entered number
11. Prints the quotient and remainder of entered numbers
12. Prints the sum and product of entered numbers
13. Prints the greatest number from entered numbers
14. Prints 9 to 1 using Loop
15. Prints 1 to 9 using Loop
16. Reverses string using stack
17. Prints number of characters in a string using procedure
18. Checks if entered number is odd or even
19. Checks if entered age is a legal age
20. Checks the vowels, consonants, lower and uppercases in a string
Acknowledgements
The author wishes to express his heartfelt gratitude to the Almighty God for His grace, wisdom, and guidance and for giving the author the determination to write this book. This book would not have been possible without the support and help of several individuals who in one way or another contributed and extended their valuable assistance in the preparation and completion of this material.
Dedication
The author dedicates this book to the ALMIGHTY GOD.
This book is also dedicated to Dennis Ritchie for giving the author the tools to program and to Bill Gates for giving the author the reasons to program.
Chapter 1 - Introduction to Assembly Language
This chapter presents a brief introduction in assembly. The needed concepts in starting assembly programming were discussed to solve computer science related problems.
Definition of Assembly Language
Assembly language is a low-level and the most basic programming language available for any processor. In assembly, a programmer works directly on operations implemented on the computer's processor. Due to the nature of assembly language, it lacks high-level programming convenience since its far from human language like other high-level programming languages does. With assembly language, instructions like JMP @X, MOV AH, 09D, JNZ, DEC and many others are the codes that programmers deals with. At first glance, this codes does not represent any English like words, so learning assembly language can be quite a challenge for beginners. These are called mnemonic codes that represent instructions and unlike other programming languages, in assembly, a certain code can have several meaning or instructions which make it even more difficult.
Any computer has exactly two things on its foundation, a CPU and some Memory. These two makes computer programs run. The CPU reads the numbers one at a time, decodes them, and does what the numbers say, while the memory acts as the temporary storage location for the CPU. In assembly programming, programmers deal with instructions implemented directly on the CPU and memory.
CPU REGISTERS
CPU registers is a quickly accessible location available to a digital processor's central processing unit (CPU). Registers usually consist of a small amount of fast storage, although some registers have specific hardware functions, and may be read-only or write-only. In the CPU (32 bit) Registers, the 32 bit is the leftmost part of the register and the 16 bit is the rightmost part. The 16 bit register is divided into two parts, the higher 8 bit and the lower 8 bit.
