Assembly Language:Simple, Short, And Straightforward Way Of Learning Assembly Programming
2/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/5Assembly Programming:Simple, Short, And Straightforward Way Of Learning Assembly Language Rating: 5 out of 5 stars5/5C++ Programming Language: Simple, Short, and Straightforward Way of Learning C++ Programming Rating: 4 out of 5 stars4/5
Related to Assembly Language:Simple, Short, And Straightforward Way Of Learning Assembly Programming
Related ebooks
C Programming Language Essentials Rating: 4 out of 5 stars4/5C in 30 Pages 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 Programming: C Programming Language for beginners, teaching you how to learn to code in C fast! Rating: 0 out of 5 stars0 ratingsC Programming Concepts Rating: 0 out of 5 stars0 ratingsAssembly Language Coding in Color: ARM and NEON Rating: 0 out of 5 stars0 ratingsLearning Linux Binary Analysis: Learning Linux Binary Analysis Rating: 4 out of 5 stars4/5C Clearly - Programming With C In Linux and On Raspberry Pi Rating: 0 out of 5 stars0 ratingsComputer Programming In C Language Rating: 4 out of 5 stars4/5Programming Concepts in C++ Rating: 0 out of 5 stars0 ratingsLua Game Development Cookbook Rating: 0 out of 5 stars0 ratingsC Programming Language, A Step By Step Beginner's Guide To Learn C Programming In 7 Days. Rating: 4 out of 5 stars4/5Getting Started with LLVM Core Libraries Rating: 0 out of 5 stars0 ratingsBeginning C++ Programming Rating: 3 out of 5 stars3/5C Programming for Beginners: Your Guide to Easily Learn C Programming In 7 Days Rating: 4 out of 5 stars4/5C Programming For Dummies Rating: 0 out of 5 stars0 ratingsC Programming Language Rating: 4 out of 5 stars4/5C++ Learn in 24 Hours Rating: 0 out of 5 stars0 ratingsProgramming for Everyone Rating: 3 out of 5 stars3/5Computer Programming Using C Rating: 0 out of 5 stars0 ratingsC Programming for Arduino Rating: 4 out of 5 stars4/5Computer Science II Essentials Rating: 0 out of 5 stars0 ratingsModern C++ Programming: Including the recent standards C++11, C++17, C++20, C++23 Rating: 0 out of 5 stars0 ratingsC++ Functions and tutorial Rating: 0 out of 5 stars0 ratingsIntroduction to Programming Languages Rating: 4 out of 5 stars4/5Code Beneath the Surface: Mastering Assembly Programming Rating: 0 out of 5 stars0 ratingsPython for Beginners: Learn the Fundamentals of Computer Programming Rating: 0 out of 5 stars0 ratingsBetter Embedded System Software Rating: 0 out of 5 stars0 ratingsDigital Electronics with Arduino: Learn How To Work With Digital Electronics And MicroControllers Rating: 5 out of 5 stars5/5
Computers For You
UX/UI Design Playbook Rating: 4 out of 5 stars4/5The ChatGPT Millionaire Handbook: Make Money Online With the Power of AI Technology Rating: 4 out of 5 stars4/5The Innovators: How a Group of Hackers, Geniuses, and Geeks Created the Digital Revolution Rating: 4 out of 5 stars4/5Mastering ChatGPT: 21 Prompts Templates for Effortless Writing Rating: 4 out of 5 stars4/5Elon Musk Rating: 4 out of 5 stars4/5Data Analytics for Beginners: Introduction to Data Analytics Rating: 4 out of 5 stars4/5Creating Online Courses with ChatGPT | A Step-by-Step Guide with Prompt Templates Rating: 4 out of 5 stars4/5SQL QuickStart Guide: The Simplified Beginner's Guide to Managing, Analyzing, and Manipulating Data With SQL Rating: 4 out of 5 stars4/5CompTIA Security+ Get Certified Get Ahead: SY0-701 Study Guide Rating: 5 out of 5 stars5/5CompTIA IT Fundamentals (ITF+) Study Guide: Exam FC0-U61 Rating: 0 out of 5 stars0 ratingsDeep Search: How to Explore the Internet More Effectively Rating: 5 out of 5 stars5/5The Self-Taught Computer Scientist: The Beginner's Guide to Data Structures & Algorithms Rating: 0 out of 5 stars0 ratingsStorytelling with Data: Let's Practice! Rating: 4 out of 5 stars4/5Becoming a Data Head: How to Think, Speak, and Understand Data Science, Statistics, and Machine Learning Rating: 5 out of 5 stars5/5Everybody Lies: Big Data, New Data, and What the Internet Can Tell Us About Who We Really Are 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/5Quantum Computing For Dummies Rating: 3 out of 5 stars3/5Procreate for Beginners: Introduction to Procreate for Drawing and Illustrating on the iPad Rating: 5 out of 5 stars5/5Learning the Chess Openings Rating: 5 out of 5 stars5/5Excel 101: A Beginner's & Intermediate's Guide for Mastering the Quintessence of Microsoft Excel (2010-2019 & 365) in no time! Rating: 0 out of 5 stars0 ratingsA Quickstart Guide To Becoming A ChatGPT Millionaire: The ChatGPT Book For Beginners (Lazy Money Series®) Rating: 4 out of 5 stars4/5CompTia Security 701: Fundamentals of Security Rating: 0 out of 5 stars0 ratingsComputer Science I Essentials Rating: 5 out of 5 stars5/5The Musician's Ai Handbook: Enhance And Promote Your Music With Artificial Intelligence Rating: 5 out of 5 stars5/5
Reviews for Assembly Language:Simple, Short, And Straightforward Way Of Learning Assembly Programming
1 rating0 reviews
Book preview
Assembly Language:Simple, Short, And Straightforward Way Of Learning Assembly Programming - Sherwyn Allibang
Assembly Language: Simple, Short, And Straightforward Way Of Learning Assembly Programming
Copyright 2016
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 available at https://www.dosbox.com
4. TASM (Assembler) available at http://www.phatcode.net/downloads.php?id=280
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 What is 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 number
4.8.2 Algorithm in printing 3 digit number
4.8.3 Algorithm in accepting 2 digit number
4.8.4 Algorithm in accepting 3 digit number
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 What is 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 and the needed concepts in starting assembly programming to solve computer science related problems.
What is Assembly Language?
Assembly language is a low-level and the most basic programming language available for any processor. In assembly, programmers 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 mnemonic codes that represents instructions and unlike other programming languages, in assembly, a certain code can represent several instructions or meaning which makes 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