ASSEMBLY LANGUAGE SOLVED LAB ON COMPLEX QUESTION, Lab Reports of Computer Architecture and Organization

Two exercises on assembly programming. The first exercise requires the student to write a program to check if a number is positive or negative. The second exercise requires the student to write a program to allot grades based on marks entered by the user. the code for both exercises. likely to be useful as study notes or exercises for a course on assembly programming.

Typology: Lab Reports

2021/2022

Available from 10/01/2022

SamenKhan
SamenKhan 🇵🇰

231 documents

1 / 10

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
NUST
Military College of Signals,
Rawalpindi.
COA
LAB# 11
BATCH-26C
Submitted By:
AYMEN FATIMA
Cms:
345556
Submitted To:
Mam LARAIB
DEPARTMENT OF COMPUTER SOFTWARE ENGINEERING.
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download ASSEMBLY LANGUAGE SOLVED LAB ON COMPLEX QUESTION and more Lab Reports Computer Architecture and Organization in PDF only on Docsity!

NUST

Military College of Signals,

Rawalpindi.

COA

LAB# 11

BATCH-26C

Submitted By:

AYMEN FATIMA

Cms:

Submitted To:

Mam LARAIB

DEPARTMENT OF COMPUTER SOFTWARE ENGINEERING.

EXERCISES

Exercise 11.1:

Write a program in assembly to check if the number is positive or negative. org 100h include 'emu8086.inc' .code main proc looop: printn '' printn 'Enter the Number' call scan_num Mov Ax, Cx cmp Ax, 0 jg positive jl negative

org 100h include 'emu8086.inc' .code main proc looop: printn '' printn 'Enter the Number' call scan_num Mov Ax, Cx cmp Ax, 0 jg level jle notValid level1: cmp Ax, 100 jge notValid jl level jmp end level2: printn ''

printn 'The number is VALID.' Mov Cx, 2 Mul Cx call print_num jmp end notValid: printn '' printn 'The number is NOT VALID.' jmp end end: jmp looop main endp define_scan_num define_print_num define_print_num_uns ret

Exercise 11.3:

Write a program in assembly which takes marks from the user and allot the grade accordingly A → 100 - 80 B → 70 - 79 C → 60 - 69

looop: printn '' printn 'Enter the Number' call scan_num mov Ax, 100 cmp Cx, Ax jg notVAlid mov Ax, 0 cmp Cx, Ax jl notValid jge valid jmp end valid: mov Ax, 49 cmp Cx, Ax jle F mov Ax, 59 cmp Cx, Ax jle D

mov Ax, 69 cmp Cx, Ax jle C mov Ax, 79 cmp Cx, Ax jle B mov Ax, 100 cmp Cx, Ax jle A F: printn '' printn 'You are fail.' jmp end D: printn '' printn 'Your grade is D.' jmp end C: printn ''

define_scan_num define_print_num define_print_num_uns ret