SlideShare une entreprise Scribd logo
1  sur  14
 To write a menu driven ALP program for file
handling.
 By including options like creating a file and typing
the contents of the file.
 Also displaying the current system date and time.
AGENDA:
INTERRUPT : FUNCTION PURPOSE
INT21H:FUNCTION 2AH GET SYSTEM TIME
INT21H:FUNCTION 2CH GET SYSTEM DATE
INT21H:FUNCTION 3CH CREATE FILE
INT 21H:FUNCTION 3DH OPEN FILE
INT21H:FUNCTION 3EH CLOSE FILE
INT21H:FUNCTION 3FH READ FILE
INT21H:FUNCTION 40H WRITE FILE
INT21H:FUNCTION 41H DELETE FILE
INT21H:FUNCTION 09H PRINT ON THE STRING
FUNCTION OF INT 21H USED IN FILE
HANDLING:
 AH=2Ah
Returns : CX=YEAR
DH=MONTH(1 TO 12)
DL=DAY OF MONTH(1 TO 31)
AL=DAY NUMBER IN WEEK(0-6 SUNDAY TO
SATURDAY)
FUNCTION 2AH-GET SYSTEM TIME:
 AH=2Ch
Returns : CH=HOUR(0 TO 59)
CL=MINUTE(0 TO 59)
DH=SECOND(0 TO 59)
DL=CENTISECONDS(0 TO 99)
 AH = 3Ch
 DS:DX = address of filename
 CL = attribute
 If successful, AX = file handle IF NOT CF=1
 When a file is created or opened in a program, DOS assigns it a
unique number called the FILE HANDLE.
 This number is used to identify the file.
FUNCTION 3CH-TO CREATE
FILE
 AH = 3Dh
◦ AL=Access Mode
 AH =4OH
 BX =Handle
 CX =No Of Bytes To Write
 DS:DX =Segment:Offset Of Buffer
 If successful then
 AX =Bytes Transferred
 AH = 3Fh
 BX = File Handle
 CX = Number Of Bytes To Read
 DS:DX = Memory Buffer Address
 AX = Count Of Bytes Actually Read
FUNCTION 40H-TO WRITE FILE:
START
READ FILENAME
WITH
EXTENSION
MOV OFFSET OF
FILENAME TO DX
MOV APPROPRIATE
LENGTH OF FILE NAME
TO CX
PROGRAM
MOV APPROPRIATE
FUNCTION CALL(3CH) TO AH
CALL INT 21H
END PROC & RET TO MAIN R
CREATE
FILE
CHEC
K CF
IF NOT SET
PRINT ERROR
MSG
START
MOV OFFSET OF
FILENAME TO DX
PROGRAM
MOV APPROPRIATE
FUNCTION (41H) CALL TO
AH
CALL INT 21H
DELETE
FILE
END PROC & RET TO MAIN
CHEC
K CF
IF NOT SET
PRINT ERROR
MSG
START
READ DATA TO
BE WRITTEN
MOV OFFSET OF
FILENAME TO DX
MOV APPROPRIATE
LENGTH OF FILE NAME
TO CX
PROGRAM
MOV APPROPRIATE
FUNCTION CALL(3CH) TO AH
CALL INT 21H
END PROC & RET
TO MAIN
R
WRIT INTO
FILE
CHECK FOR CARRY FLAG
START
MOV OFFSET OF
FILENAME TO
DX
READ DATA
FROM FILE BYTE
BY BYTE
OPEN THE FILE IN READ
MODE
PROGRAM
WHEN EOF IS REACHED,
CLOSE THE FILE
PRINT THE DATA
END PROC & RET
TO MAIN
R
READ FROM
FILE
START
MOV OFFSET OF
STRING VAR TO
BX
CALL INT 21H
MOV APPROPRIATE
FUNCTION CALL(2CH) TO
AH
PROGRAM
DECODE THE HEX VALUES
TO DECIMAN
PRINT THE TIME IN
PROPER FORMAY
END PROC & RET
TO MAIN
R
READ SYSTEM
TIME &
DISPLAY
START
MOV OFFSET OF
STRING VAR TO
BX
CALL INT 21H
MOV APPROPRIATE
FUNCTION CALL(2AH) TO
AH
PROGRAM
DECODE THE HEX VALUES
TO DECIMAN
PRINT THE TIME IN
PROPER FORMAY
END PROC & RET
TO MAIN
R
READ SYSTEM
DATE &
DISPLAY
File  handling    functions

Contenu connexe

Tendances

Assembly language (coal)
Assembly language (coal)Assembly language (coal)
Assembly language (coal)Hareem Aslam
 
Single pass assembler
Single pass assemblerSingle pass assembler
Single pass assemblerBansari Shah
 
Introduction to loaders
Introduction to loadersIntroduction to loaders
Introduction to loadersTech_MX
 
Addressing Modes Of 8086
Addressing Modes Of 8086Addressing Modes Of 8086
Addressing Modes Of 8086Ikhlas Rahman
 
Addressing Modes
Addressing ModesAddressing Modes
Addressing ModesMayank Garg
 
Code generation in Compiler Design
Code generation in Compiler DesignCode generation in Compiler Design
Code generation in Compiler DesignKuppusamy P
 
Assembly Language Lecture 1
Assembly Language Lecture 1Assembly Language Lecture 1
Assembly Language Lecture 1Motaz Saad
 
8086-instruction-set-ppt
 8086-instruction-set-ppt 8086-instruction-set-ppt
8086-instruction-set-pptjemimajerome
 
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...warda aziz
 
Critical section problem in operating system.
Critical section problem in operating system.Critical section problem in operating system.
Critical section problem in operating system.MOHIT DADU
 
CS304PC:Computer Organization and Architecture Session 11 general register or...
CS304PC:Computer Organization and Architecture Session 11 general register or...CS304PC:Computer Organization and Architecture Session 11 general register or...
CS304PC:Computer Organization and Architecture Session 11 general register or...Asst.prof M.Gokilavani
 
8 memory management strategies
8 memory management strategies8 memory management strategies
8 memory management strategiesDr. Loganathan R
 
Assemblers: Ch03
Assemblers: Ch03Assemblers: Ch03
Assemblers: Ch03desta_gebre
 

Tendances (20)

Assembly language (coal)
Assembly language (coal)Assembly language (coal)
Assembly language (coal)
 
Single pass assembler
Single pass assemblerSingle pass assembler
Single pass assembler
 
Introduction to loaders
Introduction to loadersIntroduction to loaders
Introduction to loaders
 
Linker and Loader
Linker and Loader Linker and Loader
Linker and Loader
 
Addressing Modes Of 8086
Addressing Modes Of 8086Addressing Modes Of 8086
Addressing Modes Of 8086
 
Subroutine
SubroutineSubroutine
Subroutine
 
Addressing Modes
Addressing ModesAddressing Modes
Addressing Modes
 
Instruction format
Instruction formatInstruction format
Instruction format
 
Code generation in Compiler Design
Code generation in Compiler DesignCode generation in Compiler Design
Code generation in Compiler Design
 
Assembly Language Lecture 1
Assembly Language Lecture 1Assembly Language Lecture 1
Assembly Language Lecture 1
 
8086-instruction-set-ppt
 8086-instruction-set-ppt 8086-instruction-set-ppt
8086-instruction-set-ppt
 
Code generation
Code generationCode generation
Code generation
 
loaders and linkers
 loaders and linkers loaders and linkers
loaders and linkers
 
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...
Chap 8 The stack and introduction to procedures & Chapter 9 multiplication an...
 
Critical section problem in operating system.
Critical section problem in operating system.Critical section problem in operating system.
Critical section problem in operating system.
 
CS304PC:Computer Organization and Architecture Session 11 general register or...
CS304PC:Computer Organization and Architecture Session 11 general register or...CS304PC:Computer Organization and Architecture Session 11 general register or...
CS304PC:Computer Organization and Architecture Session 11 general register or...
 
8 memory management strategies
8 memory management strategies8 memory management strategies
8 memory management strategies
 
Assemblers
AssemblersAssemblers
Assemblers
 
Assemblers: Ch03
Assemblers: Ch03Assemblers: Ch03
Assemblers: Ch03
 
Interrupts
InterruptsInterrupts
Interrupts
 

En vedette

14 file handling
14 file handling14 file handling
14 file handlingAPU
 
Microprocessor chapter 9 - assembly language programming
Microprocessor  chapter 9 - assembly language programmingMicroprocessor  chapter 9 - assembly language programming
Microprocessor chapter 9 - assembly language programmingWondeson Emeye
 
Binary and hex input/output (in 8086 assembuly langyage)
Binary and hex input/output (in 8086 assembuly langyage)Binary and hex input/output (in 8086 assembuly langyage)
Binary and hex input/output (in 8086 assembuly langyage)Bilal Amjad
 
