简体   繁体   English

程序集MOV不起作用,Linux和INT代码列表的调试

[英]Assembly MOV doesn't work, Debug for Linux and INT code list

I have a problem here... I'm using debug (in cmd/ms-dos) to learn some things and to peforme some commands... I set AX to 1234 and DX to ABCD . 我在这里有问题...我正在使用debug(在cmd / ms-dos中)学习一些知识并执行一些命令...我将AX设置为1234 ,将DX设置为ABCD So, I did ' -a 100 ' to register a instruction, I did: mov ah,dl And them " -g " (because I set an interruption) or "-g 102" to peforme the instruction and stop before 102 offset (if I not set the interruption). 所以,我做了' -a 100 '来注册一条指令,我做了:mov ah,dl然后他们用“ -g ”(因为我设置了一个中断)或“ -g 102”来执行该指令并在102偏移之前停止(如果我没有设置中断)。 When I peform -r to show me the registers values, they remain unchanged, this should be AX:CD34 , but AX is 1234 yet, looks like the MOV command doesn't works... what am I doing wrong? 当我执行-r给我显示寄存器值时,它们保持不变,应该是AX:CD34 ,但是AX是1234 ,看来MOV命令不起作用...我在做什么错?

http://img203.imageshack.us/img203/4866/movdxdldoesntworks.png http://img203.imageshack.us/img203/4866/movdxdldoesntworks.png

(sorry for the link, I need reputation to post image) (对不起,我需要信誉才能发布图片)

I also would like to know if exists something like Windows Debug to Linux, I mean, I have nasm and yasm in my Linux installation (Debian-based), but it's just a compiler, I need to write the code into a file, and compile it to run, we have some "emulator" or "debug" tool for ASM in Linux? 我还想知道是否存在Windows Debug to Linux之类的东西,我的意思是,我的Linux安装(基于Debian)中存在nasm和yasm,但这只是一个编译器,我需要将代码写入文件,并且编译运行,我们在Linux中有一些用于ASM的“仿真器”或“调试”工具吗? Like the Debug windows software in the picture above? 像上图中的Debug Windows软件一样?

The last thing, sorry to make the message so long with 3 questions, but I don't want to "flood" with a lot of topics, so, my last question is where can I find some kind of list of interruptions? 最后一件事,很抱歉,这么长的消息包含3个问题,但我不想淹没很多主题,所以,我的最后一个问题是,在哪里可以找到某种中断列表? I would like to find some list or manual with machine code functions. 我想找到一些带有机器代码功能的列表或手册。 In Peter Norton's book, for example, when I have "02h" in the "AH" register, I tell to DOS to print one character in the screen, and he said "if you want to find a list of functions, you can look your DOS manual", well, I can't find this dos manual (in linux we can type "man" and we have manuals for everything), the windows "help" function is only a list for simple commands, not a real manual like the unix "man". 例如,在彼得·诺顿(Peter Norton)的书中,当我在“ AH”寄存器中有“ 02h”时,我告诉DOS在屏幕上打印一个字符,他说:“如果要查找功能列表,可以查看您的DOS手册”,嗯,我找不到此dos手册(在Linux中,我们可以键入“ man”,并且我们提供了所有手册),Windows“帮助”功能仅是简单命令的列表,不是真正的手册像Unix的“男人”。

I try to find it in google, but every "DOS manual" did I found only show me simple functions like "cd, dir, format, time, blablabla", nothing real technical about the system or something... Can you help-me in find some complete list of "AH" commands and functions? 我尝试在Google中找到它,但是我发现每本“ DOS手册”都只向我显示了诸如“ cd,dir,format,time,blablabla”之类的简单功能,没有关于该系统的真正技术……我在查找“ AH”命令和功能的完整列表吗? I know INT 18h is for run Basic and INT 19h restarts the computer (a guy said to me, 18h for him doesn't run basic but restarts the computer instead of INT 19h). 我知道INT 18h用于运行Basic,而INT 19h重新启动计算机(一个人对我说,他的18h不能运行Basic,而是重新启动计算机,而不是INT 19h)。 I also find 2 or 3 more occurrences in Google, but not a "complete" list, someone have it? 我还在Google中发现了2到3个事件,但没有“完整”列表,有人知道吗?

Thanks for the help, patience and attention, I love you! 感谢您的帮助,耐心和关注,我爱您! ;) ;)

It is hard to say why it does not work in your debugger. 很难说为什么它在调试器中不起作用。 Did you try to just type this in your program and put breakpoint at the end of it to see the result? 您是否尝试仅在程序中键入此代码并将断点放在其末尾以查看结果?

Here is an answer to the question about linux debugger (they recommend GDB): Linux Assembly Debugger 以下是有关linux调试器(建议使用GDB)的问题的解答: Linux Assembly Debugger

For the third question here you have a good source of info about interrupts: http://www.cs.cmu.edu/afs/cs.cmu.edu/user/ralf/pub/WWW/files.html 对于这里的第三个问题,您有很好的中断信息: http : //www.cs.cmu.edu/afs/cs.cmu.edu/user/ralf/pub/WWW/files.html

In case link gets outdated search for "Ralf Brown's Interrupt List" 如果链接过期,请搜索“ Ralf Brown的中断列表”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM