Session 9 1 alp to compute a grade using procedures

431
-1

Published on

MCSL 017 Assembly language Programming Lab Programs

Published in: Education, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
431
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Session 9 1 alp to compute a grade using procedures

  1. 1. 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:
  2. 2. 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
  3. 3. 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

×