関連するが、現在の状況には役立たない: nasm dos interrupt (output string)
(これは重複していないことを明確にしたかっただけです)
私がやろうとしているのは、ユーザーに「Enter a Base 10 number:」というプロンプトを作成することです。その後、その数値を 2 進数、8 進数、16 進数に変換します。しかし、私は問題に出くわしています。それは非常に単純だと確信していますが、何が問題なのかを理解するにはあまりにも長い間このコードを見つめてきました。
「Enter a Base Ten Number:」が出力され、約 3 回点滅して、DOSbox エミュレータが自動的にシャットダウンされます。何か案は?
コードは次のとおりです。
org 0x100
mov bx, 1 ;init bx to 1
mov ax, 0100h
mov dx, msg ;message's address in dx
mov cx, len
mov ah, 0x40
int 0x21
msg db 'Enter a Base Ten Number: '
len equ $ -msg
;all of the code above runs fine it seems. It gets to this point
;but does not then run the following code
mov ah, 9
int 21h
while:
cmp ax, 13 ;is char = carriage return?
je endwhile ;if so, we're done
shl bx, 1 ;multiplies bx by 2
and al, 01h ;convert character to binary
or bl, al ;"add" the low bit
int 21h
jmp while
endwhile