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

📄 ex6_6.ibm

📁 汇编编程艺术
💻 IBM
字号:
; IBML Sample program #6.
; This code compares the execution
; time of the MUL instruction vs.
; various shift and add equivalents.

#repetitions 480000
#unravel 1

; The following check checks to see how
; long it takes to multiply two values
; using the IMUL instruction.

#code ("Multiply by 15 using IMUL")
%do
		.286
		mov	cx, 128
		mov	bx, 15
MulLoop1:	mov	ax, cx
		imul	bx
		loop	MulLoop1

#endcode

; Do the same test using the extended IMUL
; instruction on 80286 and later processors.

#code ("Multiplying by 15 using IMUL")
%do
		mov	cx, 128
MulLoop2:	mov	ax, cx
		imul	ax, 15
		loop	MulLoop2

#endcode


; Now multiply by 15 using a shift by four
; bits and a subtract.

#code ("Multiplying by 15 using shifts and sub")
%init
%do
		mov	cx, 128
MulLoop3:	mov	ax, cx
		mov	bx, ax
		shl	ax, 4
		sub	ax, bx
		loop	MulLoop3

#endcode
#end

⌨️ 快捷键说明

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