标签:style blog class code c java
转换公式:C = (5/9) * (F-32) ;其中F是华氏温度,C是摄氏温度
1 ; Example assembly language program -- adds two numbers 2 ; Author: karllen 3 ; Date: revised 5/2014 4 5 .386 6 .MODEL FLAT 7 8 ExitProcess PROTO NEAR32 stdcall, dwExitCode:DWORD 9 10 INCLUDE io.h ; header file for input/output 11 12 cr EQU 0dh ; carriage return character 13 Lf EQU 0ah ; line feed 14 15 .STACK 4096 ; reserve 4096-byte stack 16 17 .DATA 18 promot1 BYTE "Please enter a number as a Fahrenheit ",cr,Lf,0 19 value BYTE 11 DUP(?) 20 answer BYTE "The Temperature is" 21 va BYTE 11 DUP(?) 22 BYTE cr,Lf,0 23 24 ;C = (5/9) * (F-32) 25 26 .CODE 27 _start: 28 output promot1 29 input value,11 30 atod value 31 sub eax,32 ;eax = F-32 32 mov ebx,eax ;ebx = F-32 33 34 mov eax,1 ;eax = eax/edx 5/9 35 36 mul ebx ;eax*ebx 37 38 dtoa va,eax 39 output answer 40 41 INVOKE ExitProcess, 0 ; exit with return code 0 42 43 PUBLIC _start ; make entry point public 44 45 END ; end of source code
汇编语言-华氏温度转换为摄氏温度,布布扣,bubuko.com
标签:style blog class code c java
原文地址:http://www.cnblogs.com/Forever-Kenlen-Ja/p/3734457.html