SlideShare une entreprise Scribd logo
1  sur  7
(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

Contenu connexe

Similaire à Lab 5 - String Manipulation usingTASM Environment-1.docx

Programming basic computer
Programming basic computerProgramming basic computer
Programming basic computer
Martial Kouadio
 
Lec 04 intro assembly
Lec 04 intro assemblyLec 04 intro assembly
Lec 04 intro assembly
Abdul Khan
 
cmp104 lec 8
cmp104 lec 8cmp104 lec 8
cmp104 lec 8
kapil078
 
C programming session 01
C programming session 01C programming session 01
C programming session 01
Dushmanta Nath
 
Unit 3 assembler and processor
Unit 3   assembler and processorUnit 3   assembler and processor
Unit 3 assembler and processor
Abha Damani
 

Similaire à Lab 5 - String Manipulation usingTASM Environment-1.docx (20)

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)
 
MASM -UNIT-III
MASM -UNIT-IIIMASM -UNIT-III
MASM -UNIT-III
 
cmp104 lec 8
cmp104 lec 8cmp104 lec 8
cmp104 lec 8
 
Input-output
Input-outputInput-output
Input-output
 
Microprocessor chapter 9 - assembly language programming
Microprocessor  chapter 9 - assembly language programmingMicroprocessor  chapter 9 - assembly language programming
Microprocessor chapter 9 - assembly language programming
 
Instruction set of 8086
Instruction set of 8086Instruction set of 8086
Instruction set of 8086
 
C programming session 01
C programming session 01C programming session 01
C programming session 01
 
Unit 3 assembler and processor
Unit 3   assembler and processorUnit 3   assembler and processor
Unit 3 assembler and processor
 

Plus de CCSSenatorAbogadoAj

Plus de 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
 

Dernier

pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
JOHNBEBONYAP1
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
imonikaupta
 
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
@Chandigarh #call #Girls 9053900678 @Call #Girls in @Punjab 9053900678
 
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men 🔝mehsana🔝 Escorts...
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men  🔝mehsana🔝   Escorts...➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men  🔝mehsana🔝   Escorts...
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men 🔝mehsana🔝 Escorts...
nirzagarg
 

Dernier (20)

VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
 
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
 
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls DubaiDubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
 
Katraj ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For S...
Katraj ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For S...Katraj ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For S...
Katraj ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For S...
 
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
 
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdfpdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
pdfcoffee.com_business-ethics-q3m7-pdf-free.pdf
 
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirt
 
20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf
 
Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...
Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...
Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...
 
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
 
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
 
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
 
APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53APNIC Updates presented by Paul Wilson at ARIN 53
APNIC Updates presented by Paul Wilson at ARIN 53
 
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men 🔝mehsana🔝 Escorts...
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men  🔝mehsana🔝   Escorts...➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men  🔝mehsana🔝   Escorts...
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men 🔝mehsana🔝 Escorts...
 
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
 

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.> ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||