Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;;Events.txt STARTS
- ;28-08-2020
- ;AMAR BIRTHDAY
- ;AMI NACHBO
- ;TMRA AMR CAKE KATBA
- ;
- ;16-12-2019
- ;VICTORY DAY OF BANGLADESH
- ;48TH VICTORY DAY OF BD
- ;2021 WILL BE THE HALF CENTURY
- ;SOKAL 10 TAY PARADE DEKHTE JABO
- ;2021 BD TE WORLD FINALS HOBE
- ;
- ;22-12-2019
- ;PROJECT COMPLETE KORLAM
- ;PERA SHESH
- ;FILE INPUT OUTPUT NIA ONK JHAMELA KORTE HOISE
- ;BUDDHI THAKLE UPAY HOY
- ;
- ;01-01-2020
- ;NEW SEMESTER NEW YEAR
- ;3RD YEAR E UTHE GESI
- ;BORO VAI KOIBA AMARE B-)
- ;
- ;;EVENT TEXT FINISHED
- ;;PROJECT EVENT SEARCHING BY DATE
- ;;PROJECT MEMBERS
- ;;MD. ERFANUL ISLAM (181-15-10777)
- ;;AYESHA BINTE KHAIR (181-15-11102)
- INCLUDE "EMU8086.INC"
- .MODEL SMALL
- .STACK 100H
- .DATA
- FNAME1 DB "Events.txt",0
- TEXT DB 100 DUP('$')
- INPUT DB 100 DUP('$')
- FHAND DW ?
- CHAR DB ?
- CHK DB 0
- .CODE
- MAIN PROC
- MOV AX, @DATA
- MOV DS,AX
- MOV AH,3DH ;OPEN FILE
- MOV AL,0
- LEA DX, FNAME1
- INT 21H
- MOV FHAND, AX
- INPUT_STARTS:
- MOV SI,0
- IN1:
- MOV AH,1 ;READ INPUT
- INT 21H ;DATE FORMATE : DD-MM-YYYY
- CMP AL,10
- JE INPUT_ENDS
- CMP AL,13
- JE INPUT_ENDS
- MOV INPUT[SI],AL
- INC SI
- JMP IN1
- INPUT_ENDS:
- MOV INPUT[SI],'$'
- PRINTN
- MOV AH,9
- LEA DX,INPUT
- INT 21H
- NEW_LINE:
- MOV SI,0
- IN2:
- MOV AH,3FH ;READ FROM FILE
- MOV BX,FHAND
- MOV CX,1
- LEA DX,CHAR
- INT 21H
- CMP AX,0
- JE EXIT
- MOV AL,CHAR
- CMP AL,10
- JE COMPARE
- CMP AL,13
- JE COMPARE
- MOV TEXT[SI],AL
- INC SI
- JMP IN2
- COMPARE:
- MOV TEXT[SI],'$'
- MOV SI,0
- L2:
- MOV AL,TEXT[SI] ;COMPARE INPUT AND TEXT LINES CHAR BY CHAR
- MOV BL,INPUT[SI]
- CMP AL,BL
- JNE NEW_LINE ;IF NOT SAME CHECK NEXT LINE
- CMP AL,'$'
- JE SAME
- INC SI
- JMP L2
- SAME:
- MOV AL,1
- MOV CHK,AL
- PRINTN
- PRINTN
- PRINT "EVENTS ON THIS DAY:"
- PRINTN
- PRINT_EVENTS: ;IF SAME PRINT ALL EVENTS UNDER THIS DATE
- MOV SI,0
- OUT1:
- MOV AH,3FH ;READ FILE
- MOV BX,FHAND
- MOV CX,1
- LEA DX,CHAR
- INT 21H
- CMP AX,0 ;EXIT IF END OF FILE FOUND
- JE EXIT
- MOV AL,CHAR
- CMP AL,10
- JE PRINT_VAL
- CMP AL,13
- JE PRINT_VAL
- MOV TEXT[SI],AL
- INC SI
- JMP OUT1
- PRINT_VAL:
- MOV CX,10
- LL1:
- MOV TEXT[SI],'$'
- INC SI
- LOOP LL1
- MOV SI,2
- MOV AL,TEXT[SI] ;COMPARE IF ANOTHER DATE IS THERE
- CMP AL,'-'
- JNE PR:
- MOV SI,5
- MOV AL,TEXT[SI]
- CMP AL,'-'
- JNE PR:
- JMP EXIT
- PR:
- PRINTN ;PRINT THE LINE
- MOV AH,9
- LEA DX,TEXT
- INT 21H
- JMP PRINT_EVENTS
- EXIT:
- MOV AL,CHK
- CMP AL,0
- JNE ENDD ;JUMP IF EVENTS FOUND
- PRINTN
- PRINT "NO EVENT ON THIS DAY"
- ENDD:
- MOV AH,3EH ;CLOSE FILE
- MOV BX,FHAND
- INT 21H
- MOV AH,4CH
- INT 21H
- ENDP MAIN
- END MAIN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement