⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 function.asm

📁 学分管理系统的分析
💻 ASM
📖 第 1 页 / 共 3 页
字号:
	call   clearscreen_du
	call   draw_ge
	
	add   page_position, 30*20
	mov   bx,page_position
		
	lea   si,records
	add   si,bx
	
	mov   cx,20
	mov   bx,82
loop_f:
	add   bx,20
	mov   DI, SI
	cmp   DI, wei_records
	jl    next_down
	mov   stop_downpage, 1
	jmp   exit
next_down:
	call  write_one_record
	add   SI,30
	loop  loop_f	
exit:
	popa
	ret
pagedown endp

;=======================================================================
;入口参数:无
show_onepage  proc  far
	pusha
	push  ds
	mov   ax, data
	mov   ds, ax
	mov   busy, 1
	call  restore_m
	setxy 120,100,730,500
	call  clearscreen_in
	call  store_m
	mov   busy, 0
	call   draw_table
	
	lea   SI,records
	mov   cx,20
	mov   bx,82
	.REPEAT  
	add   bx,20
	mov   DI, SI
	call  write_one_record
	dec   cx
	add   SI,30
	.UNTIL  cx == 0	
exit:
	pop	ds
	popa
	ret

show_onepage	endp

;==============================================================
queding  proc  near
       mov  value, 1
       mov  BACKFLAG1,1
       ret
queding   endp
quxiao	 proc  near
       mov  value, 0
       mov  BACKFLAG1,1
       ret
quxiao	 endp


search_studentnum  proc   far
	pusha
	push    ds
	mov     ax,	data
	mov 	ds,	ax
	;画输入对话框
	mov     busy, 1
	call    restore_m
	setxy	300,100,500,400
	call   clearscreen_out
	box_jiao   200,150,600,450,<RGB 128,128,128>
	box_jiao   203,153,597,447,<RGB 232,23, 23>
	out_hz	   220,180,input_studentnum,<RGB 0,255,0>
	box_jiao   220,220,580,250,<RGB	232,23,23>
	box_jiao   210,400,395,425,<RGB 125,0,32>
	out_hz	   290,405,yes,<RGB 0,0,255>
	box_jiao   410,400,595,425,<RGB 125,0,32>
	out_hz	   490,405,cancle,<RGB 0,0,255>
        call     store_m
        mov     busy,  0
	.WHILE	1
	update	   224,222,550,248,flag1,<   getnums 226,230,one.study_num,9>,next1
next1:
	submenu    210,400,395,425,flag2,yes,yeshelp,queding ,next2,BACKFLAG1
next2:
	submenu    410,400,595,425,flag3,cancle,canclehelp,quxiao ,next3,BACKFLAG1
next3:
	.ENDW
	
	cmp   value ,1
	jne   next5
	mov   busy,  1
	call  restore_m
	setxy 200,150,600,450
	call  clearscreen_in
	call  store_m
	mov   busy,  0
	
	mov   cx,   num_records
	lea   di,   records
	.WHILE	CX  > 0

	cmpstr	one.study_num,	[di].student.study_num,9
	je    next4
	dec   cx
	add   di,   30
	.ENDW
	
next4:	 or    cx,   cx
	je    noexist
	call  draw_table
	mov   bx, 102
	call  write_one_record
lopa:	isleftkey
	jc   next5
	jmp  lopa
next5:  
	mov  busy, 1
	call restore_m
	setxy  120,70,730,500
	call   clearscreen_in	
	call store_m
	mov  busy, 0
	jmp   exit
noexist:	
	message_box  250,200,650,300,nothing,<RGB 255,0,0>,<clearscreen_in>

exit:	mov  BACKFLAG1, 1
	mov  BACKFLAG2, 1
	mov  BACKFLAG3, 1
	mov   value, 0	
	pop    ds
	popa
	ret
search_studentnum  endp	

