有人可以解释这是如何工作的? [英] Can someone explain how this work?

查看:61
本文介绍了有人可以解释这是如何工作的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

mov ah, 02
mov cl, 19
mov bh, 01
mov dl, 41
int 21
mov dh, dl
mov dl, 0a
int 21
mov dl, 0d
int 21
mov bl, cl
inc bh
inc dh
mov cl, bh
mov dl, dh
int 21
loop 011e
mov cl, bl
loop 010a
int 20





它有一个输出

A

BB

CCC

DDDD

...

等等到'Z'

i只需要对cl,bh和dh进行一些解释

谢谢如果有人能够彻底解释它,那就前进并生病了



it has an output of
A
BB
CCC
DDDD
...
and so on up to 'Z'
i just need some explanation on cl,bh,and dh
thanks in advance and ill appreciate it if someone could explain it thoroughly

推荐答案

不!

一个人我不会去:它太多了工作!



相反,坐下来用一张纸和一支铅笔,然后创建一堆盒子 - 每个寄存器一个。然后浏览代码并在指令执行时填写框并更改值。

慢慢地,你的两个循环应该是什么,以及每个指令如何对此做出贡献。



如果您了解装配说明及其操作,那就很明显了。如果你不这样做,那么你需要 - 而你唯一能做到的就是自己执行它们,看看会发生什么。并且手动代码可能是最好的方法。



除此之外,我们甚至不知道确切的位置:你的循环是绝对地址而不是标签,所以我们必须猜测是什么 - 并且猜测不是解决 任何 计算问题的好方法。



如果您不理解,为什么要写它?更重要的是,如何?
No!
I for one am not going to: it's just too much work!

Instead, sit down with a piece of paper and a pencil, and create a bunch of boxes - one for each register being used. Then go through the code and fill in the boxes as the instructions execute and change the values.
Slowly, it should be obvious what your two loops do, and how each instruction contributes to that.

The thing is that if you understand the assembly instructions and what they do, it's pretty obvious. If you don't, then you need to - and the only way you will do that is to execute them yourself and see what happens. And "hand-cranking" the code is probably the best way of doing that.

To add to that, we don;t even know exactly where anything is: your loops are to absolute addresses rather than labels, so we would have to guess what is where - and guessing is not a good solution to any computing problem.

If you didn't understand it, why did you write it? And more to the point, how?


我已经提供了一个解释和伪代码来解决问题,在如何显示? [ ^ ]。
I already provided an explanation, and pseudo code to solve the problem, at How Do I Get To Display This?[^].


这篇关于有人可以解释这是如何工作的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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