I can’t figure it out :( “Frame not in module. The current stack frame was not found in a loaded module. Source cannot be shown for this location.”

I just wrote this program in assembly (IA-32, MASM) and I am struggling to fix the issue that I am facing. The program compiles and I can enter my name and one singular value, then the program crashes and says “Frame not in module. The current stack frame was not found in a loaded module. Source cannot be shown for this location”. It also says “Exception thrown at 0x0019FFDC in Project.exe: 0xC0000005: Access violation executing location 0x0019FFDC” as the error. I have tried everything I can think of but I have no idea what to do.

I have tried messing around with pushing random values to the stack but it does not seem to effect anything. Here is the code for reference.



INCLUDE Irvine32.inc


.data
    ; All of the necessary strings (prompts, operators, etc) stored as bytes
    promptPt1           BYTE "We will be accumulating user-input negative integers between the specified bounds, then displaying", 0
    promptPt2           BYTE "statistics of the input values including minimum, maximum, and average values values, total sum,", 0
    promptPt3           BYTE "and total number of valid inputs.", 0
    promptName          BYTE "What is your name? ", 0
    promptHello         BYTE "Hello there, ", 0
    promptNumRange      BYTE "Please enter numbers in [-200, -100] or [-50, -1].", 0
    promptNegativeNum   BYTE "Enter a non-negative number when you are finished, and input stats will be shown.", 0
    promptEnterNum      BYTE "Enter number: ", 0
    promptInvalid       BYTE "This is not a number we're looking for (Invalid Input)!", 0
    promptMaxValid      BYTE "The maximum valid number is ", 0
    promptMinValid      BYTE "The minimum valid number is ", 0
    promptSumValid      BYTE "The sum of your valid numbers is ", 0
    promptAvg           BYTE "The rounded average is ", 0
    goodbye             BYTE "Thanks for using Integer Acumulator, goodbye.", 0
    youEntered          BYTE "You entered ", 0
    validNumbers        BYTE " valid numbers.", 0

; (insert variable definitions here)
    userName        BYTE 20 DUP(?)
    userEntry       SDWORD ?
    numCount        SDWORD 1
    numForAverage   SDWORD 1
    maxNum          SDWORD -200 ; min and max set to -200 initially for testing
    minNum          SDWORD -200
    sum             SDWORD 0
    average         SDWORD 0



.code
main PROC

    call introduction
    call getNums
    call calculate
    call results

    MOV     EDX, OFFSET goodbye
    call    WriteString
    call    CrLf


; (insert executable instructions here)

    Invoke ExitProcess,0    ; exit to operating system
main ENDP



introduction PROC
    MOV     EDX, OFFSET promptPt1
    call    WriteString
    call    CrLf
    MOV     EDX, OFFSET promptPt2
    call    WriteString
    call    CrLf
    MOV     EDX, OFFSET promptPt3
    call    WriteString
    call    CrLf
    MOV     EDX, OFFSET promptName
    call    WriteString
    MOV     EDX, OFFSET userName
    MOV     ECX, length userName-1
    call    ReadString
    call    CrLf

    MOV     EDX, OFFSET promptHello
    call    WriteString
    MOV     EDX, OFFSET userName
    call    WriteString
    call    CrLf
    call    CrLf

    MOV     EDX, OFFSET promptNumRange
    call    WriteString
    call    CrLf
    MOV     EDX, OFFSET promptNegativeNum
    call    WriteString
    call    CrLf

    ret
introduction ENDP




getNums PROC
    MOV     EAX, 0
    ; use stack to get all the values from the user stored (USE IN WHILE LOOP)
numLoop:
    MOV     EAX, userEntry
    MOV     EDX, OFFSET promptEnterNum
    call    WriteString
    call    ReadDec
    MOV     userEntry, EAX
    call    checkValidity
    CMP     EAX, 0
    JNS     continueEnd
    PUSH    EAX
    CMP     EAX, 0
    JNS     numLoop

continueEnd:

    MOV     EAX, numCount
    MOV     numForAverage, EAX

    ret
getNums ENDP



checkValidity PROC
    ; if the number entered is not between -200 and -100 or -50 and -1, jump to invalidEntry
    CMP     EAX, -1
    JG      continueFunc

    CMP     EAX, -50
    INC     numCount
    JGE     continueFunc

    CMP     EAX, -200
    JL      invalidEntry

    CMP     EAX, -100
    JG      checkMidRange
    INC     numCount
    JL      continueFunc

checkMidRange:
    CMP     EAX, -50
    JL      invalidEntry

invalidEntry: 
    MOV     EDX, OFFSET promptInvalid
    call    WriteString
    call    CrLf
    JMP     continueFunc

continueFunc:

    ret
checkValidity ENDP



calculate PROC

comparing:

    POP     EAX
    POP     EBX
    ADD     sum, EAX
    CMP     numCount, 1
    JL      continueFunc
    CMP     EAX, EBX
    JGE     greater
    JLE     less

greater:
    MOV     maxNum, EAX
    DEC     numCount
    JMP     comparing

less:
    MOV     minNum, EAX
    DEC     numCount
    JMP     comparing

continueFunc:

MOV     EDX, 0
MOV     EAX, sum
MOV     average, EAX
MOV     EAX, average
MOV     EBX, numForAverage
DIV     EBX

    ret
calculate ENDP



results PROC
    MOV     EDX, OFFSET promptMaxValid
    call    WriteString
    MOV     EAX, maxNum
    call    WriteDec
    call    CrLf

    MOV     EDX, OFFSET promptMinValid
    call    WriteString
    MOV     EAX, minNum
    call    WriteDec
    call    CrLf

    MOV     EDX, OFFSET promptSumValid
    call    WriteString
    MOV     EAX, sum
    call    WriteDec
    call    CrLf

    MOV     EDX, OFFSET promptAvg
    call    WriteString
    MOV     EAX, average
    call    WriteDec
    call    CrLf

    ret
results ENDP


END main

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật