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

📄 tetris.lst

📁 一个类linux的dos下开发的操作系统.
💻 LST
📖 第 1 页 / 共 5 页
字号:

tetris.x:     file format coff-go32

Disassembly of section .text:

40000000 <_code>:
_draw_block():
tetris.c:173
static unsigned char _dirty[SCN_HT], _screen[SCN_WID][SCN_HT];
/*****************************************************************************
*****************************************************************************/
static void draw_block(unsigned x_pos, unsigned y_pos, unsigned char color)
{
40000000:	55                   	push   %ebp
40000001:	89 e5                	mov    %esp,%ebp
40000003:	8b 45 08             	mov    0x8(%ebp),%eax
40000006:	8b 55 0c             	mov    0xc(%ebp),%edx
40000009:	8a 4d 10             	mov    0x10(%ebp),%cl
tetris.c:174
	if(x_pos >= SCN_WID)
4000000c:	83 f8 0e             	cmp    $0xe,%eax
4000000f:	76 05                	jbe    40000016 <_code+0x16>
tetris.c:175
		x_pos = SCN_WID - 1;
40000011:	b8 0e 00 00 00       	mov    $0xe,%eax
tetris.c:176
	if(y_pos >= SCN_HT)
40000016:	83 fa 13             	cmp    $0x13,%edx
40000019:	76 05                	jbe    40000020 <_code+0x20>
tetris.c:177
		y_pos = SCN_HT - 1;
4000001b:	ba 13 00 00 00       	mov    $0x13,%edx
tetris.c:180
	color &= 7;

	_screen[x_pos][y_pos] = color;
40000020:	8d 04 80             	lea    (%eax,%eax,4),%eax
40000023:	80 e1 07             	and    $0x7,%cl
40000026:	88 8c 82 18 20 00 40 	mov    %cl,0x40002018(%edx,%eax,4)
tetris.c:181
	_dirty[y_pos] = 1;
4000002d:	c6 82 00 20 00 40 01 	movb   $0x1,0x40002000(%edx)
40000034:	89 ec                	mov    %ebp,%esp
40000036:	5d                   	pop    %ebp
40000037:	c3                   	ret    

40000038 <_detect_block_hit>:
_detect_block_hit():
tetris.c:186
}
/*****************************************************************************
*****************************************************************************/
static int detect_block_hit(unsigned x_pos, unsigned y_pos)
{
40000038:	55                   	push   %ebp
40000039:	89 e5                	mov    %esp,%ebp
4000003b:	8b 45 08             	mov    0x8(%ebp),%eax
tetris.c:187
	return _screen[x_pos][y_pos];
4000003e:	8d 04 80             	lea    (%eax,%eax,4),%eax
40000041:	c1 e0 02             	shl    $0x2,%eax
40000044:	03 45 0c             	add    0xc(%ebp),%eax
40000047:	89 ec                	mov    %ebp,%esp
40000049:	5d                   	pop    %ebp
4000004a:	8a 80 18 20 00 40    	mov    0x40002018(%eax),%al
40000050:	25 ff 00 00 00       	and    $0xff,%eax
40000055:	c3                   	ret    

40000056 <.ef>:
40000056:	89 f6                	mov    %esi,%esi

40000058 <_draw_shape>:
_draw_shape():
tetris.c:192
}
/*****************************************************************************
*****************************************************************************/
static void draw_shape(unsigned x_pos, unsigned y_pos, unsigned which_shape)
{
40000058:	55                   	push   %ebp
40000059:	89 e5                	mov    %esp,%ebp
4000005b:	83 ec 1c             	sub    $0x1c,%esp
4000005e:	57                   	push   %edi
4000005f:	56                   	push   %esi
40000060:	53                   	push   %ebx
40000061:	8b 7d 08             	mov    0x8(%ebp),%edi
40000064:	8b 75 0c             	mov    0xc(%ebp),%esi
tetris.c:195
	unsigned i;

	for(i = 0; i < 4; i++)
40000067:	8b 55 10             	mov    0x10(%ebp),%edx
4000006a:	8b 4d 10             	mov    0x10(%ebp),%ecx
4000006d:	c7 45 fc 00 00 00 00 	movl   $0x0,0xfffffffc(%ebp)
40000074:	c1 e2 02             	shl    $0x2,%edx
40000077:	8d 04 11             	lea    (%ecx,%edx,1),%eax
4000007a:	c1 e0 02             	shl    $0x2,%eax
4000007d:	89 45 f8             	mov    %eax,0xfffffff8(%ebp)
40000080:	89 55 f4             	mov    %edx,0xfffffff4(%ebp)
40000083:	89 c3                	mov    %eax,%ebx
tetris.c:197
	{
		draw_block(x_pos, y_pos, _shapes[which_shape].color);
40000085:	8b 4d f8             	mov    0xfffffff8(%ebp),%ecx
40000088:	83 c4 fc             	add    $0xfffffffc,%esp
4000008b:	ba 00 10 00 40       	mov    $0x40001000,%edx
40000090:	31 c0                	xor    %eax,%eax
40000092:	8a 44 11 02          	mov    0x2(%ecx,%edx,1),%al
40000096:	50                   	push   %eax
40000097:	56                   	push   %esi
40000098:	57                   	push   %edi
40000099:	e8 62 ff ff ff       	call   40000000 <_code>
tetris.c:198
		x_pos += _shapes[which_shape].dir[i].delta_x;
4000009e:	0f bf 83 04 10 00 40 	movswl 0x40001004(%ebx),%eax
400000a5:	01 c7                	add    %eax,%edi
tetris.c:199
		y_pos += _shapes[which_shape].dir[i].delta_y;
400000a7:	0f bf 83 06 10 00 40 	movswl 0x40001006(%ebx),%eax
400000ae:	01 c6                	add    %eax,%esi
tetris.c:195
400000b0:	83 c4 10             	add    $0x10,%esp
400000b3:	83 c3 04             	add    $0x4,%ebx
400000b6:	ff 45 fc             	incl   0xfffffffc(%ebp)
400000b9:	83 7d fc 03          	cmpl   $0x3,0xfffffffc(%ebp)
400000bd:	76 c6                	jbe    40000085 <_draw_shape+0x2d>
tetris.c:201
	}
	draw_block(x_pos, y_pos, _shapes[which_shape].color);
400000bf:	8b 45 f4             	mov    0xfffffff4(%ebp),%eax
400000c2:	03 45 10             	add    0x10(%ebp),%eax
400000c5:	83 c4 fc             	add    $0xfffffffc,%esp
400000c8:	8a 04 85 02 10 00 40 	mov    0x40001002(,%eax,4),%al
400000cf:	25 ff 00 00 00       	and    $0xff,%eax
400000d4:	50                   	push   %eax
400000d5:	56                   	push   %esi
400000d6:	57                   	push   %edi
400000d7:	e8 24 ff ff ff       	call   40000000 <_code>
400000dc:	8d 65 d8             	lea    0xffffffd8(%ebp),%esp
400000df:	5b                   	pop    %ebx
400000e0:	5e                   	pop    %esi
400000e1:	5f                   	pop    %edi
400000e2:	89 ec                	mov    %ebp,%esp
400000e4:	5d                   	pop    %ebp
400000e5:	c3                   	ret    

400000e6 <.ef>:
tetris.c:202
}
400000e6:	89 f6                	mov    %esi,%esi

