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

📄 circle.asm

📁 游戏编程精粹2第四章源码
💻 ASM
📖 第 1 页 / 共 5 页
字号:
CONST	ENDS
;	COMDAT ??_7length_error@std@@6B@
CONST	SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST	ENDS
;	COMDAT ??_7?$basic_streambuf@DU?$char_traits@D@std@@@std@@6B@
CONST	SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST	ENDS
;	COMDAT ??_7ctype_base@std@@6B@
CONST	SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST	ENDS
;	COMDAT ??_7out_of_range@std@@6B@
CONST	SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST	ENDS
;	COMDAT ??_7?$ctype@G@std@@6B@
CONST	SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST	ENDS
;	COMDAT ??_7invalid_argument@std@@6B@
CONST	SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST	ENDS
;	COMDAT ?_Facsav@?$_Tidyfac@V?$ctype@D@std@@@std@@0PAV?$ctype@D@2@A
_DATA	SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA	ENDS
;	COMDAT ?_Facsav@?$_Tidyfac@V?$ctype@G@std@@@std@@0PAV?$ctype@G@2@A
_DATA	SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA	ENDS
;	COMDAT ??_8?$basic_ostream@GU?$char_traits@G@std@@@std@@7B@
CONST	SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST	ENDS
;	COMDAT ??_7bad_exception@std@@6B@
CONST	SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST	ENDS
;	COMDAT ??_7bad_alloc@std@@6B@
CONST	SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST	ENDS
;	COMDAT ??_7?$basic_ostream@DU?$char_traits@D@std@@@std@@6B@
CONST	SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST	ENDS
;	COMDAT ??_7codecvt_base@std@@6B@
CONST	SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST	ENDS
;	COMDAT __TI3?AVfailure@ios_base@std@@
xdata$x	SEGMENT DWORD USE32 PUBLIC 'CONST'
xdata$x	ENDS
;	COMDAT __TI3?AVinvalid_argument@std@@
xdata$x	SEGMENT DWORD USE32 PUBLIC 'CONST'
xdata$x	ENDS
;	COMDAT __CT??_R0?AVbad_alloc@std@@@8??0bad_alloc@std@@QAE@ABV01@@Z12
xdata$x	SEGMENT DWORD USE32 PUBLIC 'CONST'
xdata$x	ENDS
;	COMDAT ??_R0?AVlogic_error@std@@@8
_DATA	SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA	ENDS
;	COMDAT ??_R0?AVexception@@@8
_DATA	SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA	ENDS
;	COMDAT __CT??_R0?AVbad_typeid@std@@@8??0bad_typeid@std@@QAE@ABV01@@Z12
xdata$x	SEGMENT DWORD USE32 PUBLIC 'CONST'
xdata$x	ENDS
;	COMDAT __CT??_R0?AVout_of_range@std@@@8??0out_of_range@std@@QAE@ABV01@@Z28
xdata$x	SEGMENT DWORD USE32 PUBLIC 'CONST'
xdata$x	ENDS
;	COMDAT __TI3?AVdomain_error@std@@
xdata$x	SEGMENT DWORD USE32 PUBLIC 'CONST'
xdata$x	ENDS
;	COMDAT ??_R0?AVbad_cast@std@@@8
_DATA	SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA	ENDS
;	COMDAT __CTA3?AVinvalid_argument@std@@
xdata$x	SEGMENT DWORD USE32 PUBLIC 'CONST'
xdata$x	ENDS
;	COMDAT ?_Psave@?1??use_facet@std@@YAABV?$ctype@D@2@ABVlocale@2@PBV32@_N@Z@4PBVfacet@42@B
_DATA	SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA	ENDS
;	COMDAT __CT??_R0?AVexception@@@8??0exception@@QAE@ABV0@@Z12
xdata$x	SEGMENT DWORD USE32 PUBLIC 'CONST'
xdata$x	ENDS
;	COMDAT __CT??_R0?AVunderflow_error@std@@@8??0underflow_error@std@@QAE@ABV01@@Z28
xdata$x	SEGMENT DWORD USE32 PUBLIC 'CONST'
xdata$x	ENDS
;	COMDAT ??_R0?AVdomain_error@std@@@8
_DATA	SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA	ENDS
;	COMDAT __CTA3?AVlength_error@std@@
xdata$x	SEGMENT DWORD USE32 PUBLIC 'CONST'
xdata$x	ENDS
;	COMDAT ??_R0?AVunderflow_error@std@@@8
_DATA	SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA	ENDS
;	COMDAT ??_7SpherePackCallback@@6B@
CONST	SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST	ENDS
;	COMDAT __CT??_R0?AVinvalid_argument@std@@@8??0invalid_argument@std@@QAE@ABV01@@Z28
xdata$x	SEGMENT DWORD USE32 PUBLIC 'CONST'
xdata$x	ENDS
;	COMDAT __CT??_R0?AVbad_exception@std@@@8??0bad_exception@std@@QAE@ABV01@@Z12
xdata$x	SEGMENT DWORD USE32 PUBLIC 'CONST'
xdata$x	ENDS
;	COMDAT ??_R0?AVfailure@ios_base@std@@@8
_DATA	SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA	ENDS
;	COMDAT __TI2?AVlogic_error@std@@
xdata$x	SEGMENT DWORD USE32 PUBLIC 'CONST'
xdata$x	ENDS
;	COMDAT __TI3?AVoverflow_error@std@@
xdata$x	SEGMENT DWORD USE32 PUBLIC 'CONST'
xdata$x	ENDS
;	COMDAT __CT??_R0?AVdomain_error@std@@@8??0domain_error@std@@QAE@ABV01@@Z28
xdata$x	SEGMENT DWORD USE32 PUBLIC 'CONST'
xdata$x	ENDS
;	COMDAT __CT??_R0?AVruntime_error@std@@@8??0runtime_error@std@@QAE@ABV01@@Z28
xdata$x	SEGMENT DWORD USE32 PUBLIC 'CONST'
xdata$x	ENDS
;	COMDAT __CTA2?AVbad_typeid@std@@
xdata$x	SEGMENT DWORD USE32 PUBLIC 'CONST'
xdata$x	ENDS
;	COMDAT ??_R0?AVinvalid_argument@std@@@8
_DATA	SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA	ENDS
;	COMDAT ??_R0?AVrange_error@std@@@8
_DATA	SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA	ENDS
;	COMDAT __TI2?AVbad_exception@std@@
xdata$x	SEGMENT DWORD USE32 PUBLIC 'CONST'
xdata$x	ENDS
;	COMDAT ?_C@?1??_Nullstr@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@CAPBDXZ@4DB
CONST	SEGMENT DWORD USE32 PUBLIC 'CONST'
CONST	ENDS
;	COMDAT __CT??_R0?AVlogic_error@std@@@8??0logic_error@std@@QAE@ABV01@@Z28
xdata$x	SEGMENT DWORD USE32 PUBLIC 'CONST'
xdata$x	ENDS
;	COMDAT __TI2?AVbad_alloc@std@@
xdata$x	SEGMENT DWORD USE32 PUBLIC 'CONST'
xdata$x	ENDS
;	COMDAT ??_R0?AVbad_exception@std@@@8
_DATA	SEGMENT DWORD USE32 PUBLIC 'DATA'
_DATA	ENDS
;	COMDAT __CTA3?AVout_of_range@std@@
xdata$x	SEGMENT DWORD USE32 PUBLIC 'CONST'
xdata$x	ENDS
FLAT	GROUP _DATA, CONST, _BSS, CRT$XCA, CRT$XCU, CRT$XCL, CRT$XCC, CRT$XCZ, xdata$x
	ASSUME	CS: FLAT, DS: FLAT, SS: FLAT
endif
_BSS	SEGMENT
_?gCount@?4??Process@CircleFactory@@QAEHXZ@4HA DD 01H DUP (?)
_?fcount@?1??Render@CircleFactory@@QAEHXZ@4HA DD 01H DUP (?)
_?dx@?BN@??Render@CircleFactory@@QAEHXZ@4HA DD 01H DUP (?)
_?dy@?BN@??Render@CircleFactory@@QAEHXZ@4HA DD 01H DUP (?)
_BSS	ENDS
CRT$XCU	SEGMENT
_$S18	DD	FLAT:_$E17
_$S24	DD	FLAT:_$E23
CRT$XCU	ENDS
_DATA	SEGMENT
_gCenterX DD	02000H
_gCenterY DD	01800H
_?x1@?6??Render@CircleFactory@@QAEHXZ@4HA DD 012cH
_?y1@?6??Render@CircleFactory@@QAEHXZ@4HA DD 0faH
_?x2@?6??Render@CircleFactory@@QAEHXZ@4HA DD 01f4H
_?y2@?6??Render@CircleFactory@@QAEHXZ@4HA DD 0190H
_?x1@?BH@??Render@CircleFactory@@QAEHXZ@4HA DD 012cH
_?y1@?BH@??Render@CircleFactory@@QAEHXZ@4HA DD 0faH
_?x2@?BH@??Render@CircleFactory@@QAEHXZ@4HA DD 01f4H
_?y2@?BH@??Render@CircleFactory@@QAEHXZ@4HA DD 0190H
_?radius@?BN@??Render@CircleFactory@@QAEHXZ@4HA DD 080H
_DATA	ENDS
CRT$XCU	SEGMENT
_$S32	DD	FLAT:_$E31
CRT$XCU	ENDS
_DATA	SEGMENT
$SG13071 DB	'Show Spheres Intersecting A Frustum', 00H
$SG13098 DB	'%d Spheres Intersected Frustum.', 00H
$SG13101 DB	'Show Spheres Intersecting A Line Segment', 00H
	ORG $+3
$SG13120 DB	'Show Spheres Within A Certain Range', 00H
$SG13121 DB	'(A) Show All', 00H
	ORG $+3
$SG13122 DB	'(F) Frustum Culling', 00H
$SG13123 DB	'(T) Ray Tracing', 00H
$SG13124 DB	'(R) Range Testing', 00H
	ORG $+2
$SG13125 DB	'(SPACE) Pause', 00H
	ORG $+2
$SG13126 DB	'(ENTER) UnPause', 00H
$SG13136 DB	'%d Spheres Intersected Ray.', 00H
$SG13156 DB	'%d Spheres Inside Range.', 00H
_DATA	ENDS
PUBLIC	??0Attractor@@QAE@XZ				; Attractor::Attractor
EXTRN	_rand:NEAR
_TEXT	SEGMENT
??0Attractor@@QAE@XZ PROC NEAR				; Attractor::Attractor

; 30   : {

	push	esi
	mov	esi, ecx

; 31   :   mX = rand()%SWID;

	call	_rand
	and	eax, -2147467265			; 80003fffH
	jns	SHORT $L14808
	dec	eax
	or	eax, -16384				; ffffc000H
	inc	eax
$L14808:
	mov	DWORD PTR [esi+4], eax

; 32   :   mY = rand()%SHIT;

	call	_rand
	cdq
	mov	ecx, 12288				; 00003000H
	idiv	ecx
	mov	DWORD PTR [esi+8], edx

; 33   : 
; 34   :   mDx = (rand()&7)-4;

	call	_rand
	and	eax, 7
	sub	eax, 4
	mov	DWORD PTR [esi+12], eax

; 35   :   mDy = (rand()&7)-4;

	call	_rand
	and	eax, 7
	sub	eax, 4
	mov	DWORD PTR [esi+16], eax

; 36   : 
; 37   : 
; 38   :   mAcount = (rand()%127)+16;

	call	_rand
	cdq
	mov	ecx, 127				; 0000007fH
	idiv	ecx

; 39   : }

	mov	eax, esi
	add	edx, 16					; 00000010H
	mov	DWORD PTR [esi], edx
	pop	esi
	ret	0
