一个ASM文件的显示结果 [英] Display results of an asm file

查看:179
本文介绍了一个ASM文件的显示结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想组装与TASM下面的程序在Windows 7 64位:

I'm trying to assemble the following program with Tasm on Windows 7 64bit:

.model small
.stack 100h
.data
a db 09H
b db 02H
.code 
start:
mov ax, @data
mov ds, ax
mov al, a
mov bl, b
add al, bl
mov ah, 4CH
int 21H
end start

文件名是 prog4.asm

我并遵循以下步骤:

tasm prog4.asm
tlink prog4.obj
prog4

我能够在EMU8086模拟器上运行这一点,但是我不能够看到DOSBOX命令的执行。

I am able to run this on the EMU8086 simulator, however i'm not able to see the execution of the commands on DOSBOX.

我如何加入命令后显示寄存器的值?

How can I display the register values after the addition command?

推荐答案

您基本上都要写一些code将于并输出到屏幕上逐个字符。

You basically have to write some code which will take al and output it to the screen character by character.

这可以通过按斧头,除以100,再加入48(ASCII码为0)来完成。然后该复制到DL和使用INT 21 /啊= 2,以输出它。那请问百位。

This can be done by pushing ax, dividing it by 100, then adding 48 (ascii for '0'). Then copy that to dl and use int 21/ah=2 to output it. That does the 100s digit.

同样,对于10秒的数字和1位虽然你将需要使用模以及摆脱较高的场所。

Similarly for the 10s digit and 1s digit though you'll need to use modulo as well to get rid of the higher places.

如果你想知道所有可用的中断,请参见拉尔夫·布朗的中断列表,对于这种东西真正真棒参考。

If you want to know all the available interrupts, see the ralf brown's interrupt list, a truly awesome reference for this sort of stuff.

这篇关于一个ASM文件的显示结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