【发布时间】:2019-05-25 17:03:12
【问题描述】:
我目前在线上遇到“抛出异常”错误
mov [ebx], eax
我找不到解决方案,因为他们都使用完全相同的代码并且它适用于他们。
这是我讲义的精确副本,它似乎适用于除我之外的其他人。
TITLE Program Template (template.asm)
; Author:
; Last Modified:
; OSU email address:
; Course number/section:
; Project Number: Due Date:
; Description:
INCLUDE Irvine32.inc
.data
intro BYTE "Fun with Arrays! by ", 0
instruction BYTE "This program generates random numbers in the range [100 .. 999], displays the original list, sorts the list, and calculates the median value. Finally, it displays the list sorted in descending order.", 0
request DWORD ?
ask_user BYTE "How many numbers should be generated? [10 ... 200]: ", 0
.code
main PROC
;call randomize
call introduction
push OFFSET request
call getData
exit ; exit to operating system
main ENDP
introduction PROC
mov edx, OFFSET intro
call WriteString
call CrLf
mov edx, OFFSET instruction
call WriteString
call CrLf
introduction ENDP
getData PROC
push ebp
mov ebp, esp
mov edx, OFFSET ask_user
call WriteString
call ReadInt
mov ebx, [ebp+8]
mov [ebx], eax
pop ebp
ret 4
getData ENDP
END main
【问题讨论】:
标签: exception assembly x86 masm masm32