0

I have some problem
I have a file .s with codes:

#double cel2fahr(double *temp)
#{
#return 1.8 * (*temp) + 32.0;
#}

.section .data
cel: .double 30.5
scale: .double 1.80
output: .asciz "The fahrenheit value is: %lf\n"

.section .text
.globl _start
_start:
  mov $cel,%eax
  call proc_cel2fahrenheit

  movl $output , %edi
  movl $0x1,%eax
  call printf
  #exit
  movl $0, %ebx
  movl $1, %eax
  int $0x80

##############################
#%edi %esi %edx %ecx %r8(%r8rd,%r8w,%r8b) %r9
#%xmm0
proc_cel2fahrenheit:
  movsd 0(%eax),%xmm0
  movl $32,%eax
  cvtsi2sd %eax,%xmm2
  movsd scale,%xmm1
  mulsd %xmm1,%xmm0
  addsd %xmm2,%xmm0
  ret
###############################

Can you tell me the program can complie and run it.
I'm using Win7 64 bit with Ubuntu 11.10 32bit
Thank you very much !!!!

2
Contributors
3
Replies
4
Views
5 Years
Discussion Span
Last Post by gusano79
0

Those are x86 instructions, and judging from the directives and comments, you could probably compile this code with GAS.

0

Those are x86 instructions, and judging from the directives and comments, you could probably compile this code with GAS.

Can you guide me ?
I don't know how to do it .
Please....

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.