主题:十万火急!!!各位请帮一下
gundamgbe
[专家分:0] 发布于 2007-01-04 13:05:00
编程要求:输入任意一位十进制数,求它的立方值!
后天就要交作业了,希望各位大哥大姐能帮小弟我一下!!
回复列表 (共2个回复)
沙发
永远精湛 [专家分:1440] 发布于 2007-01-05 12:42:00
.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。你看看合适吗?我已经运行过了,对的。
板凳
gundamgbe [专家分:0] 发布于 2007-01-05 17:48:00
谢谢楼上的,我先去试试看了!!
我来回复