Collector
شنبه 28 اردیبهشت 1392, 14:50 عصر
سلام
من میخوام این کد که فیبوناچی را محاسبه میکنه را در MASM 32 کامپایل کنم
اما از سگمنت ها خطا میگیره ممکنه راهنمایی بفرمایید
ld: warning: cannot find entry symbol _mainCRTStartup; defaulting to 00401000
section .bss
F resq 20 ; reserve 20*8 bytes
section .text
global _start
_start:
call Fib
Fib:
mov cx, 20 ; number of sequence elements
mov esi, F ; esi points to the begining of array F
mov rax, 0 ; rax contains the current number
mov rbx, 1 ; rbx points to the previous number
do:
mov rdx, rax ; store current number in rdx
add rax, rbx ; generate next number and store it in rax
mov rbx, rdx ; move current number to rbx
; the above 3 instructions can be replaced by 'xadd rax, rbx'
mov [esi], rax ; store the generated number in memory
add esi, 8 ; points to the next memory position
loop do ; repeat these process
end:
ret.
من میخوام این کد که فیبوناچی را محاسبه میکنه را در MASM 32 کامپایل کنم
اما از سگمنت ها خطا میگیره ممکنه راهنمایی بفرمایید
ld: warning: cannot find entry symbol _mainCRTStartup; defaulting to 00401000
section .bss
F resq 20 ; reserve 20*8 bytes
section .text
global _start
_start:
call Fib
Fib:
mov cx, 20 ; number of sequence elements
mov esi, F ; esi points to the begining of array F
mov rax, 0 ; rax contains the current number
mov rbx, 1 ; rbx points to the previous number
do:
mov rdx, rax ; store current number in rdx
add rax, rbx ; generate next number and store it in rax
mov rbx, rdx ; move current number to rbx
; the above 3 instructions can be replaced by 'xadd rax, rbx'
mov [esi], rax ; store the generated number in memory
add esi, 8 ; points to the next memory position
loop do ; repeat these process
end:
ret.