400000e8 <_erase_shape>:
_erase_shape():
tetris.c:206
/*****************************************************************************
*****************************************************************************/
static void erase_shape(unsigned x_pos, unsigned y_pos, unsigned which_shape)
{
400000e8:	55                   	push   %ebp
400000e9:	89 e5                	mov    %esp,%ebp
400000eb:	83 ec 0c             	sub    $0xc,%esp
400000ee:	57                   	push   %edi
400000ef:	56                   	push   %esi
400000f0:	53                   	push   %ebx
400000f1:	8b 7d 08             	mov    0x8(%ebp),%edi
400000f4:	8b 75 0c             	mov    0xc(%ebp),%esi
400000f7:	8b 45 10             	mov    0x10(%ebp),%eax
tetris.c:209
	unsigned i;

	for(i = 0; i < 4; i++)
400000fa:	c7 45 fc 00 00 00 00 	movl   $0x0,0xfffffffc(%ebp)
40000101:	8d 04 80             	lea    (%eax,%eax,4),%eax
40000104:	8d 1c 85 00 00 00 00 	lea    0x0(,%eax,4),%ebx
4000010b:	90                   	nop    
4000010c:	8d 74 26 00          	lea    0x0(%esi,1),%esi
tetris.c:211
	{
		draw_block(x_pos, y_pos, COLOR_BLACK);
40000110:	83 c4 fc             	add    $0xfffffffc,%esp
40000113:	6a 00                	push   $0x0
40000115:	56                   	push   %esi
40000116:	57                   	push   %edi
40000117:	e8 e4 fe ff ff       	call   40000000 <_code>
tetris.c:212
		x_pos += _shapes[which_shape].dir[i].delta_x;
4000011c:	0f bf 83 04 10 00 40 	movswl 0x40001004(%ebx),%eax
40000123:	01 c7                	add    %eax,%edi
tetris.c:213
		y_pos += _shapes[which_shape].dir[i].delta_y;
40000125:	0f bf 83 06 10 00 40 	movswl 0x40001006(%ebx),%eax
4000012c:	01 c6                	add    %eax,%esi
tetris.c:209
4000012e:	83 c4 10             	add    $0x10,%esp
40000131:	83 c3 04             	add    $0x4,%ebx
40000134:	ff 45 fc             	incl   0xfffffffc(%ebp)
40000137:	83 7d fc 03          	cmpl   $0x3,0xfffffffc(%ebp)
4000013b:	76 d3                	jbe    40000110 <_erase_shape+0x28>
tetris.c:215
	}
	draw_block(x_pos, y_pos, COLOR_BLACK);
4000013d:	83 c4 fc             	add    $0xfffffffc,%esp
40000140:	6a 00                	push   $0x0
40000142:	56                   	push   %esi
40000143:	57                   	push   %edi
40000144:	e8 b7 fe ff ff       	call   40000000 <_code>
40000149:	8d 65 e8             	lea    0xffffffe8(%ebp),%esp
4000014c:	5b                   	pop    %ebx
4000014d:	5e                   	pop    %esi
4000014e:	5f                   	pop    %edi
4000014f:	89 ec                	mov    %ebp,%esp
40000151:	5d                   	pop    %ebp
40000152:	c3                   	ret    

40000153 <.ef>:
tetris.c:216
}
40000153:	90                   	nop    

