你似乎是使用大量的,根本是無效的8086或x86代碼指令!
in 00 Use a DOS function to get a character
mul al, 0a Move the number 10 to an extra register
push al Push a complete word to to stack
pop bl Pop a complete word off the stack
mod al, 0a Use the remainder you get from a division
div al, 0a Move the number 10 to an extra register
這是它可能是什麼樣子(沒有應用優化):
mov ah, 01h Input a character for the tens
int 21h
sub al, 30h Turn into number
mov bl, 10
mul al, bl Multiplies AL by BL : So times 10
push ax
mov ah, 01h Input a character for the units
int 21h
sub al, 30h Turn into number
mov ah, 0 Clear AH so addition works correctly
pop bx
add ax, bx Add tens and units
Here anything else!
mov bl, 10
div bl Divides AX by BL : Gives remainder in AH, quotient in AL
add ah, 30h Turn into character
mov [c1], ah
add al, 30h Turn into character
mov [c0], al
這不是8086,8086不能推8位'al'。你到目前爲止所做的代碼確實是一些代碼,這是一些代碼。如果你將更多的代碼放入機器,它將執行更多的代碼。也許它甚至會做一些有趣的事情。如果你確實希望每個部分都做某些特別感興趣的事情,那麼也許應該添加關於應該發生什麼的評論,以便其他人可以判斷你是否正確。也許即使你能夠認識到它是否按預期工作,如果不能,也必須有所不同。 – Ped7g