SlideShare a Scribd company logo
(COMPUTER SYSTEMS AND PLATFORM
TECHNOLOGIES)
EXERCISE
5
String Manipulation using TASM Environment
ROBIN VIDAL Name of Professor
Data Performed Date Submitted
OBJECTIVES:
1. To create a program in assembler using the TASM or Turbo Assembler
2. To learn how to process string in assembly language programming using the data types and
data definition, and the string input and output subroutines
DISCUSSION:
The assembler supports all the various data types of the 80x86microprocessor by providing data
directives that define the data types and set aside memory for them.
Assembler data directives:
 ORG (origin)
ORG is used to indicate the beginning of the offset address. The number that c
o
m
e
s
after ORG
can either in hex or in decimal
 DB (define byte)
It allows allocation of memory in byte – seized chunks. This is indeed the s
m
a
l
l
e
s
t allocation unit
permitted. DB can be used to define numbers in decimal, binary, hexadecimal, and ASCII. For
decimal, the D after the decimal number is optional, but using B(binary), and H (hexadecimal) for the
others is required. Using ASCII, simply place it in single/double quotation m arks for indication.
 DUP (duplicate)
DUPisusedtoduplicateagivennumberofcharacters.Thiscanavoidalotoft
y
p
i
n
g
.
 EQU (equate)
This is used to define a constant without occupying a memory location. EQU d
o
e
s
not set
aside storage for data item but associates a constant value with a data label so that when the label
appears inthe program; itsconstant value will be substitutedfor thelabel.
 DD (define double-word)
TheDDdirectiveisusedtoallocatememorythatare4bytes(twowords)insize.
 DQ (define quad-word)
DQ is used to allocate memory 8 bytes (four words) in size.
 DT (define ten bytes)
DT is used for memory allocation of packed BCD numbers.
String Input and Output Routines
Function : String Output
Purpose : Sends a string of characters to the standard output device (monitor). On
Entry : AH = 09H
DS = segment address of the first character of the string DX =
offset address of the first character of the string
On Exit : None
Note: Function 09 displays a string of characters starting with the first character (address in
DS:DX) output, but not including the character “$”.
Function : Buffered Keyboard Input
Purpose : Reads a string of characters from the keyboard and places it in a buffer. On
Entry : AH = 0AH
DS = segment address of the input buffer DX
= offset address of the input buffer
On Exit : String in buffer at DS:DX
PROCEDURE:
1. In the current DOS window for TASM, change to the drive and/or directory where your program is
located.
2. In the current directory, type edit tasm to activate the assembler TASM. Write the following sample
program.
.MODEL SMALL
.STACK
.DATA
var db ’This is a sample program using data types and data definition…’,13,10,’$’
.CODE
START:
MOV AX, @DATA
MOV DS,AX
MOV AH,09
LEA DX, var
INT 21H
MOV AH, 4CH
INT 21H
END START
3. Execute the given program. What is the output?
4. Explain the flow of the program.
- The flow of the program is you have to declare first what is the output and then create new location
for it and just repeat the program you have created until you are down to the last variable
SUPPLEMENTARY PROBLEM:
Develop a program that will produce the given output below. Save your file as
resume[surname].asm, assemble then run the program in the command prompt.
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
<name>
<address>
<contact no.>
<e-mail add.>
Birthday:
Birthplace:
Civil Status:
Father:
Mother:
Age:
Citizenship:
Religion:
Occupation:
Occupation:
EDUCATIONAL BACKGROUND:
Primary:
Secondary:
Tertiary:
CHARACTER REFERENCES:
<name>, <position>
<address>,<contact no.>
<name>, <position>
<address>,<contact no.>
<name>, <position>
<address>,<contact no.>
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SCREENSHOTS
Lab 5 - String Manipulation usingTASM Environment-1.docx

More Related Content

Similar to Lab 5 - String Manipulation usingTASM Environment-1.docx

Stack and subroutine
Stack and subroutineStack and subroutine
Stack and subroutineAshim Saha
 
Part III: Assembly Language
Part III: Assembly LanguagePart III: Assembly Language
Part III: Assembly LanguageAhmed M. Abed
 
