【发布时间】:2013-03-15 09:12:20
【问题描述】:
很抱歉打扰我的导师。最近几天我发布了一些问题。他们已经伸出手来帮助我。 通过在 x86 机器上的 Ubuntu11.04 中通过 NASM 工作,最近我发现了另一个工作混乱。它是“我如何打印 8 位值”? 假设我的代码的 sn-p 看起来像:
section .data
var db "string"
section .text
global main
main:
nop
xor ebx,ebx
mov dl,byte[var+ebx]
mov al, dl ; setting to AL the ASCII character to write
mov bh, 0 ; setting the page number to 0 (all in the same page)
mov bl, 7 ; setting to bl the foreground pixel color
mov ah, 0xE ; INT10 E sub mode --> Write Text in Teletype Mode
int 10 ; "calling" to the interrupt.
nop
现在,我只想打印 dl。上面的代码使用了@Shmil The Cat 的提示。它会引发分段错误。我们如何解决这个问题?
提前致谢。
【问题讨论】:
-
你可以使用 C 运行时函数吗?
-
@ShmilTheCat:不。我知道我也不能在这里使用 PUSH DL 命令。因此,我正在寻求帮助
-
@AntoineMathys:先生您好!我不在dos或windows中工作。我正在开发 Ubuntu 11.04。