Discover millions of ebooks, audiobooks, and so much more with a free trial

Only $11.99/month after trial. Cancel anytime.

Assembly Programming:Simple, Short, And Straightforward Way Of Learning Assembly Language
Assembly Programming:Simple, Short, And Straightforward Way Of Learning Assembly Language
Assembly Programming:Simple, Short, And Straightforward Way Of Learning Assembly Language
Ebook199 pages1 hour

Assembly Programming:Simple, Short, And Straightforward Way Of Learning Assembly Language

Rating: 5 out of 5 stars

5/5

()

Read preview

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.

LanguageEnglish
Release dateJun 9, 2020
ISBN9780463281383
Assembly Programming:Simple, Short, And Straightforward Way Of Learning Assembly Language
Author

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

Related to Assembly Programming:Simple, Short, And Straightforward Way Of Learning Assembly Language

Related ebooks

Computers For You

View More

Related articles

Reviews for Assembly Programming:Simple, Short, And Straightforward Way Of Learning Assembly Language

Rating: 5 out of 5 stars
5/5

1 rating0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    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.

    Enjoying the preview?
    Page 1 of 1