Chapter 3 programming concepts-ii
Chapter 3  programming concepts-iiChapter 3  programming concepts-ii
Chapter 3 programming concepts-ii
SHREEHARI WADAWADAGI
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Bilal Amjad
 
Programming basic computer
Programming basic computerProgramming basic computer
Programming basic computerMartial Kouadio
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Bilal Amjad
 
7986-lect 7.pdf
7986-lect 7.pdf7986-lect 7.pdf
7986-lect 7.pdf
RiazAhmad521284
 
Chapter 2 programming concepts - I
Chapter 2  programming concepts - IChapter 2  programming concepts - I
Chapter 2 programming concepts - I
SHREEHARI WADAWADAGI
 
Assembly Language Basics
Assembly Language BasicsAssembly Language Basics
Assembly Language Basics
Education Front
 
Introduction of 8086 micro processor .
Introduction of 8086 micro processor .Introduction of 8086 micro processor .
Introduction of 8086 micro processor .
Siraj Ahmed
 
Lec 04 intro assembly
Lec 04 intro assemblyLec 04 intro assembly
Lec 04 intro assemblyAbdul Khan
 
X86 assembly nasm syntax
X86 assembly nasm syntaxX86 assembly nasm syntax
X86 assembly nasm syntax
Francesco DiFusco
 
Draft sas and r and sas (may, 2018 asa meeting)
Draft sas and r and sas (may, 2018 asa meeting)Draft sas and r and sas (may, 2018 asa meeting)
Draft sas and r and sas (may, 2018 asa meeting)
Barry DeCicco
 

Similar to Lab 5 - String Manipulation usingTASM Environment-1.docx (20)

Stack and subroutine
Stack and subroutineStack and subroutine
Stack and subroutine
 
Wk1to4
Wk1to4Wk1to4
Wk1to4
 
Part III: Assembly Language
Part III: Assembly LanguagePart III: Assembly Language
Part III: Assembly Language
 
Chapter 3 programming concepts-ii
Chapter 3  programming concepts-iiChapter 3  programming concepts-ii
Chapter 3 programming concepts-ii
 
Alp 05
Alp 05Alp 05
Alp 05
 
Alp 05
Alp 05Alp 05
Alp 05
 
Alp 05
Alp 05Alp 05
Alp 05
 
Chap03[1]
Chap03[1]Chap03[1]
Chap03[1]
 
20 -miscellaneous
20  -miscellaneous20  -miscellaneous
20 -miscellaneous
 
Mp lab manual
Mp lab manualMp lab manual
Mp lab manual
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
 
