; Library for I/O and other purposes
include c:\asmio\asm32.inc
includelib c:\asmio\asm32.lib
includelib c:\asmio\User32.lib ; SASM files for I/O
includelib c:\asmio\Kernel32.lib ; SASM files for I/O
input proto ; 0 parameters
; -------------------------------------------------------
.const ; Section to declare and initialize constants
NULL = 0
; -------------------------------------------------------
.data ; Section to declare and initialize variables
; number dword ? ;
read byte "Enter a number between 1-12: ", NULL
; -------------------------------------------------------
.code ; The actual code begins here: Main program
main proc ; Just like C++ this is the main program
invoke input
ret 0 ; need this line to return to caller
main endp ; End of the procedure main
end main ; End of the entire program
; -------------------------------------------------------
input proc
mov edx, OFFSET read
call WriteString
call ReadInt
ret
input endp
Привет всем !, это мой первый ассемблерный код, который я пытаюсь написать.
Я пытаюсь создать процедуру, которая запрашивает у пользователя ввод от 1 до 12, а затем записывает егоНа главную . Я написал процедуру ниже main, написал прототип выше main и использовал invoke для вызова процедуры в main, но столкнулся с ошибкой.
Мои ошибки:
[08:46:41] Build started...
[08:46:42] Warning! Errors have occurred in the build:
program.o : error LNK2001: unresolved external symbol _input@0
C:\Users\yp0l0\AppData\Local\Temp\SASM\SASMprog.exe : fatal error LNK1120: 1 unresolved externals
Кто-нибудь видит, гдеЯ ошибся?