expr.asm

来自「想学习汇编语言的」· 汇编 代码 · 共 25 行

ASM
25
字号
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 + =
减小字号Ctrl + -
显示快捷键?