Programming basic computer
Programming basic computerProgramming basic computer
Programming basic computer
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
Assembly Language Programming By Ytha Yu, Charles Marut Chap 4 (Introduction ...
 
7986-lect 7.pdf
7986-lect 7.pdf7986-lect 7.pdf
7986-lect 7.pdf
 
Chapter 2 programming concepts - I
Chapter 2  programming concepts - IChapter 2  programming concepts - I
Chapter 2 programming concepts - I
 
Assembly Language Basics
Assembly Language BasicsAssembly Language Basics
Assembly Language Basics
 
Introduction of 8086 micro processor .
Introduction of 8086 micro processor .Introduction of 8086 micro processor .
Introduction of 8086 micro processor .
 
Lec 04 intro assembly
Lec 04 intro assemblyLec 04 intro assembly
Lec 04 intro assembly
 
X86 assembly nasm syntax
X86 assembly nasm syntaxX86 assembly nasm syntax
X86 assembly nasm syntax
 
Draft sas and r and sas (may, 2018 asa meeting)
Draft sas and r and sas (may, 2018 asa meeting)Draft sas and r and sas (may, 2018 asa meeting)
Draft sas and r and sas (may, 2018 asa meeting)
 

More from CCSSenatorAbogadoAj

Diving Deep for Synonyms and Antonyms.pdf
Diving Deep for Synonyms and Antonyms.pdfDiving Deep for Synonyms and Antonyms.pdf
Diving Deep for Synonyms and Antonyms.pdf
CCSSenatorAbogadoAj
 
Presentation1.pptx
Presentation1.pptxPresentation1.pptx
Presentation1.pptx
CCSSenatorAbogadoAj
 
Hannok_Wanwisa_Spring-202011.pdf
Hannok_Wanwisa_Spring-202011.pdfHannok_Wanwisa_Spring-202011.pdf
Hannok_Wanwisa_Spring-202011.pdf
CCSSenatorAbogadoAj
 
Job Matching Experiences of Cotabato State University (CSU) Public Administra...
Job Matching Experiences of Cotabato State University (CSU) Public Administra...Job Matching Experiences of Cotabato State University (CSU) Public Administra...
Job Matching Experiences of Cotabato State University (CSU) Public Administra...
CCSSenatorAbogadoAj
 
Jenjen-Done..docx
Jenjen-Done..docxJenjen-Done..docx
Jenjen-Done..docx
CCSSenatorAbogadoAj
 
local_media5375011518898876798.docx
local_media5375011518898876798.docxlocal_media5375011518898876798.docx
local_media5375011518898876798.docx
CCSSenatorAbogadoAj
 
Justification.docx
Justification.docxJustification.docx
Justification.docx
CCSSenatorAbogadoAj
 
Environmental Awareness and Practices-RESEARCH.docx
Environmental Awareness and Practices-RESEARCH.docxEnvironmental Awareness and Practices-RESEARCH.docx
Environmental Awareness and Practices-RESEARCH.docx
CCSSenatorAbogadoAj
 
AU-Project-Report-Fulltext-132299.PDF
AU-Project-Report-Fulltext-132299.PDFAU-Project-Report-Fulltext-132299.PDF
AU-Project-Report-Fulltext-132299.PDF
CCSSenatorAbogadoAj
 
Activity-Shella.docx
Activity-Shella.docxActivity-Shella.docx
Activity-Shella.docx
CCSSenatorAbogadoAj
 
azrael_activity.docx
azrael_activity.docxazrael_activity.docx
azrael_activity.docx
CCSSenatorAbogadoAj
 
argumentative essay on the issue of the government's transport modernization ...
argumentative essay on the issue of the government's transport modernization ...argumentative essay on the issue of the government's transport modernization ...
argumentative essay on the issue of the government's transport modernization ...
CCSSenatorAbogadoAj
 
Ayumi_Activity.docx
Ayumi_Activity.docxAyumi_Activity.docx
Ayumi_Activity.docx
CCSSenatorAbogadoAj
 
Activity_100pesos.docx
Activity_100pesos.docxActivity_100pesos.docx
Activity_100pesos.docx
CCSSenatorAbogadoAj
 
Activity1&2.docx
Activity1&2.docxActivity1&2.docx
Activity1&2.docx
CCSSenatorAbogadoAj
 
UPCAT_Reviewer_2021_2022.docx
UPCAT_Reviewer_2021_2022.docxUPCAT_Reviewer_2021_2022.docx
UPCAT_Reviewer_2021_2022.docx
CCSSenatorAbogadoAj
 
Weekly Assessment # 2.pdf
Weekly Assessment # 2.pdfWeekly Assessment # 2.pdf
Weekly Assessment # 2.pdf
CCSSenatorAbogadoAj
 
Weekly Assessment # 2.docx
Weekly Assessment # 2.docxWeekly Assessment # 2.docx
Weekly Assessment # 2.docx
CCSSenatorAbogadoAj
 

More from CCSSenatorAbogadoAj (19)

Diving Deep for Synonyms and Antonyms.pdf
Diving Deep for Synonyms and Antonyms.pdfDiving Deep for Synonyms and Antonyms.pdf
Diving Deep for Synonyms and Antonyms.pdf
 
Presentation1.pptx
Presentation1.pptxPresentation1.pptx
Presentation1.pptx
 
out.pdf
out.pdfout.pdf
out.pdf
 
Hannok_Wanwisa_Spring-202011.pdf
Hannok_Wanwisa_Spring-202011.pdfHannok_Wanwisa_Spring-202011.pdf
Hannok_Wanwisa_Spring-202011.pdf
 
Job Matching Experiences of Cotabato State University (CSU) Public Administra...
Job Matching Experiences of Cotabato State University (CSU) Public Administra...Job Matching Experiences of Cotabato State University (CSU) Public Administra...
Job Matching Experiences of Cotabato State University (CSU) Public Administra...
 
Jenjen-Done..docx
Jenjen-Done..docxJenjen-Done..docx
Jenjen-Done..docx
 
local_media5375011518898876798.docx
local_media5375011518898876798.docxlocal_media5375011518898876798.docx
local_media5375011518898876798.docx
 
Justification.docx
Justification.docxJustification.docx
Justification.docx
 
Environmental Awareness and Practices-RESEARCH.docx
Environmental Awareness and Practices-RESEARCH.docxEnvironmental Awareness and Practices-RESEARCH.docx
Environmental Awareness and Practices-RESEARCH.docx
 
AU-Project-Report-Fulltext-132299.PDF
AU-Project-Report-Fulltext-132299.PDFAU-Project-Report-Fulltext-132299.PDF
AU-Project-Report-Fulltext-132299.PDF
 
Activity-Shella.docx
Activity-Shella.docxActivity-Shella.docx
Activity-Shella.docx
 
azrael_activity.docx
azrael_activity.docxazrael_activity.docx
azrael_activity.docx
 
argumentative essay on the issue of the government's transport modernization ...
argumentative essay on the issue of the government's transport modernization ...argumentative essay on the issue of the government's transport modernization ...
argumentative essay on the issue of the government's transport modernization ...
 
Ayumi_Activity.docx
Ayumi_Activity.docxAyumi_Activity.docx
Ayumi_Activity.docx
 
Activity_100pesos.docx
Activity_100pesos.docxActivity_100pesos.docx
Activity_100pesos.docx
 
Activity1&2.docx
Activity1&2.docxActivity1&2.docx
Activity1&2.docx
 
UPCAT_Reviewer_2021_2022.docx
UPCAT_Reviewer_2021_2022.docxUPCAT_Reviewer_2021_2022.docx
UPCAT_Reviewer_2021_2022.docx
 
Weekly Assessment # 2.pdf
Weekly Assessment # 2.pdfWeekly Assessment # 2.pdf
Weekly Assessment # 2.pdf
 
Weekly Assessment # 2.docx
Weekly Assessment # 2.docxWeekly Assessment # 2.docx
Weekly Assessment # 2.docx
 

Recently uploaded

BASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptxBASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptx
natyesu
 
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
3ipehhoa
 
1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...
JeyaPerumal1
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
3ipehhoa
 
ER(Entity Relationship) Diagram for online shopping - TAE
ER(Entity Relationship) Diagram for online shopping - TAEER(Entity Relationship) Diagram for online shopping - TAE
ER(Entity Relationship) Diagram for online shopping - TAE
Himani415946
 
The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
laozhuseo02
 
Latest trends in computer networking.pptx
Latest trends in computer networking.pptxLatest trends in computer networking.pptx
Latest trends in computer networking.pptx
JungkooksNonexistent
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
3ipehhoa
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
Arif0071
 
This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!
nirahealhty
 
Output determination SAP S4 HANA SAP SD CC
Output determination SAP S4 HANA SAP SD CCOutput determination SAP S4 HANA SAP SD CC
Output determination SAP S4 HANA SAP SD CC
ShahulHameed54211
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Sanjeev Rampal
 
How to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptxHow to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptx
Gal Baras
 
guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
Rogerio Filho
 
Living-in-IT-era-Module-7-Imaging-and-Design-for-Social-Impact.pptx
Living-in-IT-era-Module-7-Imaging-and-Design-for-Social-Impact.pptxLiving-in-IT-era-Module-7-Imaging-and-Design-for-Social-Impact.pptx
Living-in-IT-era-Module-7-Imaging-and-Design-for-Social-Impact.pptx
TristanJasperRamos
 
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
laozhuseo02
 

Recently uploaded (16)

BASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptxBASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptx
 
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
 
1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
 
ER(Entity Relationship) Diagram for online shopping - TAE
ER(Entity Relationship) Diagram for online shopping - TAEER(Entity Relationship) Diagram for online shopping - TAE
ER(Entity Relationship) Diagram for online shopping - TAE
 
The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
 
Latest trends in computer networking.pptx
Latest trends in computer networking.pptxLatest trends in computer networking.pptx
Latest trends in computer networking.pptx
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
 
This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!
 
Output determination SAP S4 HANA SAP SD CC
Output determination SAP S4 HANA SAP SD CCOutput determination SAP S4 HANA SAP SD CC
Output determination SAP S4 HANA SAP SD CC
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
 
How to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptxHow to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptx
 
guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
 
Living-in-IT-era-Module-7-Imaging-and-Design-for-Social-Impact.pptx
Living-in-IT-era-Module-7-Imaging-and-Design-for-Social-Impact.pptxLiving-in-IT-era-Module-7-Imaging-and-Design-for-Social-Impact.pptx
Living-in-IT-era-Module-7-Imaging-and-Design-for-Social-Impact.pptx
 
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
 

Lab 5 - String Manipulation usingTASM Environment-1.docx

  • 1. (COMPUTER SYSTEMS AND PLATFORM TECHNOLOGIES) EXERCISE 5 String Manipulation using TASM Environment ROBIN VIDAL Name of Professor Data Performed Date Submitted
  • 2. OBJECTIVES: 1. To create a program in assembler using the TASM or Turbo Assembler 2. To learn how to process string in assembly language programming using the data types and data definition, and the string input and output subroutines DISCUSSION: The assembler supports all the various data types of the 80x86microprocessor by providing data directives that define the data types and set aside memory for them. Assembler data directives:  ORG (origin) ORG is used to indicate the beginning of the offset address. The number that c o m e s after ORG can either in hex or in decimal  DB (define byte) It allows allocation of memory in byte – seized chunks. This is indeed the s m a l l e s t allocation unit permitted. DB can be used to define numbers in decimal, binary, hexadecimal, and ASCII. For decimal, the D after the decimal number is optional, but using B(binary), and H (hexadecimal) for the others is required. Using ASCII, simply place it in single/double quotation m arks for indication.  DUP (duplicate) DUPisusedtoduplicateagivennumberofcharacters.Thiscanavoidalotoft y p i n g .  EQU (equate) This is used to define a constant without occupying a memory location. EQU d o e s not set aside storage for data item but associates a constant value with a data label so that when the label appears inthe program; itsconstant value will be substitutedfor thelabel.  DD (define double-word) TheDDdirectiveisusedtoallocatememorythatare4bytes(twowords)insize.  DQ (define quad-word) DQ is used to allocate memory 8 bytes (four words) in size.  DT (define ten bytes) DT is used for memory allocation of packed BCD numbers. String Input and Output Routines Function : String Output Purpose : Sends a string of characters to the standard output device (monitor). On Entry : AH = 09H DS = segment address of the first character of the string DX = offset address of the first character of the string On Exit : None
  • 3. Note: Function 09 displays a string of characters starting with the first character (address in DS:DX) output, but not including the character “$”. Function : Buffered Keyboard Input Purpose : Reads a string of characters from the keyboard and places it in a buffer. On Entry : AH = 0AH DS = segment address of the input buffer DX = offset address of the input buffer On Exit : String in buffer at DS:DX PROCEDURE: 1. In the current DOS window for TASM, change to the drive and/or directory where your program is located. 2. In the current directory, type edit tasm to activate the assembler TASM. Write the following sample program. .MODEL SMALL .STACK .DATA var db ’This is a sample program using data types and data definition…’,13,10,’$’ .CODE START: MOV AX, @DATA MOV DS,AX MOV AH,09 LEA DX, var INT 21H MOV AH, 4CH INT 21H END START
  • 4. 3. Execute the given program. What is the output?
  • 5. 4. Explain the flow of the program. - The flow of the program is you have to declare first what is the output and then create new location for it and just repeat the program you have created until you are down to the last variable SUPPLEMENTARY PROBLEM: Develop a program that will produce the given output below. Save your file as resume[surname].asm, assemble then run the program in the command prompt. ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| <name> <address> <contact no.> <e-mail add.> Birthday: Birthplace: Civil Status: Father: Mother: Age: Citizenship: Religion: Occupation: Occupation: EDUCATIONAL BACKGROUND: Primary: Secondary: Tertiary: CHARACTER REFERENCES: <name>, <position> <address>,<contact no.> <name>, <position> <address>,<contact no.> <name>, <position> <address>,<contact no.> ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||