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 !!!!

Recommended Answers

All 3 Replies

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

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....

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

Here's the GAS manual.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.