汇编SASM和MASM32问题

时间:2017-03-26 20:48:52

标签: assembly masm32

我下载了sasm和masm 32我无法运行我的代码。

.386 ; This means a 32 bit program to access 32 bit addresses 11   
.modelflat,stdcall; This specifies the calling convention for procedures 12   
.stack4096

.const
    null = 0
    min equ 1
    max equ 40

.data?
    a   dword ?
    b   dword ?
;    sum dword ?
;    randomnumber dword ?
;    arr dword 25dup(?)


.data

msg1 byte "Enter first range (5-10): ", null
msg2 byte "Enter second range (30-53): ", null
msg3 byte "The random number from ",null
msg4 byte " to ",null
msg5 byte " is ",null 
msg6 byte "The array of 25 terms has sum ",null


start:
    mov  edx, offset msg1
    call writestring
    call readint                        ;cin
    mov  a,eax

    mov  edx, offset msg2
    call writestring
    call readint                        ;cin
    mov  b,eax


    mov  edx, offset msg3
    call writestring
    mov  eax, a
    call writeint

    mov  edx, offset msg4
    call writestring

    mov  eax, b
    call writeint
    mov  edx, offset msg5
    call writestring





    call crlf

    ret 0

    start endp
       end start

0 个答案:

没有答案