answersLogoWhite

0


Best Answer

## temp.a ask user for temperature in Celsius,

## convert to Fahrenheit, print the result.

##

## v0 - reads in celsius

## t0 - holds Fahrenheit result

## a0 - points to output strings

##

#################################################

# #

# text segment #

# #

#################################################

.text

.globl __start

__start:

la $a0,prompt # print prompt on terminal

li $v0,4

syscall

li $v0,5 # syscall 5 reads an integer

syscall

mul $t0,$v0,9 # to convert,multiply by 9,

div $t0,$t0,5 # divide by 5,then

add $t0,$t0,32 # add 32

la $a0,ans1 # print string before result

li $v0,4

syscall

move $a0,$t0 # print result

li $v0,1

syscall

la $a0,endl # system call to print

li $v0,4 # out a newline

syscall

li $v0,10

syscall # au revoir...

#################################################

# #

# data segment #

# #

#################################################

.data

prompt: .asciiz "Enter temperature (Celsius): "

ans1: .asciiz "The temperature in Fahrenheit is "

endl: .asciiz "\n"

##

## end of file temp.a

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Assembly language programme 8051 convert degree to Fahrenheit?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What application will be used to convert an assembly language source program into machine language?

An Assembler converts assembly language instructions into machine language.


Name all the software package convert assembly language to machine language?

Assembler.


How would you define assembly language?

assembly language uses abbreviation called menmonics.it is a bit easier to write computer programs in assembly language as compared to machine language but still requires skill and experienci.A program called assembler is used to convert an assembly language into machine language.


Why you use assembler?

Assemblers are used to convert a specific assembly language into bytecode.


Why use assembler?

Assemblers are used to convert a specific assembly language into bytecode.


How do you translate pascal language to assembly language?

Why would you want to do that? The usual procedure is to translate a high-level language such as Pascal to machine language. If you really want assembly language - perhaps to see how the Pascal compiler does its work - then presumably you can use a disassembler to convert the machine language (the executable file) into assembly language.


Are machine language and assembly language the same?

No, they are not the same. Assembly language uses mnemonic words to REPRESENT machine language; to be able to actually run it, a special program - a so-called assembler - then needs to convert it into machine language.


How do you convert binary to hexadecimal using assembly language?

In order to convert binary to hexadecimal using assembly language, the programmer must possess an understanding on boolean algebra or binary system in other words. A compiler is also needed to complete the program.


Free software to convert hex code into assembly language?

"http://wiki.answers.com/Q/Free_software_to_convert_hex_code_into_assembly_language"


What is the name of the translator used by Assembly Language?

Assembly language does not use a traditional translator; instead, it uses an assembler to convert its mnemonics into machine code. The assembler translates the assembly instructions into binary code that the computer's CPU can understand and execute.


How to convert hexadecimal into decimal and print it on screen in assembly language value 1b convert it into decimal?

1B base 16 = 27 base10


What is pass1 assembler?

pass 1 assembler is assembler which convert assembly level language into machine level language in one pass only