該程序需要從用戶處取一個簡單的字符串並將其顯示回來。我已經得到該程序從用戶那裏獲得輸入,但我似乎無法存儲它。這是我到目前爲止:如何獲得NASM的用戶輸入?
BITS 32
global _main
section .data
prompt db "Enter a string: ", 13, 10, '$'
input resd 1 ; something I can using to store the users input.
name db "Name: ******", 13, 10,'$'
StudentID db "********", 13, 10, '$'
InBoxID db "*************", 13, 10, '$'
Assignment db "************", 13, 10, '$'
version db "***************", 13, 10, '$'
section .text
_main:
mov ah, 9
mov edx, prompt
int 21h
mov ah, 08h
while:
int 21h
; some code that should store the input.
mov [input], al
cmp al, 13
jz endwhile
jmp while
endwhile:
mov ah, 9
; displaying the input.
mov edx, name
int 21h
mov edx, StudentID
int 21h
mov edx, InBoxID
int 21h
mov edx, Assignment
int 21h
mov edx, version
int 21h
ret
我正在組裝這個使用NASM。
我想這將是我的問題的一部分。我將如何將al的內容存儲到某種字符串中。 – Xill 2009-02-07 06:16:59