私は 16 ビットのリアル モード オペレーティング システムを作成しており、ユーザーが入力するコマンドを渡したいと考えています。入力はできますが、後で解析できるように結果の文字列を格納する方法がわかりません。各キャラクターをスタックに置き、使用したいときにポップしてリバースするよりも良い方法はありますか?
私のメインループ:
mainLoop:
mov bx, s_PROMPT
call printStr ; print the 'MOOS> ' prompt
inputLoop:
call getKeyPress ; wait for the user to press a key
call printChar ; print the pressed key so the user can
; see what they've typed
push bl???
cmp bl, 0xD ; 0xD = 13 = ASCII code for enter
jne inputLoop ; go to inputLoop if does not equal enter
call newLine
jmp mainLoop
ちなみにOSはMOOSという。
助けてくれる人に感謝します。