Conventional memory
Conventional memoryConventional memory
Conventional memoryTech_MX
 
Department of tourism
Department of tourismDepartment of tourism
Department of tourismTech_MX
 
Keyboard interrupt
Keyboard interruptKeyboard interrupt
Keyboard interruptTech_MX
 
Inheritance
InheritanceInheritance
InheritanceTech_MX
 
Application of greedy method
Application  of  greedy methodApplication  of  greedy method
Application of greedy methodTech_MX
 
Java vs .net
Java vs .netJava vs .net
Java vs .netTech_MX
 
bubble sorting of an array in 8086 assembly language
bubble sorting of an array in 8086 assembly languagebubble sorting of an array in 8086 assembly language
bubble sorting of an array in 8086 assembly languageBilal Amjad
 
basics of file handling
basics of file handlingbasics of file handling
basics of file handlingpinkpreet_kaur
 
Spanning trees & applications
Spanning trees & applicationsSpanning trees & applications
Spanning trees & applicationsTech_MX
 
Demultiplexer
DemultiplexerDemultiplexer
DemultiplexerTech_MX
 
Graph representation
Graph representationGraph representation
Graph representationTech_MX
 
Competition commission of India
Competition commission of IndiaCompetition commission of India
Competition commission of IndiaGaurav Khatri
 
microprocessor 8086 lab manual !!
microprocessor 8086 lab manual !!microprocessor 8086 lab manual !!
microprocessor 8086 lab manual !!Sushil Mishra
 

En vedette (20)

14 file handling
14 file handling14 file handling
14 file handling
 
File handling
File handlingFile handling
File handling
 
Microprocessor chapter 9 - assembly language programming
Microprocessor  chapter 9 - assembly language programmingMicroprocessor  chapter 9 - assembly language programming
Microprocessor chapter 9 - assembly language programming
 
Binary and hex input/output (in 8086 assembuly langyage)
Binary and hex input/output (in 8086 assembuly langyage)Binary and hex input/output (in 8086 assembuly langyage)
Binary and hex input/output (in 8086 assembuly langyage)
 
Conventional memory
Conventional memoryConventional memory
Conventional memory
 
Department of tourism
Department of tourismDepartment of tourism
Department of tourism
 
Dns 2
Dns 2Dns 2
Dns 2
 
Cvc presentation
Cvc presentationCvc presentation
Cvc presentation
 
Keyboard interrupt
Keyboard interruptKeyboard interrupt
Keyboard interrupt
 
Inheritance
InheritanceInheritance
Inheritance
 
Application of greedy method
Application  of  greedy methodApplication  of  greedy method
Application of greedy method
 
Java vs .net
Java vs .netJava vs .net
Java vs .net
 
Central Vigilance Commission
Central Vigilance CommissionCentral Vigilance Commission
Central Vigilance Commission
 
bubble sorting of an array in 8086 assembly language
bubble sorting of an array in 8086 assembly languagebubble sorting of an array in 8086 assembly language
bubble sorting of an array in 8086 assembly language
 
basics of file handling
basics of file handlingbasics of file handling
basics of file handling
 
Spanning trees & applications
Spanning trees & applicationsSpanning trees & applications
Spanning trees & applications
 
Demultiplexer
DemultiplexerDemultiplexer
Demultiplexer
 
Graph representation
Graph representationGraph representation
Graph representation
 
Competition commission of India
Competition commission of IndiaCompetition commission of India
Competition commission of India
 
microprocessor 8086 lab manual !!
microprocessor 8086 lab manual !!microprocessor 8086 lab manual !!
microprocessor 8086 lab manual !!
 

Similaire à File handling functions (20)

Part III: Assembly Language
Part III: Assembly LanguagePart III: Assembly Language
Part III: Assembly Language
 
Built in function
Built in functionBuilt in function
Built in function
 
Cs 1114 - lecture-29
Cs 1114 - lecture-29Cs 1114 - lecture-29
Cs 1114 - lecture-29
 
Chapter7.2-mikroprocessor
Chapter7.2-mikroprocessorChapter7.2-mikroprocessor
Chapter7.2-mikroprocessor
 
20 C programs
20 C programs20 C programs
20 C programs
 
Coal presentationt
Coal presentationtCoal presentationt
Coal presentationt
 
Procedure
ProcedureProcedure
Procedure
 
