search
HomeComputer TutorialsComputer KnowledgeUse assembly language to write a program that counts the number of passing, failing, and absentee exams for the following grades

Write a program in assembly language: count the number of people who passed, failed and missed the exam respectively

debug Execute and view the running results. 06 is the number of passing exams, 02 is the number of failing exams, and 01 is the number of absent exams.

Use assembly language to write a program that counts the number of passing, failing, and absentee exams for the following grades

dseg segment

scores db 87,94,76,52,71,83,-1,66,41

cnt equ $-scores ;number of scores

p db 0 ;>=60

q db 0 ;

r db 0 ;-1

dseg ends

cseg segment

assume cs:cseg, ds:dseg

start:

mov ax, dseg

mov ds, ax

lea si, scores

mov cx, cnt

s0:

mov al, [si]

cmp al, -1

je s3

cmp al, 60

jb s2

inc p ; Number of >=60

jmp s4

s2:

inc q ;

jmp s4

s3:

inc r ; number of -1

s4:

incsi

loop s0

; print p, q, r, output the results, because the question does not ask for it, so skip it

mov ah, 4ch

int 21h

cseg ends

end start

There are 100 students whose score statistics are 100 90 60 9060. How many students below are written in assembly

Assume that student scores are stored in the data segment starting at 1000h, and the segment address is 2000h

code segment assume cs:code start: mov bx,00h mov dx,00h mov di,00h

mov ax,2000h

mov cx,100

mov ds,ax

mov si,1000h mov ax,01h next6:mov [si],ax inc ax inc si loop next6 mov cx,100 mov si,1000h

next4:cmp byte ptr[si],90

jg next

cmp byte ptr[si],60

jg next2

inc di

incsi

loop next4

jmp next5

next:inc bx

incsi

loop next4

next5:int 3h

next2:inc dx

incsi

loop next4

jmp next5

code ends

end start

Write a student performance statistics program using VB

Private Sub Form_Click()

Dim Score As Single, Sum As Single, N As Integer, Average As Single

Sum = 0

N = 0

Score = InputBox ("Please enter a student's score", "Score input")

Do While Score -1

Sum = Sum Score

N = N 1

Score = InputBox ("Please enter the score of the student" & N 1 & "score", "score input")

Loop

Average = Sum / N

Print "The average score is:"; Average

End Sub

The above is the detailed content of Use assembly language to write a program that counts the number of passing, failing, and absentee exams for the following grades. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:Excel办公网. If there is any infringement, please contact admin@php.cn delete
Linux vs Mac: How to Install Linux on Mac - MiniToolLinux vs Mac: How to Install Linux on Mac - MiniToolMay 14, 2025 am 01:21 AM

What’s the difference between Linux and Mac? Do you want to install Linux on Mac? This post from php.cn will show you all. You can refer to this guide to dual boot Linux and macOS.

What Is MHTML & What Are the Differences Between It and HTML - MiniToolWhat Is MHTML & What Are the Differences Between It and HTML - MiniToolMay 14, 2025 am 01:20 AM

What is MHTML? How to open or view it? What are the differences between it and HTML? How to convert MHTML to HTML? If you are looking for the answers to the above questions, you can refer to this post from php.cn.

Solve Deleted Files Keep Reappearing in Windows 10 - MiniToolSolve Deleted Files Keep Reappearing in Windows 10 - MiniToolMay 14, 2025 am 01:19 AM

This article focuses on the topic that deleted files keep reappearing in Windows 10, introducing the responsible reasons and feasible solutions.

How to Deactivate Windows 10/11 by Uninstalling Product Key - MiniToolHow to Deactivate Windows 10/11 by Uninstalling Product Key - MiniToolMay 14, 2025 am 01:18 AM

This post teaches you how to deactivate Windows 10/11 by removing product key or license. You can use that product key to activate another computer later if you want. For more computer tips and tricks, you can visit php.cn Software official website.

Instant Fixes for Error 0164: Memory Size DecreasedInstant Fixes for Error 0164: Memory Size DecreasedMay 14, 2025 am 01:15 AM

Some Windows users report that they are prompted by the error 0164 memory size decreased screen every time they boot the computer. What’s wrong with it? If you are in the same boat, congratulations! You’ve come to the right place! In this post from p

Best Fixes: This Page Isn't Available Right Now on Facebook - MiniToolBest Fixes: This Page Isn't Available Right Now on Facebook - MiniToolMay 14, 2025 am 01:11 AM

This Page Isn’t Available Right Now is an error message you may encounter when you visit Facebook using your web browser. In this php.cn post, we will list some effective methods you can try to get rid of this error.

Windows 11 KB5010414 Was Released with Many New Features - MiniToolWindows 11 KB5010414 Was Released with Many New Features - MiniToolMay 14, 2025 am 01:09 AM

Windows 11 KB5010414, a new optional update for Windows 11, is available now. Do you know what’s new and fixes in it? php.cn Software will show you this information in this post. Besides, it also tells you how to download and install it on your compu

How to Change Windows Update Settings in Windows 11? - MiniToolHow to Change Windows Update Settings in Windows 11? - MiniToolMay 14, 2025 am 01:08 AM

Want to pause Windows Update on your Windows 11 computer? Want to set active hours to arrange a computer restart to complete the update process? You need to know how to change Windows Update settings in Windows 11. This php.cn post will show you the

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool