Docsity

Assembly Programming Assignment: CSci. 516 Program 1 - Prof. Nikolay Sirakov, Study notes of Computer Science

Toggle sidebar
bg1
CSci. 516 Program 1 - February 20, 2006
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”.
and
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
“Today is:
the X day of the week. The Date is
mm.dd.yy”
In both cases any other key closes the program..
Use the string output function (int 21h function 09h –
See page 466
) to write
to the screen. Use buffered input to read from the keyboard (int 21h function
0Ah –
See page 469
).
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.
Some hints in forms of Pseudo-code and charts are given below.
The Lecture which discusses the matter is Lecture 11 on my web page.
pf3
pf4
pf5

Partial preview of the text

Download Assembly Programming Assignment: CSci. 516 Program 1 - Prof. Nikolay Sirakov and more Study notes Computer Science in PDF only on Docsity!

CSci. 516 Program 1 - February 20, 2006

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

and

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

“Today is:the X day of the week. The Date is mm.dd.yy”

In both cases any other key closes the program..

Use the string output function (int 21h function 09h –See page 466) to write

to the screen. Use buffered input to read from the keyboard (int 21h function

0Ah –See page 469).

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.

Some hints in forms of Pseudo-code and charts are given below.

The Lecture which discusses the matter is Lecture 11 on my web page.

An Example Pseudo-code for Program 1

Main Program Call Clear_Screen Prompt first question Call Read_Key_Board

If key=TThen

Call Print_MessageT Goto Second Question

Else

Call Print_End

End If

Second Qestion: Prompt second question Call Read_Key_Board

If key=DThen

Call Print_MessageD

End If

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

An Example Block Diagrams