Linux com
Linux comLinux com
Linux com
 
Prabu linux
Prabu linuxPrabu linux
Prabu linux
 
Prabu linux
Prabu linuxPrabu linux
Prabu linux
 
Stack and subroutine
Stack and subroutineStack and subroutine
Stack and subroutine
 
08. handling file streams
08. handling file streams08. handling file streams
08. handling file streams
 
Linux
LinuxLinux
Linux
 
Linux
LinuxLinux
Linux
 
Linux
LinuxLinux
Linux
 
Linux
LinuxLinux
Linux
 
Seismic Analysis Code (SAC)
Seismic Analysis Code (SAC)Seismic Analysis Code (SAC)
Seismic Analysis Code (SAC)
 
Redhat 6 & 7
Redhat 6 & 7Redhat 6 & 7
Redhat 6 & 7
 
C programming session 08
C programming session 08C programming session 08
C programming session 08
 
0-Slot14-15-16-Libraries.pdf
0-Slot14-15-16-Libraries.pdf0-Slot14-15-16-Libraries.pdf
0-Slot14-15-16-Libraries.pdf
 

Plus de Tech_MX

Virtual base class
Virtual base classVirtual base class
Virtual base classTech_MX
 
Theory of estimation
Theory of estimationTheory of estimation
Theory of estimationTech_MX
 
Templates in C++
Templates in C++Templates in C++
Templates in C++Tech_MX
 
String & its application
String & its applicationString & its application
String & its applicationTech_MX
 
Statistical quality__control_2
Statistical  quality__control_2Statistical  quality__control_2
Statistical quality__control_2Tech_MX
 
Stack data structure
Stack data structureStack data structure
Stack data structureTech_MX
 
Stack Data Structure & It's Application
Stack Data Structure & It's Application Stack Data Structure & It's Application
Stack Data Structure & It's Application Tech_MX
 
Set data structure 2
Set data structure 2Set data structure 2
Set data structure 2Tech_MX
 
Set data structure
Set data structure Set data structure
Set data structure Tech_MX
 
Real time Operating System
Real time Operating SystemReal time Operating System
Real time Operating SystemTech_MX
 
Mouse interrupts (Assembly Language & C)
Mouse interrupts (Assembly Language & C)Mouse interrupts (Assembly Language & C)
Mouse interrupts (Assembly Language & C)Tech_MX
 
Motherboard of a pc
Motherboard of a pcMotherboard of a pc
Motherboard of a pcTech_MX
 
More on Lex
More on LexMore on Lex
More on LexTech_MX
 
MultiMedia dbms
MultiMedia dbmsMultiMedia dbms
MultiMedia dbmsTech_MX
 
Merging files (Data Structure)
Merging files (Data Structure)Merging files (Data Structure)
Merging files (Data Structure)Tech_MX
 
Memory dbms
Memory dbmsMemory dbms
Memory dbmsTech_MX
 

Plus de Tech_MX (20)

Virtual base class
Virtual base classVirtual base class
Virtual base class
 
Uid
UidUid
Uid
 
Theory of estimation
Theory of estimationTheory of estimation
Theory of estimation
 
Templates in C++
Templates in C++Templates in C++
Templates in C++
 
String & its application
String & its applicationString & its application
String & its application
 
Statistical quality__control_2
Statistical  quality__control_2Statistical  quality__control_2
Statistical quality__control_2
 
Stack data structure
Stack data structureStack data structure
Stack data structure
 
Stack Data Structure & It's Application
Stack Data Structure & It's Application Stack Data Structure & It's Application
Stack Data Structure & It's Application
 
Spss
SpssSpss
Spss
 
Set data structure 2
Set data structure 2Set data structure 2
Set data structure 2
 
Set data structure
Set data structure Set data structure
Set data structure
 
Real time Operating System
Real time Operating SystemReal time Operating System
Real time Operating System
 
Parsing
ParsingParsing
Parsing
 
Mouse interrupts (Assembly Language & C)
Mouse interrupts (Assembly Language & C)Mouse interrupts (Assembly Language & C)
Mouse interrupts (Assembly Language & C)
 
Motherboard of a pc
Motherboard of a pcMotherboard of a pc
Motherboard of a pc
 
More on Lex
More on LexMore on Lex
More on Lex
 
MultiMedia dbms
MultiMedia dbmsMultiMedia dbms
MultiMedia dbms
 
