回 帖 发 新 帖 刷新版面

主题:十万火急!!!各位请帮一下

编程要求:输入任意一位十进制数,求它的立方值!
后天就要交作业了,希望各位大哥大姐能帮小弟我一下!!

回复列表 (共2个回复)

沙发

.386
.MODEL FLAT

INCLUDE io.h

ExitProcess PROTO NEAR32 stdcall, dwExitCode:DWORD

cr          EQU    0dh   ; carriage return character
Lf          EQU    0ah   ; linefeed character

.STACK  4096             ; reserve 4096-byte stack

.DATA                    ; reserve storage for data
prompt      byte    "please input a value:",0
number      byte    20 dup(?)
prompt1     byte    "the result is:"
value       byte    11 dup(?)


.CODE                               ; start of main program code
_start:
       output prompt
       input  number,20
       atod   number
       mov    ebx,eax

       imul  eax
       imul  ebx
       
       dtoa  value,eax
       output  prompt1

endUntilDone:

            INVOKE ExitProcess, 0   ; exit with return code 0
PUBLIC _start                       ; make entry point public
            END                     ; end of source code

这是32位的程序。
用的是MASM 6.11。你看看合适吗?我已经运行过了,对的。

板凳

谢谢楼上的,我先去试试看了!!

我来回复

您尚未登录,请登录后再回复。点此登录或注册