• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Session 9   1 alp to compute a grade using procedures
 

Session 9 1 alp to compute a grade using procedures

on

  • 484 views

MCSL 017 Assembly language Programming Lab Programs

MCSL 017 Assembly language Programming Lab Programs

Statistics

Views

Total Views
484
Views on SlideShare
484
Embed Views
0

Actions

Likes
0
Downloads
4
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Session 9   1 alp to compute a grade using procedures Session 9 1 alp to compute a grade using procedures Document Transcript

    • Write a ALP program that will compute a grade for this class based on grades input into it. Write twodifferent procedures one for computing total marks based of different examinations held and anotherfor computing overall grade of student.Procedures-I: The total marks will be computed as follows:20% Midterm Exam20% Final Project30% Quizzes30% ProjectsProcedure-II: The letter grade will be computed from the overall grade asfollows:93+: A90+: A-87+: B+83+: B80+: B-77+: C+73+: C70+: C-65+: D0+: F.model small.datamid db 10,13,Midterm Exam Marks(0-20): $prj db 10,13,Final Project Marks(0-20): $quz db 10,13,Quizzes Marks(0-30): $pjs db 10,13,Projects Marks(0-30): $grd db 10,13,Grade :$.codemov ax, @datamov ds, axcall totmcall gradmov ah, 4chint 21hproc totmmov ah, 9lea dx, midint 21hcall readnocmp al, 20hja totmmov ch,alrdprj:mov ah, 9lea dx, prjint 21hcall readnocmp al, 20hja rdprjadd ch,alrdqz:
    • mov ah, 9lea dx, quzint 21hcall readnocmp al, 30hja rdqzadd ch,alrdpjs:mov ah, 9lea dx, pjsint 21hcall readnocmp al, 30hja rdpjsadd ch,alretendp totmproc gradmov ah, 9lea dx, grdint 21hmov dh, mov dl, Acmp ch, 93hjae dspgmov dh, -mov dl, Acmp ch, 90hjae dspgmov dh, +mov dl, Bcmp ch, 87hjae dspgmov dh, mov dl, Bcmp ch, 83hjae dspgmov dh, -mov dl, Bcmp ch, 80hjae dspgmov dh, +mov dl, Ccmp ch, 77hjae dspgmov dh, mov dl, Ccmp ch, 73hjae dspgmov dh, -mov dl, C
    • cmp ch, 70hjae dspgmov dh, mov dl, Dcmp ch, 65hjae dspgmov dl, Fdspg:mov ah,2int 21hmov dl, dhint 21hretendp gradproc readnomov ah, 1int 21hcmp al, 0jb readnocmp al, 9ja readnomov bl, aland bl, 0fhdgt2:mov ah, 1int 21hcmp al, 13je xitrdcmp al, 0jb dgt2cmp al, 9ja dgt2mov cl, 4shl bl, cland al, 0fhor bl, alxitrd:mov al,blretendp readnoend