Merging files (Data Structure)
Merging files (Data Structure)Merging files (Data Structure)
Merging files (Data Structure)
 
Memory dbms
Memory dbmsMemory dbms
Memory dbms
 
Linkers
LinkersLinkers
Linkers
 

Dernier

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 

Dernier (20)

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 

File handling functions

  • 1.
  • 2.  To write a menu driven ALP program for file handling.  By including options like creating a file and typing the contents of the file.  Also displaying the current system date and time. AGENDA:
  • 3. INTERRUPT : FUNCTION PURPOSE INT21H:FUNCTION 2AH GET SYSTEM TIME INT21H:FUNCTION 2CH GET SYSTEM DATE INT21H:FUNCTION 3CH CREATE FILE INT 21H:FUNCTION 3DH OPEN FILE INT21H:FUNCTION 3EH CLOSE FILE INT21H:FUNCTION 3FH READ FILE INT21H:FUNCTION 40H WRITE FILE INT21H:FUNCTION 41H DELETE FILE INT21H:FUNCTION 09H PRINT ON THE STRING FUNCTION OF INT 21H USED IN FILE HANDLING:
  • 4.  AH=2Ah Returns : CX=YEAR DH=MONTH(1 TO 12) DL=DAY OF MONTH(1 TO 31) AL=DAY NUMBER IN WEEK(0-6 SUNDAY TO SATURDAY) FUNCTION 2AH-GET SYSTEM TIME:  AH=2Ch Returns : CH=HOUR(0 TO 59) CL=MINUTE(0 TO 59) DH=SECOND(0 TO 59) DL=CENTISECONDS(0 TO 99)
  • 5.  AH = 3Ch  DS:DX = address of filename  CL = attribute  If successful, AX = file handle IF NOT CF=1  When a file is created or opened in a program, DOS assigns it a unique number called the FILE HANDLE.  This number is used to identify the file. FUNCTION 3CH-TO CREATE FILE  AH = 3Dh ◦ AL=Access Mode
  • 6.  AH =4OH  BX =Handle  CX =No Of Bytes To Write  DS:DX =Segment:Offset Of Buffer  If successful then  AX =Bytes Transferred  AH = 3Fh  BX = File Handle  CX = Number Of Bytes To Read  DS:DX = Memory Buffer Address  AX = Count Of Bytes Actually Read FUNCTION 40H-TO WRITE FILE:
  • 7.
  • 8. START READ FILENAME WITH EXTENSION MOV OFFSET OF FILENAME TO DX MOV APPROPRIATE LENGTH OF FILE NAME TO CX PROGRAM MOV APPROPRIATE FUNCTION CALL(3CH) TO AH CALL INT 21H END PROC & RET TO MAIN R CREATE FILE CHEC K CF IF NOT SET PRINT ERROR MSG
  • 9. START MOV OFFSET OF FILENAME TO DX PROGRAM MOV APPROPRIATE FUNCTION (41H) CALL TO AH CALL INT 21H DELETE FILE END PROC & RET TO MAIN CHEC K CF IF NOT SET PRINT ERROR MSG
  • 10. START READ DATA TO BE WRITTEN MOV OFFSET OF FILENAME TO DX MOV APPROPRIATE LENGTH OF FILE NAME TO CX PROGRAM MOV APPROPRIATE FUNCTION CALL(3CH) TO AH CALL INT 21H END PROC & RET TO MAIN R WRIT INTO FILE CHECK FOR CARRY FLAG
  • 11. START MOV OFFSET OF FILENAME TO DX READ DATA FROM FILE BYTE BY BYTE OPEN THE FILE IN READ MODE PROGRAM WHEN EOF IS REACHED, CLOSE THE FILE PRINT THE DATA END PROC & RET TO MAIN R READ FROM FILE
  • 12. START MOV OFFSET OF STRING VAR TO BX CALL INT 21H MOV APPROPRIATE FUNCTION CALL(2CH) TO AH PROGRAM DECODE THE HEX VALUES TO DECIMAN PRINT THE TIME IN PROPER FORMAY END PROC & RET TO MAIN R READ SYSTEM TIME & DISPLAY
  • 13. START MOV OFFSET OF STRING VAR TO BX CALL INT 21H MOV APPROPRIATE FUNCTION CALL(2AH) TO AH PROGRAM DECODE THE HEX VALUES TO DECIMAN PRINT THE TIME IN PROPER FORMAY END PROC & RET TO MAIN R READ SYSTEM DATE & DISPLAY