;=====================================================================
search_departmentnum  proc   far
	pusha
	push    ds
	mov     ax,	data
	mov 	ds,	ax
	;画输入对话框
	mov    busy , 1
	call   restore_m
	setxy	300,100,500,400
	call   clearscreen_out
	box_jiao   200,150,600,450,<RGB 128,128,128>
	box_jiao   203,153,597,447,<RGB 232,23, 23>
	out_hz1	   220,180,<RGB 0,255,0>
	box_jiao   220,220,580,250,<RGB	232,23,23>
	box_jiao   210,400,395,425,<RGB 125,0,32>
	out_hz	   290,405,yes,<RGB 0,0,255>
	box_jiao   410,400,595,425,<RGB 125,0,32>
	out_hz	   490,405,cancle,<RGB 0,0,255>
        call    store_m
        mov     busy, 0
	
	.WHILE	1
	update	   224,222,550,248,flag1,<   getnums 226,230,one.department_num,9>,next1
next1:
	submenu    210,400,395,425,flag2,yes,yeshelp,queding ,next2,BACKFLAG1
next2:
	submenu    410,400,595,425,flag3,cancle,canclehelp,quxiao ,next3,BACKFLAG1
next3:
	.ENDW
	cmp   value ,1
	jne   next5
	mov   busy,  1
	call  restore_m
	setxy 200,150,600,450
	call  clearscreen_in
	call  store_m
	mov   busy,  0
	mov   cx,   num_records
	lea   si,   precords
	lea   di,   records
	.WHILE	CX  > 0

	cmpstr	one.department_num,	[di].student.department_num,4
	jne    next4
	mov    [si],di
	add    si,   2
next4:  	
	dec   cx
	add   di,   30
	.ENDW
	mov   word ptr [si],  0
	
	mov   cx,   precords
	or    cx,   cx
	je    noexist
	call  show_result

lopa:	isleftkey
	jc   next5
	jmp  lopa
next5:  mov  busy, 1
	call restore_m
	setxy  120,70,730,500
	call   clearscreen_rdw	
	call   store_m
	mov    busy, 0
	jmp    s_exit
noexist:	
	message_box  250,200,650,300,nodepartment,<RGB 255,0,0>,<clearscreen_in>

s_exit:	mov  BACKFLAG1, 1
	mov  BACKFLAG2, 1
	mov  BACKFLAG3, 1
	mov   value, 0	
	pop  ds
	popa
	ret
search_departmentnum endp

;===========================================================
search_nopass   proc far
        pusha
        push    ds
        
        mov   	ax,  	data
        mov     ds,	ax
        
        lea     si,  	records
        lea 	di,     precords
        mov  	cx, 	num_records
again:  
	mov     dl, 	[si].student.average        		
	cmp     dl, 	60
	jge     next
	mov     word  ptr [di],  si
	inc     di
	inc 	di
next:   
	add     si,	30
	loop	again
	mov	word ptr [di],	0
	call    show_result
lopa:	isleftkey
	jc   next1
	jmp  lopa
next1:  
	mov    busy,  1
	call   restore_m
	setxy  120,70,730,500
	call   clearscreen_in	
	call   store_m
	mov    busy,  0
	mov  BACKFLAG1, 1
	mov  BACKFLAG2, 1
	mov  BACKFLAG3, 1
	pop     ds
	popa
	ret
search_nopass    endp
;=================================================================	
show_result  proc  far
	pusha
	push  ds
	mov   ax, data
	mov   ds, ax
	mov   busy, 1
	call  restore_m
	setxy 120,100,780,500
	call  clearscreen_in
	call  store_m
	mov   busy, 0
	call   draw_table
	

	lea   si,  precords		
	mov   cx,20
	mov   bx,82
	
again:	mov    di,  [si]	
	cmp    di,  0	
	je     exit
	or     cx, cx
	jnz    next
lop:    isleftkey
	jc     next1
	jmp    lop
next1:	     	
	mov    busy,  1
	call   restore_m
	setxy  120,100,730,500
	call   clearscreen_rl
	call   store_m
	mov    busy,  0
	call   draw_ge
	mov    bx, 82
	mov    cx, 20
