



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




For your first program, you are to write an assembly program that will display on a clear screen as follows:
Hello - I am xxxxxxxxx (insert your name) SID
To view the current Time please press “T”, any other key ends the Program?
To view the current day of the week and the Date please press “D”, any other key ends the Program?
End the program with the following sentence: Thank you – Have a nice day!
Prompt the user with the first question. You are then to read the user's response from the keyboard. If the user's response is T, then display “The current time is: XX:XX:XX”.
prompt the user with the second question. You are then to read the user's response from the keyboard. If the user's response is D, then display
In both cases any other key closes the program..
to the screen. Use buffered input to read from the keyboard (int 21h function
Use good structured methods to design your program. Use meaningful labels. Align your fields and use comments to explain the working of your code. Neatness counts in your grade. Any additional feature will be graded.
You may use the MASM or the Turbo Assembler to assemble and link your program. Your Source Program (Prg1_ID.ASM) must be located on your floppy disk (drive A) and all output will be written there. After the program has been assembled with no errors, execute the program. If necessary, use the Turbo Debugger to find any problems. Appendix D in your book discusses the Turbo Debugger. Provide the following files on your floppy disk (drive A): Prg1_ID.ASM, Prg1_ID.LST, Prg1_ID.OBJ, Prg1_ID.EXE.
Main Program Call Clear_Screen Prompt first question Call Read_Key_Board
Call Print_MessageT Goto Second Question
Call Print_End
Second Qestion: Prompt second question Call Read_Key_Board
Call Print_MessageD
Call Print_End End Main
Clear_Screen Save all Registers Write 25 Blank Lines to the Screen Reset Cursor to Line 1 Column 1 Restore all Registers End Clear_Screen
Print_MessageT Write Line One to the Screen Call Get_Time Write Line Two to the Screen End Print_Message
Print_MessageD Write Line One to the Screen Call Get_Date Write Line Two to the Screen End Print_Message
Read_Key_Board Write Repeat Line to the Screen Read Reply from the Key Board End Read_Key_Board Get_Date Get current Date from the Operating System Move 0 to ah Call To_ASCII Move converted Day of the week to Message