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:Simple, Short, And Straightforward Way Of Learning Assembly Programming Rating: 2 out of 5 stars2/5Assembly Language Coding in Color: ARM and NEON Rating: 0 out of 5 stars0 ratingsC Programming Concepts Rating: 0 out of 5 stars0 ratingsPractical Reverse Engineering: x86, x64, ARM, Windows Kernel, Reversing Tools, and Obfuscation Rating: 0 out of 5 stars0 ratingsC Programming Language Essentials Rating: 4 out of 5 stars4/5C in 30 Pages Rating: 5 out of 5 stars5/5Programming Concepts in C++ Rating: 0 out of 5 stars0 ratingsC Programming for the Pc the Mac and the Arduino Microcontroller System Rating: 0 out of 5 stars0 ratingsC Programming Language 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 ratingsComputer Programming In C Language Rating: 4 out of 5 stars4/5Begin & Master Programming with C Fundamentals Rating: 0 out of 5 stars0 ratingsThe Art of Assembly Language Programming Using PIC® Technology: Core Fundamentals Rating: 0 out of 5 stars0 ratingsUpdate to Modern C++ Rating: 0 out of 5 stars0 ratingsC Programming For Beginners: The Simple Guide to Learning C Programming Language Fast! Rating: 5 out of 5 stars5/5Embedded C Programming: Techniques and Applications of C and PIC MCUS Rating: 3 out of 5 stars3/5C Programming Language The Beginner’s Guide Rating: 0 out of 5 stars0 ratingsComputer Programming Using C Rating: 0 out of 5 stars0 ratingsLearn C Programming in 24 Hours Rating: 0 out of 5 stars0 ratingsComputer Practices Using C++ Rating: 0 out of 5 stars0 ratingsProblem Solving in C and Python: Programming Exercises and Solutions, Part 1 Rating: 5 out of 5 stars5/5Microsoft Visual C++ Windows Applications by Example Rating: 4 out of 5 stars4/5Bash for Fun: Bash Programming: Principles and Examples Rating: 0 out of 5 stars0 ratingsRust In Practice Rating: 0 out of 5 stars0 ratingsAdvanced Turbo C Programming Rating: 5 out of 5 stars5/5Programming in C | Step by Step: The Simple Beginner's Guide Rating: 0 out of 5 stars0 ratingsIntroduction to Programming Languages Rating: 4 out of 5 stars4/5Programming with 64-Bit ARM Assembly Language: Single Board Computer Development for Raspberry Pi and Mobile Devices Rating: 0 out of 5 stars0 ratingsFundamentals of Programming: Using Python Rating: 5 out of 5 stars5/5
Computers For You
The Invisible Rainbow: A History of Electricity and Life Rating: 4 out of 5 stars4/5101 Awesome Builds: Minecraft® Secrets from the World's Greatest Crafters Rating: 4 out of 5 stars4/5Slenderman: Online Obsession, Mental Illness, and the Violent Crime of Two Midwestern Girls Rating: 4 out of 5 stars4/5Standard Deviations: Flawed Assumptions, Tortured Data, and Other Ways to Lie with Statistics Rating: 4 out of 5 stars4/5Mastering ChatGPT: 21 Prompts Templates for Effortless Writing Rating: 5 out of 5 stars5/5The ChatGPT Millionaire Handbook: Make Money Online With the Power of AI Technology Rating: 0 out of 5 stars0 ratingsDark Aeon: Transhumanism and the War Against Humanity Rating: 5 out of 5 stars5/5Elon Musk Rating: 4 out of 5 stars4/5Everybody Lies: Big Data, New Data, and What the Internet Can Tell Us About Who We Really Are Rating: 4 out of 5 stars4/5How to Create Cpn Numbers the Right way: A Step by Step Guide to Creating cpn Numbers Legally Rating: 4 out of 5 stars4/5The Hacker Crackdown: Law and Disorder on the Electronic Frontier 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/5Procreate for Beginners: Introduction to Procreate for Drawing and Illustrating on the iPad Rating: 0 out of 5 stars0 ratingsCompTIA IT Fundamentals (ITF+) Study Guide: Exam FC0-U61 Rating: 0 out of 5 stars0 ratingsThe Professional Voiceover Handbook: Voiceover training, #1 Rating: 5 out of 5 stars5/5Creating Online Courses with ChatGPT | A Step-by-Step Guide with Prompt Templates Rating: 4 out of 5 stars4/5Grokking Algorithms: An illustrated guide for programmers and other curious people Rating: 4 out of 5 stars4/5The Mega Box: The Ultimate Guide to the Best Free Resources on the Internet Rating: 4 out of 5 stars4/5Deep Search: How to Explore the Internet More Effectively Rating: 5 out of 5 stars5/5CompTIA Security+ Practice Questions Rating: 2 out of 5 stars2/5Alan Turing: The Enigma: The Book That Inspired the Film The Imitation Game - Updated Edition Rating: 4 out of 5 stars4/5ChatGPT Ultimate User Guide - How to Make Money Online Faster and More Precise Using AI Technology Rating: 0 out of 5 stars0 ratingsThe Data Warehouse Toolkit: The Definitive Guide to Dimensional Modeling Rating: 0 out of 5 stars0 ratingsUltimate Guide to Mastering Command Blocks!: Minecraft Keys to Unlocking Secret Commands Rating: 5 out of 5 stars5/5Practical Lock Picking: A Physical Penetration Tester's Training Guide Rating: 5 out of 5 stars5/5
Reviews for Assembly Programming:Simple, Short, And Straightforward Way Of Learning Assembly Language
1 rating0 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.