Reverse a string. PDF

Title Reverse a string.
Author Prashant Saini
Course Microprocessor
Institution University of Mumbai
Pages 5
File Size 251.2 KB
File Type PDF
Total Downloads 32
Total Views 140

Summary

To reverse a string the main instructions used are:
1. MOV AH,01H
INT 21H
These instructions generate DOS interrupts to input a byte from user.
This byte is stored in AL register by default.
2. MOV AH,09H
INT 21H
This DOS function is used to display characte...


Description

Experiment-3 Aim: Write an ALP to reverse a string. Theory: To reverse a string the main instructions used are: 1. MOV AH,01H INT 21H These instructions generate DOS interrupts to input a byte from user. This byte is stored in AL register by default. 2. MOV AH,09H INT 21H This DOS function is used to display character string. 3. MOV [SI],AL Indirect addressing mode is used in this instruction wherein the value stored in SI register is treated as destination address to hold value of AL. 4. MOV AH,02H INT 21H DOS function to display byte which is stored in DX. 5. INC AL Increments the value stored in specified register (in this case, AL) by one. 6. DEC AL Decrements the value stored in specified register (in this case, AL) by one. 7. CMP Destination, Source If Destination>Source, ZF (Zero Flag)=0 and CF (Carry Flag)=0 If Destination...


Similar Free PDFs