アセンブリ言語に問題があります。ユーザーはキーボードから数値を入力する必要があり、その数値を使用していくつかの操作を行います。これを使用しても大丈夫ですか:
LEA DX ,SIZE;before in SEGMENT "DATA": SIZE DB 7
MOV AH,9
INT 21H
それで、答えてください、これはうまくいきますか、例を挙げてください。そして、この番号はどこに保存されますか? AXで?ありがとう。PS私はemu8086で書いています。
サンプル コードによると、古い DOS の答えが必要です。Robert Harvey のコメントで述べたように、割り込み 21h の関数 09 は出力用です。関数 0Ah は入力を担当します。これは私の他の最近の回答から取られたサンプルコードです:
.data
Mystr db 'sssssssdsdsdsdsdsdsdddddddddddddd' ;reserve some space for the input
;some other data
.code
;... some code
mov ax, @data ;this line may depend on actual assembler (works with MASM, check for exact syntax of your assembler if it doesn't work for you)
mov ds, ax
mov dx, Mystr ; now ds:dx is pointing to Mystr string
; some assemblers accept mov dx, offset Mystr or similar syntax
mov ah, 0Ah ; Function 0Ah
int 21h ;invoke the DOS function, which reads the input from the keyboard and saves it into Mystr