40000154 <_detect_shape_hit>:
_detect_shape_hit():
tetris.c:221
/*****************************************************************************
*****************************************************************************/
static int detect_shape_hit(unsigned x_pos, unsigned y_pos,
		unsigned which_shape)
{
40000154:	55                   	push   %ebp
40000155:	89 e5                	mov    %esp,%ebp
40000157:	83 ec 0c             	sub    $0xc,%esp
4000015a:	57                   	push   %edi
4000015b:	56                   	push   %esi
4000015c:	53                   	push   %ebx
4000015d:	8b 7d 08             	mov    0x8(%ebp),%edi
40000160:	8b 75 0c             	mov    0xc(%ebp),%esi
40000163:	8b 45 10             	mov    0x10(%ebp),%eax
tetris.c:224
	unsigned i;

	for(i = 0; i < 4; i++)
40000166:	c7 45 fc 00 00 00 00 	movl   $0x0,0xfffffffc(%ebp)
4000016d:	8d 04 80             	lea    (%eax,%eax,4),%eax
40000170:	8d 1c 85 06 10 00 40 	lea    0x40001006(,%eax,4),%ebx
tetris.c:226
	{
		if(detect_block_hit(x_pos, y_pos))
40000177:	83 c4 f8             	add    $0xfffffff8,%esp
4000017a:	56                   	push   %esi
4000017b:	57                   	push   %edi
4000017c:	e8 b7 fe ff ff       	call   40000038 <_detect_block_hit>
40000181:	83 c4 10             	add    $0x10,%esp
40000184:	85 c0                	test   %eax,%eax
40000186:	75 29                	jne    400001b1 <_detect_shape_hit+0x5d>
tetris.c:228
			return 1;
		x_pos += _shapes[which_shape].dir[i].delta_x;
40000188:	0f bf 43 fe          	movswl 0xfffffffe(%ebx),%eax
4000018c:	01 c7                	add    %eax,%edi
tetris.c:229
		y_pos += _shapes[which_shape].dir[i].delta_y;
4000018e:	0f bf 03             	movswl (%ebx),%eax
40000191:	01 c6                	add    %eax,%esi
tetris.c:224
40000193:	83 c3 04             	add    $0x4,%ebx
40000196:	ff 45 fc             	incl   0xfffffffc(%ebp)
40000199:	83 7d fc 03          	cmpl   $0x3,0xfffffffc(%ebp)
4000019d:	76 d8                	jbe    40000177 <_detect_shape_hit+0x23>
tetris.c:231
	}
	if(detect_block_hit(x_pos, y_pos))
4000019f:	83 c4 f8             	add    $0xfffffff8,%esp
400001a2:	56                   	push   %esi
400001a3:	57                   	push   %edi
400001a4:	e8 8f fe ff ff       	call   40000038 <_detect_block_hit>
400001a9:	85 c0                	test   %eax,%eax
400001ab:	75 04                	jne    400001b1 <_detect_shape_hit+0x5d>
tetris.c:233
		return 1;
	return 0;
400001ad:	31 c0                	xor    %eax,%eax
400001af:	eb 05                	jmp    400001b6 <_detect_shape_hit+0x62>
tetris.c:232
400001b1:	b8 01 00 00 00       	mov    $0x1,%eax
400001b6:	8d 65 e8             	lea    0xffffffe8(%ebp),%esp
400001b9:	5b                   	pop    %ebx
400001ba:	5e                   	pop    %esi
400001bb:	5f                   	pop    %edi
400001bc:	89 ec                	mov    %ebp,%esp
400001be:	5d                   	pop    %ebp
400001bf:	c3                   	ret    

400001c0 <_init_screen>:
_init_screen():
tetris.c:241
}
/*****************************************************************************
*****************************************************************************/
static void init_screen(void)
{
	unsigned x_pos, y_pos;

	for(y_pos = 0; y_pos < SCN_HT; y_pos++)
400001c0:	55                   	push   %ebp
400001c1:	89 e5                	mov    %esp,%ebp
400001c3:	57                   	push   %edi
400001c4:	56                   	push   %esi
400001c5:	53                   	push   %ebx
400001c6:	31 c9                	xor    %ecx,%ecx
400001c8:	be 18 20 00 40       	mov    $0x40002018,%esi
400001cd:	bf 30 21 00 40       	mov    $0x40002130,%edi
tetris.c:244
	{
/* force entire screen to be redrawn */
		_dirty[y_pos] = 1;
400001d2:	c6 81 00 20 00 40 01 	movb   $0x1,0x40002000(%ecx)
tetris.c:245
		for(x_pos = 1; x_pos < (SCN_WID - 1); x_pos++)
400001d9:	ba 01 00 00 00       	mov    $0x1,%edx
400001de:	8d 59 01             	lea    0x1(%ecx),%ebx
400001e1:	8d 44 0e 14          	lea    0x14(%esi,%ecx,1),%eax
tetris.c:246
			_screen[x_pos][y_pos] = 0;
400001e5:	c6 00 00             	movb   $0x0,(%eax)
tetris.c:245
400001e8:	83 c0 14             	add    $0x14,%eax
400001eb:	42                   	inc    %edx
400001ec:	83 fa 0d             	cmp    $0xd,%edx
400001ef:	76 f4                	jbe    400001e5 <_init_screen+0x25>

⌨️ 快捷键说明

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