new text document.txt
来自「用汇编语言实现的程序: 每名学生需要如下描述:班级、学号、姓名、期末成绩、期中」· 文本 代码 · 共 136 行
TXT
136 行
;***********************************************************
data segment
initialscr db 'Input the students information end with # $'
nameinfo db 'Input Class IDnumber Name: ',0dh,0ah,'$'
scoreinfo db 'Input Score: ',0dh,0ah,'$'
isize dw 15
nsize dw 3
stnum db 0
stinfo db 99 dup (isize dup (0))
stscore db 99 dup (nsize dup (0))
data ends
;***********************************************************
STACKS SEGMENT
;此处输入堆栈段代码
STACKS ENDS
;***********************************************************
code segment
;-----------------------------------------------------------
main proc far
assume cs:code,ds:data
start:
mov ax,data
mov ds,ax
mov es,ax
mov si,0
mov di,0
mov cx,100
lea dx,initialscr
mov ah,09
int 21h
call saveinfo
;call average
;call sort
call display
;-----------------------------------------------------------
quit:
mov ah,1
int 21h
MOV AH,4CH
INT 21H
;***********************************************************
;***********************************************************
saveinfo proc
push ax
push bx
push dx
lea dx,initialscr ;initializing screen
mov ah,09
int 21h
;mov bx,0
store:
lea dx,nameinfo ;students' information save
mov ah,09
int 21h
mov al,isize
mov stinfo[si],al
lea dx,stinfo[si]
mov ah,0ah
int 21h
mov bl,stinfo[si+1]
mov stinfo[si+isize-1],'$'
mov al,stinfo[si+2]
cmp al,'#' ;end up with #
je endup
cmp al,0dh
je over
and al,0fh
mov stinfo[bx],al
inc bx
jmp store
over:
inc stnum
add si,isize
jmp store
endup:
pop dx
pop bx
pop ax
ret
saveinfo proc
;***********************************************************
;***********************************************************
;***********************************************************
;***********************************************************
;***********************************************************
;***********************************************************
;***********************************************************
;***********************************************************
;***********************************************************
;***********************************************************
;***********************************************************
;***********************************************************
;***********************************************************
;***********************************************************
;***********************************************************
;***********************************************************
main endp
;-----------------------------------------------------------
code ends
end start
;***********************************************************
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?