next:   		
	add   bx,20
	call  write_one_record
	dec   cx
	add   SI,    2
	jmp   again  
exit:
	pop  ds
	popa
	ret
show_result	endp	
;=================================================================	
tongji_nopass   proc   far
	pusha
	push    ds
	mov     ax,    data
	mov  	ds,	ax
	mov     busy,  1
	call    restore_m
	setxy	300,100,500,400
	call    clearscreen_out
	box_jiao 250,49,650,69,<RGB 0,0,255>
	out_hz  350, 50,biaoti1_text,<RGB 0,255,0>
	call    store_m
	mov     busy, 0
	call    tongji_form1
	 
	mov     cx,    num_records
	mov	bx,    0
	mov	ax,    0
	lea     di,    records
	.REPEAT
	cmp	   byte ptr visitedflag[bx], 1
	je      next1
	push    bx

	lea     si,    records
	mov     dx,    num_records
	mov	bx,    0


lopb:	cmp     byte  ptr  visitedflag[bx],1
	je      next2

	cmpstr	[si].student.department_num, [di].student.department_num,4
	jne     next2
	mov     byte ptr visitedflag[bx],1
	cmp     [si].student.chinese, 60
	jge     next3
	inc     chinese_nopass
next3:  cmp     [si].student.maths,   60
	jge     next2
	inc     maths_nopass
next2:	add	si,   30

	inc     bx
	dec     dx
	jnz    lopb

	cmp	ax,    20
	jne	next4
	PUSHA
lopc:	isleftkey
	jc	next5
	jmp	lopc
next5:
	mov     busy , 1
	call    restore_m
	setxy	250,100,650,500
	CALL	clearscreen_in
	call    store_m
	mov     busy,  0
	call	draw_form1
	POPA
	mov	ax,   0
	mov	line, 82

next4:
	add	line,  20

	call	write_form1
	mov     bx ,chinese_nopass
	add     chinese_total, bx
	mov     bx   ,maths_nopass
	add     maths_total,bx
	inc	ax
	mov	chinese_nopass, 0
	mov	maths_nopass,0
	pop	bx
	
next1:
	inc     bx
	add     di,     30
	DEC	CX
	.UNTIL	CX  ==	0

	MOV	line,  82
	MOV	BX,  0
	.WHILE	BX <= 200
	MOV	visitedflag[bx],0
	INC     BX
	.ENDW
	out_hz  280, 502,total_text,<RGB 0,255,0>
	mov     ax, 440
	mov     bx, 502
	mov     dx, chinese_total
	RGB     0,255,0
	call    putint
	mov     ax, 560
	mov     dx, maths_total
	call    putint
	mov     ax, 640
	add     dx, chinese_total
	call    putint
	mov     chinese_total, 0
	mov     maths_total,   0
again:
	isleftkey
	jc    exit
	jmp  again
exit:	mov   busy, 1
	call  restore_m
	setxy 250,30,660,520
	call  clearscreen_in
	call  store_m
	mov   busy, 0
	mov	BACKFLAG1,1
	mov     BACKFLAG2,1
	mov     BACKFLAG3,1
	pop     ds
	popa
	ret	
tongji_nopass   endp	
;===================================================================		
tongji_renshu   proc   far
	pusha
	push    ds
	mov     ax,    data
	mov  	ds,	ax
	mov     busy, 1
	call    restore_m
	setxy	300,100,500,400
	call    clearscreen_out
	call    store_m
	box_jiao 250,49,650,69,<RGB 0,0,255>
	out_hz  350, 50,biaoti1_text,<RGB 0,255,0>
	mov     busy, 0
	call	tongji_form2
	 
	mov     cx,    num_records
	mov	bx,    0
	mov	ax,    0
	lea     di,    records
	.WHILE	CX > 0
	cmp	   byte ptr visitedflag[bx], 1
	je      next1
	push    bx

	lea     si,    records
	mov     dx,    num_records
	mov     bx,    0

