Sunday, January 16, 2022

You have the six courses which are stored in array use the procedure to calculate the marks percentage of the student.

 INCLUDE C:\IRVINE\IRVINE32.INC

.386

.STACK 4096

EXITPROCESS PROTO,DWEXITCODE:DWORD

.DATA                                             

str1 BYTE "Enter your marks here :  ",0

str2 BYTE "your percentage is:  ",0

str3 byte " you enter a wrong choice:",0

str4 byte " :",0

a dword ?

b dword ?

.CODE

MAIN PROC

call per

INVOKE EXITPROCESS,0

MAIN ENDP

per proc

start:

mov edx,offset str1

call WriteString

call ReadInt

cmp eax,1

jg next

jl last

next:

cmp eax,100

jl print

jg last

print:

mov edx,0

mov ecx,100

mul ecx

div ecx

mov edx,offset str2

call WriteString

call WriteInt

jmp ex

last:

mov edx,offset str3

call WriteString

jmp start

ex:

 ret

per endp

END MAIN

No comments:

Post a Comment