原本想写个完整的学生成绩管理系统,不过想想还是算了,所以此程序就没有使用文件及链表什么的,仅作为基本练习,演示了成绩管理基本功能、分页显示数据、文本选单。
.model small
;***************************************
;定义学生结构体类型
student struc
id dw 0 ;学号
sname db 16 dup('$') ;姓名
score dw 0 ;分数
order dw 0 ;排名
student ends
;***************************************
;***************************************
;回车换行
newline macro
push ax
push dx
mov ah,2
mov dl,0dh
int 21h
mov ah,2
mov dl,0ah
int 21h
pop dx
pop ax
endm
;***************************************
COUNT equ 30 ;学生人数
LIMIT equ 300 ;分数上限
.stack 200h
.data
str1 db "student (ID: ",'$'
str2 db ") score: ",'$'
str3 db "ID name score order",0dh,0ah,'$'
space db " ",'$'
tip1 db "Student ID: ",'$'
tip2 db "Name: ",'$'
tip3 db "Score: ",'$'
error1 db "Not found! Please input again.",0dh,0ah,'$'
error2 db "Too high. Please input again.",0dh,0ah,'$'
menu1 db " ***************************************",0dh,0ah
db " * *",0dh,0ah
db " * 1.input score *",0dh,0ah
db " * 2.modify *",0dh,0ah
db " * 3.display *",0dh,0ah
db " * 4.quit *",0dh,0ah
db " ***************************************",0dh,0ah,'$'
buf db 16
len db 0
buffer db 16 dup('$')
temp student <>
array student <1,"Tom">
student <2,"Jack">
student <3,"Rose">
student <4,"Lusy">
student <5,"Lily">
student <6,"David">
student <7,"Tim">
student <8,"Ana">
student <9,"Ivy">
student <10,"Joe">
student <11,"John">
student <12,"Joson">
student <13,"Lulu">
student <14,"Kitty&