由买买提看人间百态

topics

全部话题 - 话题: memoryi
(共0页)
d*******n
发帖数: 524
1
不对吧,如果需要返回表达式的值,那i++还是多一个临时变量的,时间和空间消耗都
是有区别的。
如果不需要返回,那倒是可能被compiler优化了,没有区别。
x=(++i):
mov ax, [memoryi]
inc ax
mov [memoryi], ax
mov [memoryx], [memoryi]
另外一个是
x=(i++):
mov [memoryt], [memoryi]
mov ax, [memoryi]
inc ax
mov [memoryi], ax
mov [memoryx], [memoryt]
R***a
发帖数: 41892
2
现在的编译器没那么二吧。
一看上下文不需要整个表达式的值,直接就忽略啊。
就算需要表达式的值
那也一个是
++i:
mov ax, [memoryi]
inc ax
mov [memoryi], ax
mov [memoryt] ax
另外一个是
i++
mov ax, [memoryi]
mov [memoryt], ax
inc ax
mov [memoryi], ax
R***a
发帖数: 41892
3
按你这个假设指令集可以直接mem->mem
你这个第二个可以直接改写成
mov [memoryx], [memeoryi]
mov ax, [memoryi]
inc ax
mov [memoryi], ax
有必要加个中间变量么?
h********a
发帖数: 1120
4
来自主题: Hardware版 - 这个alienware怎么样
http://deals.dell.com/productdetail/dkcwf02mbf5
1199$
Processor: Intel® Core™ i7-6700HQ (Quad-Core, 6MB Cache, up to 3.
5GHz w/ Turbo Boost)
Operating System: Windows 10 Home 64bit English
Memoryi: 8GB Dual Channel DDR4 at 2133MHz (4GBx2)
Hard Drive: 1TB 7200RPM SATA 6Gb/s
Display: 15.6 inch FHD (1920 x 1080) IPS Anti-Glare 220-nits Display
Primary Battery: 8-cell Lithium Ion (92 Wh) Battery
Video Cardi: NVIDIA® GeForce® GTX 970M with 3GB GDDR5
y****i
发帖数: 2108
5
这个怎么样?
https://deals.dell.com/productdetail/1rgu
ech Specs
Processor
8th Generation Intel® Core™ i7-8700 6-Core Processor (12MB Cache,
up to 4.6 GHz)
Operating System
Windows 10 Home 64bit English
Memoryi
8GB, DDR4 2666MHz
Hard Drive
M.2 256GB PCIe x4 SSD + 2TB 7200RPM Hard Drive
Video Cardi
NVIDIA® GeForce® GTX 1050Ti with 4GB GDDR5 Graphics Memory
Wireless
802.11ac + Bluetooth 4.2, Dual Band 2.4&5 GHz, 1x1
Optical Drive
Tray Load DVD-RW Drive (Reads and Writes to DVD/CD)
(共0页)