Вы находитесь на странице: 1из 2

College of Information Technology and Computer Science

CSM 7 – Computer Organization and Architecture

Laboratory Exercise

Exercise # 1 Date

Name User #

Topic(s) Covered Character Input/Output Course/Sec

Estimated Completion Time: 45 minutes


Objectives:

1. Create, compile, and link Assembly Programs.


2. Understand Interrupts, ASCII, and registers.
3. Learn how to initialize values in a register.
4. Learn how to accept and output characters.

Discussions:

Assembly programming language is a low level programming language


wherein one of its traits is it has almost direct contact with the hardware
device. In order to understand how to program in Assembly, one has to know
how to read and write binary numbers and convert them to other number
format such as decimal, and hexa decimal.

Assembly programming starts always with the basic structure:

.model small ; initialize the size of the program


.stack ; initialize the stack segment
.data ; initialize the data segment
.code ; initialize the code segment
start:
; this is where you put your code.
end start

Computers are preprogrammed to understand interrupts.. A table


below shows some interrupts that are used and what registers are reserved
for the interrupt.

Interrupt Number Reserved Register What It means?


int 21h ah = 2, dl Displays a character found
in register dl.
int 21h ah = 1, al Asks the user to enter a
character form keyboard.
Entered character will be

ICS 7 – Systems Analysis and Design


College of Information Technology and Computer Science

placed in al.

Problem:

Create an assembly file and open it with notepad. Your task is to welcome
users by displaying “Hello, Welcome to assembly Programming Language,
Are you having fun? Press 1 for yes, 0 otherwise”. The program will then
ask the user to enter a character 0 or 1 from the keyboard. No validations
needed and just assume that users will enter 0 or 1.

Laboratory Exercise Score Sheet

Criteria Score

1 Proper program indention and prescribed format 5 5

2 Proper use of registers 5

3 Proper use of interrupts 5


1
4 Program Specification 0
5 Appropriate Display of Output 5

6 Program is Running Without Errors 5

7 Exercise finished within Time Frame 1


0

ICS 7 – Systems Analysis and Design

Вам также может понравиться