Computers and Technology
13.12.2021 20:00
145
172
10
Solved by an expert

Using the college registration example from section 6.7.3 as a starting point, do

Using the college registration example from section 6.7.3 as a starting point, do the following:

Recode the logic using cmp and conditional jump instructions (instead of the .if and .elseif directives).
Perform range checking on the credits value; it cannot be less than 1 or greater than 30. if an invalid entry is discovered, display an appropriate error message.
Prompt the user for the grade average and credits values.
Display a message that shows the outcome of the evaluation, such as "the student can register" or "the student cannot register".
Show Answers
5001Je
5001Je
4,7(72 marks)

Explanation:

NCLUDE Irvine32.inc

TRUE = 1

FALSE = 0

.data

gradeAverage WORD ?

credits WORD ?

oKToRegister BYTE ?

str1 BYTE "Error: Credits must be between 1 and 30" , 0dh,0ah,0

main PROC

call CheckRegs

exit

main ENDP

CheckRegs PROC

push edx

mov OkToRegister,FALSE

; Check credits for valid range 1-30

cmp credits,1 ; credits < 1?

jb E1

cmp credits,30 ; credits > 30?

ja E1

jmp L1 ; credits are ok

; Display error message: credits out of range

E1:

mov edx,OFFSET str1

call WriteString

jmp L4

L1:

cmp gradeAverage,350 ; if gradeAverage > 350

jna L2

mov OkToRegister,TRUE ; OkToRegister = TRUE

jmp L4

L2:

cmp gradeAverage,250 ; elseif gradeAverage > 250

jna L3

cmp credits,16 ; && credits <= 16

jnbe L3

mov OkToRegister,TRUE ; OKToRegister = TRUE

jmp L4

L3:

cmp credits,12 ; elseif credits <= 12

ja L4

mov OkToRegister,TRUE ; OKToRegister = TRUE

L4:

pop edx ; endif

ret

CheckRegs ENDP

END main

alexbrafford
alexbrafford
4,4(23 marks)

hey how r u

Explanation:

Popular Questions about the subject: Computers and Technology

Is there is any web that we can do clothes design in computer or phone?...
Computers and Technology
18.02.2023 21:15
Define the following window class: a. integer data members, width and...
Computers and Technology
10.03.2022 13:24
Your customer then asks you if it would be worth the investment for him...
Computers and Technology
14.09.2021 23:28
What should you do before giving contact information for your references...
Computers and Technology
13.01.2023 23:33
The internet has changed the way we connect with one another. in this...
Computers and Technology
19.05.2023 00:19
When you turn on a battery-operated device an electrical circuit is?...
Computers and Technology
28.07.2021 00:49
Where can you go in quickbooks online to import a list of products and...
Computers and Technology
23.08.2021 21:50
To place the insertion point at the end of a document, press keys(s)....
Computers and Technology
12.06.2021 23:12
When selecting text in word, holding down the ctrl key while clicking...
Computers and Technology
16.09.2022 06:15
If speaker 1 is the source, speaker 2 is the a. transmitter b. channel...
Computers and Technology
26.07.2020 06:11

New questions by subject

If you use social media, you should use the following: A.Location Detection...
English
18.02.2022 17:50
Solve for x: (-6/5) x -4 = -46 1) 23 2) 35 3) -23 4) -35...
Mathematics
16.03.2023 23:39
Howard draws a car scale drawing where 4 cm represents 2 meters. The car...
Mathematics
23.06.2020 08:59
What do red foxes eat?...
Biology
22.03.2023 23:05
In what ways might vajaryana Buddhism considered syncretic...
History
24.03.2020 15:56
For 5 + 20 and the multiplicative inverse of 5, write the product and...
Mathematics
29.10.2021 22:06
Give the coordinates for the reflection of Rectangle MNOP with vertices...
Mathematics
24.06.2020 02:00
#
#
#
#
# #

We expand our knowledge with many expert answers