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

📄 expr.asm

📁 想学习汇编语言的
💻 ASM
字号:
TITLE FPU Expression Evaluation              (Expr.asm)

; Implementation of the following expression:
;     (6.0 * 2.0) + (4.5 * 3.2)
; FPU instructions used.
; Last update: 10/8/01

INCLUDE Irvine32.inc	; 32-bit Protected mode program.

.data
array      REAL4 6.0, 2.0, 4.5, 3.2
dotProduct REAL4 ?

.code
main PROC
	finit	; initialize FPU
	fld  array	; push 6.0 onto the stack
	fmul array+4	; ST(0) = 6.0 * 2.0
	fld  array+8	; push 4.5 onto the stack
	fmul array+12	; ST(0) = 4.5 * 3.2
	fadd 	; ST(0) = ST(0) + ST(1)
	fstp dotProduct  	; pop stack into memory operand
	exit
main ENDP
END main

⌨️ 快捷键说明

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