【发布时间】:2011-04-13 00:29:07
【问题描述】:
首先,感谢迄今为止的所有帮助。
完整代码可见here
我无法理解这些行。我写了一些cmets...
例如mov es:[si+6], al 表示将al 中的数据移动到si+6 标记的内存地址(我认为这将是一个偏移量计算)。
那么循环中的add si,40是什么?
任何帮助对我来说意味着一切!谢谢。
L0_95: ; this segment prints ASCII code 0 - 95
mov si,6 ; refers to the string we declared at the beginning
mov cx,4 ; I think this is the height?
C1A:
; this loop adds the name of the column
mov al,string[0]
mov es:[si],al
mov al,string[2]
mov es:[si+6],al
mov al,string[4]
mov es:[si+24],al
mov al,string[6]
mov es:[si+28],al
add si,40 ;;;; what is this line?
loop C1A
mov si,122 ;;;; and these three lines?
mov bx,0
mov cx,4
C1B:push cx
mov cx,24
add si,40
C1C:push cx
call DEC_CONVERT
add si,2
call HEX_CONVERT
add si,2
call BIN_CONVERT
add si,2
call CHAR_CONVERT
inc bx
add si,126
pop cx
loop C1C
pop cx
sub si,3840
loop C1B
ret
L96_191:
【问题讨论】:
-
您当然可以自己谷歌或查找文档?
-
等等,你想让我们帮你理解别人三年前的 16 位 DOS 汇编语言作业吗?我们怎么知道它是否有效?
-
嗯首先我很感激来到这里。嗯...学习计算机语言的一部分就是阅读别人的代码,不是吗?与 c++ 或 java 或 python 不同,文档不是很丰富的 IMO。也许是因为我现在还是个初学者。
-
初学者没问题,我们随时为您提供帮助。但是,我建议从一些真正的学习材料开始(例如搜索“x86 教程”),而不是在一些随机论坛上找到一些未记录的作业代码。
-
8086(以及它的 16 位代码)已经有一段时间没用了。最好从 32 位 x86 代码开始。我强烈推荐Iczelion's Win32 tutorials;它们有点老了,但它们中的几乎所有东西都仍然适用。