??0Attractor@@QAE@XZ ENDP				; Attractor::Attractor
_TEXT	ENDS
PUBLIC	?ResetTest@Attractor@@QAEXXZ			; Attractor::ResetTest
_TEXT	SEGMENT
?ResetTest@Attractor@@QAEXXZ PROC NEAR			; Attractor::ResetTest

; 42   : {

	push	esi
	mov	esi, ecx

; 43   :   mAcount--;

	mov	eax, DWORD PTR [esi]
	dec	eax
	mov	DWORD PTR [esi], eax

; 44   : 
; 45   :   if ( mAcount < 0 )

	jns	SHORT $L12919

; 46   :   {
; 47   :     mX = rand()%SWID;

	call	_rand
	and	eax, -2147467265			; 80003fffH
	jns	SHORT $L14810
	dec	eax
	or	eax, -16384				; ffffc000H
	inc	eax
$L14810:
	mov	DWORD PTR [esi+4], eax

; 48   :     mY = rand()%SHIT;

	call	_rand
	cdq
	mov	ecx, 12288				; 00003000H
	idiv	ecx
	mov	DWORD PTR [esi+8], edx

; 49   :     mDx = (rand()&7)-4;

	call	_rand
	and	eax, 7
	sub	eax, 4
	mov	DWORD PTR [esi+12], eax

; 50   :     mDy = (rand()&7)-4;

	call	_rand
	and	eax, 7
	sub	eax, 4
	mov	DWORD PTR [esi+16], eax

; 51   :     mAcount = (rand()%127)+16;

	call	_rand
	cdq
	mov	ecx, 127				; 0000007fH
	idiv	ecx
	add	edx, 16					; 00000010H
	mov	DWORD PTR [esi], edx
$L12919:

; 52   :   }
; 53   : 
; 54   :   mX+=mDx;

	mov	eax, DWORD PTR [esi+12]
	mov	ecx, DWORD PTR [esi+4]
	add	ecx, eax
	push	edi

; 55   :   mY+=mDy;

	mov	edi, DWORD PTR [esi+8]
	mov	DWORD PTR [esi+4], ecx
	mov	edx, ecx
	mov	ecx, DWORD PTR [esi+16]
	add	edi, ecx

; 56   : 
; 57   : 	if ( mX > SWID)

	cmp	edx, 16384				; 00004000H
	mov	DWORD PTR [esi+8], edi
	jle	SHORT $L12920

; 58   : 	{
; 59   : 		mDx*= -1;

	neg	eax
	mov	DWORD PTR [esi+12], eax
$L12920:

; 60   : 	}
; 61   : 
; 62   : 	if ( mX < 0)

	mov	eax, DWORD PTR [esi+4]
	test	eax, eax
	jge	SHORT $L12921

; 63   : 	{
; 64   : 		mDx *= -1;

	mov	edx, DWORD PTR [esi+12]
	neg	edx
	mov	DWORD PTR [esi+12], edx
$L12921:

; 65   : 	}
; 66   : 
; 67   : 	if ( mY > SHIT)

	cmp	edi, 12288				; 00003000H
	pop	edi
	jle	SHORT $L12922

; 68   : 	{
; 69   : 		mDy *= -1;

	neg	ecx
	mov	DWORD PTR [esi+16], ecx
$L12922:

; 70   : 	}
; 71   : 
; 72   : 	if (mY < 0)

	mov	eax, DWORD PTR [esi+8]
	t

⌨️ 快捷键说明

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