私はいくつかのアセンブリ言語(x86 Irvine.32 windows7)の学習に取り組んでおり、ユーザーからの入力方法について質問しました。私が持っている本はあまりにも深刻ではありません。私は、ユーザーを促したいと思います:基本的なユーザー入力
myfirst BYTE "Welcome! This program calculates the sum of a list of numbers.", 0dh, 0ah, 0dh, 0ah ; greeting
BYTE "How many integers will be added? : "
、私はどのようなユーザ入力を読み込み、変数に入れてはどうすればよいのユーザの意志入力X.?
は、それが同じくらい簡単です:SomeVairableは、バイトとして.dataセクションにアップ定義されて
INVOKE ReadConsole, SomeVairable
?
編集:
INCLUDE Irvine32.inc
BufSize = 80
.data
buffer BYTE BufSize DUP(?)
stdInHandle HANDLE ?
bytesRead DWORD ?
myfirst BYTE "Welcome! This program calculates the sum of a list of numbers.", 0dh, 0ah, 0dh, 0ah ; greeting
BYTE "How many integers will be added? : "
mysecond BYTE "Please enter the "
.code
main PROC
mov edx, OFFSET myfirst ;move the location of myfirst into edx
call WriteString
; Get handle to standard input
INVOKE GetStdHandle, STD_INPUT_HANDLE
mov stdInHandle,eax
; Wait for user input
INVOKE ReadConsole, stdInHandle, ADDR buffer,
BufSize, ADDR bytesRead, 0
exit
main ENDP
END main
どのプラットフォーム/ OSですか? – kuba
オリジナルを編集しました。 – Nogg
これはあなたを助けるべきであるhttp://stackoverflow.com/questions/523185/a-simple-assembly-input-question –