這是代碼的一部分,它乘以2和3:在上面的代碼MOV指令操作數鍵入
section .text
global _start
_start:
mov al,'3'
sub al, '0'
mov bl, '2'
sub bl, '0'
mul bl
add al, '0'
;first question ->
mov [res], al
mov ecx,msg
mov edx, len
mov ebx,1 ;file descriptor (stdout)
mov eax,4 ;system call number (sys_write)
int 0x80
;second question ->
mov ecx,res
mov edx, 1
mov ebx,1 ;file descriptor (stdout)
mov eax,4 ;system call number (sys_write)
int 0x80
mov eax,1 ;system call number (sys_exit)
int 0x80
section .data
msg db "The result is:", 0xA,0xD
len equ $- msg
segment .bss
res resb 1
:
- 我們爲什麼要使用
mov [res], al
,不使用mov res, al
? - 我們爲什麼要用
mov ecx,res
而不用mov ecx,[res]
?
****更新
我知道,一個是地址等是該值,但我不知道爲什麼...
一個需要的地址,另一個值存儲在該地址 –
tnx我的朋友。我知道,但我不知道爲什麼? – arianpress