lopb:	cmp     byte  ptr  visitedflag[bx],1
	je	next2
	cmpstr	[si].student.department_num, [di].student.department_num,4
	jne     next2
	mov     byte ptr visitedflag[bx],1
	cmp     [si].student.sex,byte ptr 'm'
	jne	 next3
	inc	boy_num
	jmp	next2
next3:
	cmp	[si].student.sex, byte ptr 'M'
	jne	next4
	inc	boy_num
	jmp	next2
next4:
	inc     lady_num
next2:  add	si,   30

	inc     bx
	dec     dx
	jnz	lopb
	cmp	ax ,  20
	jne	next5
	PUSHA
lopc:	isleftkey
	jc	next6
	jmp	lopc
next6:	mov     busy, 1
        call    restore_m
	setxy	250,100,650,500
	CALL	clearscreen_in
	call    store_m
	mov     busy, 0
	call	draw_form2
	POPA
	mov	ax, 0
	mov	line,  82
next5:
	add     line,  20
	call	write_form2
	mov     bx,  boy_num
	add     total_boy,bx
	mov     bx,  lady_num
	add     total_lady, bx
	inc	ax
	mov	boy_num, 0
	mov	lady_num,0
	pop	bx
next1:
	inc     bx
	add     di,     30
	DEC	CX
	.ENDW

	MOV	line,  82
	MOV	BX,  0
	.WHILE	BX <= 200
	MOV	visitedflag[bx],0
	INC     BX
	.ENDW
	out_hz  280, 502,total_text,<RGB 0,255,0>
	mov     ax, 440
	mov     bx, 502
	mov     dx, total_boy
	RGB     0,255,0
	call    putint
	mov     ax, 560
	mov     dx, total_lady
	call    putint
	mov     ax, 640
	add     dx, total_boy
	call    putint
	mov     total_boy, 0
	mov     total_lady,0
	
again:
	isleftkey
	jc    exit
	jmp  again
exit:	mov    busy, 1
	call   restore_m
	setxy 250,30,660,520
	call  clearscreen_in
	call  store_m
	mov   busy, 0
	mov	BACKFLAG1,1
	mov     BACKFLAG2,1
	mov     BACKFLAG3,1
	pop     ds
	popa
	ret	
tongji_renshu   endp	
;===================================================================
direct_exit   proc  far
	push  ds
	mov  ax, data
	mov  ds, ax
	mov   busy,  1
	call  restore_m
	setxy 300,100,500,500
	call  clearscreen_in
	call  store_m
	mov   busy,0
	call  goout
	pop   ds
	ret
direct_exit    endp			
;====================================================================
goout	proc  far
	push ds
	mov  ax, data
	mov  ds, ax
	
	box_jiao   200,150,600,450,<RGB 128,128,128>
	box_jiao   203,153,597,447,<RGB 232,23, 23>
	out_hz	   220,180,confirm,<RGB 0,255,0>
	box_jiao   210,400,395,425,<RGB 125,0,32>
	out_hz	   290,405,yes,<RGB 0,0,255>
	box_jiao   410,400,595,425,<RGB 125,0,32>
	out_hz	   490,405,cancle,<RGB 0,0,255>
        
	.WHILE	1
	submenu    210,400,395,425,flag2,yes,yeshelp,queding ,next1,BACKFLAG1
next1:
	submenu    410,400,595,425,flag3,cancle,canclehelp,quxiao ,next2,BACKFLAG1
next2:
	.ENDW

	mov   busy,  1
	call  restore_m
	setxy 120,70,750,500
	call  clearscreen_in
	call  store_m
	mov   busy,0
	
	cmp   value ,1
	jne   jump_out
	
	cli
        res_oldintr oldintr

	setxy  0,0,799,599
	call   clearscreen_rdw
	mov ax,store_ax
        mov bx,store_bx
    	mov ah,	0
    	int 10h
	
    	mov ah,	4ch
    	int 21h
jump_out:
	mov  value, 0
	mov	BACKFLAG1,1
	mov     BACKFLAG2,1
	mov     BACKFLAG3,1
	pop  ds
	ret
goout   endp

;===========================================================

code  ends
      end	

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -