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

📄 memtest.cod

📁 汇编源代码大全4
💻 COD
字号:
;	Static Name Aliases
;
	TITLE   memtest
;	NAME    memtest.C

	.287
_TEXT	SEGMENT  BYTE PUBLIC 'CODE'
_TEXT	ENDS
_DATA	SEGMENT  WORD PUBLIC 'DATA'
_DATA	ENDS
CONST	SEGMENT  WORD PUBLIC 'CONST'
CONST	ENDS
_BSS	SEGMENT  WORD PUBLIC 'BSS'
_BSS	ENDS
DGROUP	GROUP	CONST,	_BSS,	_DATA
	ASSUME  CS: _TEXT, DS: DGROUP, SS: DGROUP, ES: DGROUP
PUBLIC  _str3
PUBLIC  _str4
PUBLIC  _str5
PUBLIC  _str6
PUBLIC  _frame
PUBLIC  _str1
PUBLIC  _str2
EXTRN	_cls:NEAR
EXTRN	_clrwin:NEAR
EXTRN	_getche:NEAR
EXTRN	_vputstr:NEAR
EXTRN	_vputnc:NEAR
EXTRN	_vbufwin:NEAR
EXTRN	_vputbox:NEAR
EXTRN	_writewin:NEAR
EXTRN	__chkstk:NEAR
EXTRN	_vidbuf:NEAR
EXTRN	_printf:NEAR
EXTRN	_vputc:NEAR
EXTRN	_scrbuff:BYTE
EXTRN	_winbuff:BYTE
_DATA      SEGMENT
$SG61	DB	'This is screen one.',  00H
$SG63	DB	'This',  0aH, 'is screen',  0aH, 'two.',  00H
$SG65	DB	'This is screen three.',  00H
$SG67	DB	'This goes in the window...',  00H
$SG69	DB	'This is a real long string that won''t entirely fit into the'
	DB	' entirely fit into the window.',  00H
$SG71	DB	'This has a crlf at the end',  0aH,  00H
$SG99	DB	'%d',  00H
	PUBLIC	_str1
_str1	DW	DGROUP:$SG61
	PUBLIC	_str2
_str2	DW	DGROUP:$SG63
	PUBLIC	_str3
_str3	DW	DGROUP:$SG65
	PUBLIC	_str4
_str4	DW	DGROUP:$SG67
	PUBLIC	_str5
_str5	DW	DGROUP:$SG69
	PUBLIC	_str6
_str6	DW	DGROUP:$SG71
	PUBLIC	_frame
_frame	DW	0c9H
	DW	0bbH
	DW	0c8H
	DW	0bcH
	DW	0cdH
	DW	0baH
	DW	020H
;	.comm _scrbuff,0fa0H
;	.comm _winbuff,0fa0H
_DATA      ENDS
_TEXT      SEGMENT
; Line 29
	PUBLIC	_main
_main	PROC NEAR
	*** 000000	55 			push	bp
	*** 000001	8b ec 			mov	bp,sp
	*** 000003	b8 0a 00 		mov	ax,10
	*** 000006	e8 00 00 		call	__chkstk
;	c = -4
;	i = -8
;	row = -6
;	col = -10
;	result = -2
; Line 34
	*** 000009	e8 00 00 		call	_cls
; Line 36
	*** 00000c	b8 07 00 		mov	ax,7
	*** 00000f	50 			push	ax
	*** 000010	b8 4f 00 		mov	ax,79
	*** 000013	50 			push	ax
	*** 000014	b8 18 00 		mov	ax,24
	*** 000017	50 			push	ax
	*** 000018	2b c0 			sub	ax,ax
	*** 00001a	50 			push	ax
	*** 00001b	50 			push	ax
	*** 00001c	e8 00 00 		call	_clrwin
	*** 00001f	83 c4 0a 		add	sp,10
; Line 37
	*** 000022	e8 00 00 		call	_getche
	*** 000025	89 46 fc 		mov	[bp-4],ax	;c
; Line 38
	*** 000028	b8 01 00 		mov	ax,1
	*** 00002b	50 			push	ax
	*** 00002c	b8 30 00 		mov	ax,48
	*** 00002f	50 			push	ax
	*** 000030	ff 36 d2 00 		push	_str1
	*** 000034	2b c0 			sub	ax,ax
	*** 000036	50 			push	ax
	*** 000037	b8 02 00 		mov	ax,2
	*** 00003a	50 			push	ax
	*** 00003b	e8 00 00 		call	_vputstr
	*** 00003e	83 c4 0a 		add	sp,10
