用汇编语言打印出一个数字? [英] Printing out a number in assembly language?
本文介绍了用汇编语言打印出一个数字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
mov al,10
add al,15
如何打印al"的值?
推荐答案
你试过 int 21h
服务 2?DL
是要打印的字符.
Have you tried int 21h
service 2? DL
is the character to print.
mov dl,'A' ; print 'A'
mov ah,2
int 21h
要打印整数值,您必须编写一个循环来将整数分解为单个字符.如果你可以用十六进制打印值,这很简单.
To print the integer value, you'll have to write a loop to decompose the integer to individual characters. If you're okay with printing the value in hex, this is pretty trivial.
如果您不能依赖 DOS 服务,您也可以使用 BIOS int 10h
将 AL
设置为 0Eh
或 0Ah
.
If you can't rely on DOS services, you might also be able to use the BIOS int 10h
with AL
set to 0Eh
or 0Ah
.
这篇关于用汇编语言打印出一个数字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文