; Line 39
	*** 000041	b8 01 00 		mov	ax,1
	*** 000044	50 			push	ax
	*** 000045	b8 30 00 		mov	ax,48
	*** 000048	50 			push	ax
	*** 000049	ff 36 d2 00 		push	_str1
	*** 00004d	2b c0 			sub	ax,ax
	*** 00004f	50 			push	ax
	*** 000050	b8 03 00 		mov	ax,3
	*** 000053	50 			push	ax
	*** 000054	e8 00 00 		call	_vputstr
	*** 000057	83 c4 0a 		add	sp,10
; Line 40
	*** 00005a	b8 01 00 		mov	ax,1
	*** 00005d	50 			push	ax
	*** 00005e	b8 30 00 		mov	ax,48
	*** 000061	50 			push	ax
	*** 000062	ff 36 d2 00 		push	_str1
	*** 000066	2b c0 			sub	ax,ax
	*** 000068	50 			push	ax
	*** 000069	b8 04 00 		mov	ax,4
	*** 00006c	50 			push	ax
	*** 00006d	e8 00 00 		call	_vputstr
	*** 000070	83 c4 0a 		add	sp,10
; Line 41
	*** 000073	b8 01 00 		mov	ax,1
	*** 000076	50 			push	ax
	*** 000077	b8 30 00 		mov	ax,48
	*** 00007a	50 			push	ax
	*** 00007b	ff 36 d4 00 		push	_str2
	*** 00007f	2b c0 			sub	ax,ax
	*** 000081	50 			push	ax
	*** 000082	b8 06 00 		mov	ax,6
	*** 000085	50 			push	ax
	*** 000086	e8 00 00 		call	_writestr
	*** 000089	83 c4 0a 		add	sp,10
; Line 42
	*** 00008c	b8 01 00 		mov	ax,1
	*** 00008f	50 			push	ax
	*** 000090	b8 0f 00 		mov	ax,15
	*** 000093	50 			push	ax
	*** 000094	b8 3c 00 		mov	ax,60
	*** 000097	50 			push	ax
	*** 000098	b8 25 00 		mov	ax,37
	*** 00009b	50 			push	ax
	*** 00009c	2b c0 			sub	ax,ax
	*** 00009e	50 			push	ax
	*** 00009f	b8 09 00 		mov	ax,9
	*** 0000a2	50 			push	ax
	*** 0000a3	e8 00 00 		call	_vputnc
	*** 0000a6	83 c4 0c 		add	sp,12
	*** 0000a9	89 46 fe 		mov	[bp-2],ax	;result
; Line 43
	*** 0000ac	e8 00 00 		call	_getche
	*** 0000af	89 46 fc 		mov	[bp-4],ax	;c
; Line 44
	*** 0000b2	b8 01 00 		mov	ax,1
	*** 0000b5	50 			push	ax
	*** 0000b6	2b c0 			sub	ax,ax
	*** 0000b8	50 			push	ax
	*** 0000b9	b8 14 00 		mov	ax,20
	*** 0000bc	50 			push	ax
	*** 0000bd	b8 3c 00 		mov	ax,60
	*** 0000c0	50 			push	ax
	*** 0000c1	b8 04 00 		mov	ax,4
	*** 0000c4	50 			push	ax
	*** 0000c5	50 			push	ax
	*** 0000c6	b8 00 00 		mov	ax,OFFSET DGROUP:_winbuff
	*** 0000c9	50 			push	ax
	*** 0000ca	e8 00 00 		call	_vbufwin
	*** 0000cd	83 c4 0e 		add	sp,14
; Line 45
	*** 0000d0	b8 de 00 		mov	ax,OFFSET DGROUP:_frame
	*** 0000d3	50 			push	ax
	*** 0000d4	b8 01 00 		mov	ax,1
	*** 0000d7	50 			push	ax
	*** 0000d8	b8 30 00 		mov	ax,48
	*** 0000db	50 			push	ax
	*** 0000dc	b8 0e 00 		mov	ax,14
	*** 0000df	50 			push	ax
	*** 0000e0	b8 14 00 		mov	ax,20
	*** 0000e3	50 			push	ax
	*** 0000e4	b8 3c 00 		mov	ax,60
	*** 0000e7	50 			push	ax
	*** 0000e8	b8 04 00 		mov	ax,4
	*** 0000eb	50 			push	ax
	*** 0000ec	50 			push	ax
	*** 0000ed	e8 00 00 		call	_vputbox
	*** 0000f0	83 c4 10 		add	sp,16
; Line 46
	*** 0000f3	b8 3e 00 		mov	ax,62
	*** 0000f6	50 			push	ax
	*** 0000f7	b8 16 00 		mov	ax,22
	*** 0000fa	50 			push	ax
	*** 0000fb	b8 05 00 		mov	ax,5
	*** 0000fe	50 			push	ax
	*** 0000ff	50 			push	ax
	*** 000100	e8 00 00 		call	_window
	*** 000103	83 c4 08 		add	sp,8
; Line 47
	*** 000106	b8 01 00 		mov	ax,1
	*** 000109	50 			push	ax
	*** 00010a	b8 0b 00 		mov	ax,11
	*** 00010d	50 			push	ax
	*** 00010e	ff 36 d8 00 		push	_str4
	*** 000112	b8 05 00 		mov	ax,5
	*** 000115	50 			push	ax
	*** 000116	b8 06 00 		mov	ax,6
	*** 000119	50 			push	ax
	*** 00011a	b8 3e 00 		mov	ax,62
	*** 00011d	50 			push	ax
	*** 00011e	b8 16 00 		mov	ax,22
	*** 000121	50 			push	ax
	*** 000122	b8 05 00 		mov	ax,5
	*** 000125	50 			push	ax
	*** 000126	50 			push	ax
	*** 000127	e8 00 00 		call	_writewin
	*** 00012a	83 c4 12 		add	sp,18
; Line 48
	*** 00012d	b8 01 00 		mov	ax,1
	*** 000130	50 			push	ax
	*** 000131	b8 0b 00 		mov	ax,11
	*** 000134	50 			push	ax
	*** 000135	ff 36 da 00 		push	_str5
	*** 000139	2b c0 			sub	ax,ax
	*** 00013b	50 			push	ax
	*** 00013c	b8 08 00 		mov	ax,8
	*** 00013f	50 			push	ax
	*** 000140	b8 3e 00 		mov	ax,62
	*** 000143	50 			push	ax
	*** 000144	b8 16 00 		mov	ax,22
	*** 000147	50 			push	ax
	*** 000148	b8 05 00 		mov	ax,5
	*** 00014b	50 			push	ax
	*** 00014c	50 			push	ax
	*** 00014d	e8 00 00 		call	_writewin
	*** 000150	83 c4 12 		add	sp,18
; Line 49
	*** 000153	e8 00 00 		call	_getche
	*** 000156	89 46 fc 		mov	[bp-4],ax	;c
; Line 50
	*** 000159	c7 46 f8 0a 00 		mov	WORD PTR [bp-8],10	;i
					$F92:
; Line 51
; Line 52
	*** 00015e	83 7e f8 17 		cmp	WORD PTR [bp-8],23	;i
	*** 000162	7d 15 			jge	$I96
; Line 53
	*** 000164	b8 01 00 		mov	ax,1
	*** 000167	50 			push	ax
	*** 000168	b8 0b 00 		mov	ax,11
	*** 00016b	50 			push	ax
	*** 00016c	ff 36 dc 00 		push	_str6
	*** 000170	b8 05 00 		mov	ax,5
	*** 000173	50 			push	ax
	*** 000174	ff 76 f8 		push	WORD PTR [bp-8]	;i
	*** 000177	eb 14 			jmp	SHORT $L20001
					$I96:
; Line 55
	*** 000179	b8 01 00 		mov	ax,1
	*** 00017c	50 			push	ax
	*** 00017d	b8 0b 00 		mov	ax,11
	*** 000180	50 			push	ax
	*** 000181	ff 36 dc 00 		push	_str6
	*** 000185	b8 05 00 		mov	ax,5
	*** 000188	50 			push	ax
	*** 000189	b8 16 00 		mov	ax,22
	*** 00018c	50 			push	ax
					$L20001:
	*** 00018d	b8 3e 00 		mov	ax,62
	*** 000190	50 			push	ax
	*** 000191	b8 16 00 		mov	ax,22
	*** 000194	50 			push	ax
	*** 000195	b8 05 00 		mov	ax,5
	*** 000198	50 			push	ax
	*** 000199	50 			push	ax
	*** 00019a	e8 00 00 		call	_writewin
	*** 00019d	83 c4 12 		add	sp,18
; Line 56
	*** 0001a0	ff 46 f8 		inc	WORD PTR [bp-8]	;i
	*** 0001a3	83 7e f8 1e 		cmp	WORD PTR [bp-8],30	;i
	*** 0001a7	7c b5 			jl	$F92
; Line 57
	*** 0001a9	e8 00 00 		call	_getche
	*** 0001ac	89 46 fc 		mov	[bp-4],ax	;c
; Line 58
	*** 0001af	2b c0 			sub	ax,ax
	*** 0001b1	50 			push	ax
	*** 0001b2	b8 01 00 		mov	ax,1
	*** 0001b5	50 			push	ax
	*** 0001b6	b8 00 00 		mov	ax,OFFSET DGROUP:_scrbuff
	*** 0001b9	50 			push	ax
	*** 0001ba	e8 00 00 		call	_vidbuf
	*** 0001bd	83 c4 06 		add	sp,6
; Line 59
	*** 0001c0	e8 00 00 		call	_getche
	*** 0001c3	89 46 fc 		mov	[bp-4],ax	;c
; Line 60
	*** 0001c6	b8 01 00 		mov	ax,1
	*** 0001c9	50 			push	ax
	*** 0001ca	50 			push	ax
	*** 0001cb	b8 14 00 		mov	ax,20
	*** 0001ce	50 			push	ax
	*** 0001cf	b8 3c 00 		mov	ax,60
	*** 0001d2	50 			push	ax
	*** 0001d3	b8 04 00 		mov	ax,4
	*** 0001d6	50 			push	ax
	*** 0001d7	50 			push	ax
	*** 0001d8	b8 00 00 		mov	ax,OFFSET DGROUP:_winbuff
	*** 0001db	50 			push	ax
	*** 0001dc	e8 00 00 		call	_vbufwin
	*** 0001df	83 c4 0e 		add	sp,14
; Line 61
	*** 0001e2	e8 00 00 		call	_getche
	*** 0001e5	89 46 fc 		mov	[bp-4],ax	;c
; Line 62
	*** 0001e8	e8 00 00 		call	_cls
; Line 63
	*** 0001eb	e8 00 00 		call	_getche
	*** 0001ee	89 46 fc 		mov	[bp-4],ax	;c
; Line 64
	*** 0001f1	b8 01 00 		mov	ax,1
	*** 0001f4	50 			push	ax
	*** 0001f5	50 			push	ax
	*** 0001f6	b8 00 00 		mov	ax,OFFSET DGROUP:_scrbuff
	*** 0001f9	50 			push	ax
	*** 0001fa	e8 00 00 		call	_vidbuf
	*** 0001fd	83 c4 06 		add	sp,6
; Line 65
	*** 000200	e8 00 00 		call	_getche
	*** 000203	89 46 fc 		mov	[bp-4],ax	;c
; Line 66
	*** 000206	ff 76 fe 		push	WORD PTR [bp-2]	;result
	*** 000209	b8 cf 00 		mov	ax,OFFSET DGROUP:$SG99
	*** 00020c	50 			push	ax
	*** 00020d	e8 00 00 		call	_printf
; Line 68
	*** 000210	8b e5 			mov	sp,bp
	*** 000212	5d 			pop	bp
	*** 000213	c3 			ret	

_main	ENDP
; Line 71
	PUBLIC	_writestr
_writestr	PROC NEAR
	*** 000214	55 			push	bp
	*** 000215	8b ec 			mov	bp,sp
	*** 000217	b8 04 00 		mov	ax,4
	*** 00021a	e8 00 00 		call	__chkstk
; Line 74
;	row = 4
;	col = 6
;	str = 8
;	attr = 10
;	retrace = 12
;	c = -2
; Line 77
					$WC107:
	*** 00021d	8b 5e 08 		mov	bx,[bp+8]	;str
	*** 000220	ff 46 08 		inc	WORD PTR [bp+8]	;str
	*** 000223	8a 07 			mov	al,[bx]
	*** 000225	98 			cbw	
	*** 000226	89 46 fe 		mov	[bp-2],ax	;c
	*** 000229	0b c0 			or	ax,ax
	*** 00022b	74 5c 			je	$WB108
; Line 78
; Line 79
	*** 00022d	3d 09 00 		cmp	ax,9
	*** 000230	74 27 			je	$SC114
	*** 000232	3d 0a 00 		cmp	ax,10
	*** 000235	74 18 			je	$SC113
; Line 95
	*** 000237	ff 76 0c 		push	WORD PTR [bp+12]	;retrace
	*** 00023a	ff 76 0a 		push	WORD PTR [bp+10]	;attr
	*** 00023d	50 			push	ax
	*** 00023e	ff 76 06 		push	WORD PTR [bp+6]	;col
	*** 000241	ff 46 06 		inc	WORD PTR [bp+6]	;col
	*** 000244	ff 76 04 		push	WORD PTR [bp+4]	;row
	*** 000247	e8 00 00 		call	_vputc
	*** 00024a	83 c4 0a 		add	sp,10
; Line 96
	*** 00024d	eb ce 			jmp	SHORT $WC107
					$SC113:
; Line 82
	*** 00024f	ff 46 04 		inc	WORD PTR [bp+4]	;row
	*** 000252	c7 46 06 00 00 		mov	WORD PTR [bp+6],0	;col
; Line 97
	*** 000257	eb c4 			jmp	SHORT $WC107
					$SC114:
; Line 84
;	i = -4
; Line 85
	*** 000259	8b 46 06 		mov	ax,[bp+6]	;col
	*** 00025c	99 			cwd	
	*** 00025d	b9 08 00 		mov	cx,8
	*** 000260	f7 f9 			idiv	cx
	*** 000262	89 56 fc 		mov	[bp-4],dx	;i
; Line 87
					$WC116:
	*** 000265	83 7e fc 08 		cmp	WORD PTR [bp-4],8	;i
	*** 000269	7f b2 			jg	$WC107
; Line 88
; Line 89
	*** 00026b	ff 76 0c 		push	WORD PTR [bp+12]	;retrace
	*** 00026e	ff 76 0a 		push	WORD PTR [bp+10]	;attr
	*** 000271	b8 20 00 		mov	ax,32
	*** 000274	50 			push	ax
	*** 000275	ff 76 06 		push	WORD PTR [bp+6]	;col
	*** 000278	ff 46 06 		inc	WORD PTR [bp+6]	;col
	*** 00027b	ff 76 04 		push	WORD PTR [bp+4]	;row
	*** 00027e	e8 00 00 		call	_vputc
	*** 000281	83 c4 0a 		add	sp,10
; Line 90
	*** 000284	ff 46 fc 		inc	WORD PTR [bp-4]	;i
; Line 91
	*** 000287	eb dc 			jmp	SHORT $WC116
					$WB108:
; Line 98
	*** 000289	8b e5 			mov	sp,bp
	*** 00028b	5d 			pop	bp
	*** 00028c	c3 			ret	

_writestr	ENDP
; Line 101
	PUBLIC	_window
_window	PROC NEAR
	*** 00028d	55 			push	bp
	*** 00028e	8b ec 			mov	bp,sp
	*** 000290	33 c0 			xor	ax,ax
	*** 000292	e8 00 00 		call	__chkstk
; Line 102
;	r1 = 4
;	c1 = 6
;	r2 = 8
;	c2 = 10
; Line 103
	*** 000295	bb 40 00 		mov	bx,64
	*** 000298	8e c3 			mov	es,bx
	*** 00029a	bb 94 00 		mov	bx,148
	*** 00029d	ff 46 0a 		inc	WORD PTR [bp+10]	;c2
	*** 0002a0	8b 46 0a 		mov	ax,[bp+10]	;c2
	*** 0002a3	2b 46 06 		sub	ax,[bp+6]	;c1
	*** 0002a6	26 89 07 		mov	es:[bx],ax
; Line 104
	*** 0002a9	8b 46 04 		mov	ax,[bp+4]	;r1
	*** 0002ac	8c c3 			mov	bx,es
	*** 0002ae	bb 94 00 		mov	bx,148
	*** 0002b1	26 f7 27 		mul	WORD PTR es:[bx]
	*** 0002b4	8c c3 			mov	bx,es
	*** 0002b6	bb 9c 00 		mov	bx,156
	*** 0002b9	26 89 07 		mov	es:[bx],ax
; Line 105
	*** 0002bc	ff 46 08 		inc	WORD PTR [bp+8]	;r2
	*** 0002bf	8b 46 08 		mov	ax,[bp+8]	;r2
	*** 0002c2	2b 46 04 		sub	ax,[bp+4]	;r1
	*** 0002c5	8c c3 			mov	bx,es
	*** 0002c7	bb 94 00 		mov	bx,148
	*** 0002ca	26 f7 27 		mul	WORD PTR es:[bx]
	*** 0002cd	8c c3 			mov	bx,es
	*** 0002cf	bb 98 00 		mov	bx,152
	*** 0002d2	26 89 07 		mov	es:[bx],ax
; Line 106
	*** 0002d5	8b e5 			mov	sp,bp
	*** 0002d7	5d 			pop	bp
	*** 0002d8	c3 			ret	

_window	ENDP
_TEXT	ENDS
END

⌨️ 快捷键说明

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