问题标签 [x86-16]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
3 回答
13185 浏览

c - 是否有针对 8086 的 C 编译器?

我有一个 8086 CPU 模拟器。它只模拟 8086 条指令。我现在正在寻找一个 C 编译器来定位这个模拟器。有没有 C 编译器可以做到这一点?

此外,拥有一个可用的 libc 等对我来说并不重要。模拟器使用自定义(即非 PC)硬件,因此任何 libc 甚至 ctr0 都可能不得不重写

0 投票
1 回答
1722 浏览

c - 解释 AF 标志在 x86 指令中是如何工作的?

我有一个小的 8086 仿真器,而且我已经有一个长期存在的错误 2 年了,因为 AF 在 sub 内部不能正常运行并添加指令。

我目前计算其值的方法是 8 位数字和减法:

(假设像这样的指令sub base,subt

添加它是这样的:

(对于像这样的指令add base,adder

对于此类指令,我如何正确计算模拟器中的 AF 标志?

0 投票
2 回答
10288 浏览

assembly - 汇编语言中的多维数组

大家好,任何人都可以告诉我如何用 8086 汇编语言处理二维数组。我是汇编语言编程的初学者。谢谢

0 投票
5 回答
2235 浏览

assembly - 扫描第一个零位(程序集)?

我在AH、AL、BL 和 BH寄存器中有一些数字。我需要检查数字的高半字节的每个寄存器中是否至少有一个 0 位。如果有,则放入名为check 10 的变量中,否则为 -10。

这是我尝试过的:

0 投票
2 回答
1182 浏览

emulation - Emulating a computer running MS-DOS

Writing emulators has always fascinated me. Now I want to write an emulator for an IBM PC and run MS-DOS on it (I've got the floppy image files).

I have good experience in C++ and C and basic knowledge of assembler and the architecture of a CPU. I also know that there are thousands of emulators out there doing exactly what I want to do, but I'd be doing this for pure joy only.

  • How much work do I have to expect? (If my goal is to boot DOS and create a text file with it, all emulated)

  • What CPU should I emulate ? Where can I find documentation on how the machine code is organized and which opcodes mean what, so I can unpack and execute them correctly with my emulator?

  • Does MS-DOS still run on the newest generations of processors? Would it theoretically be able to natively run on a 64-bit AMD Phenom 2 processor w/ a modern mainboard, HDD, RAM, etc.?

  • What else, besides emulating the CPU, could be an important factor (in terms of difficulty)? I would only aim for outputting / inputting text to the system via the host system's console, no sound or other more advanced IO etc.

  • Have you written an emulator yet? What was your first one for? How hard was it? Do you have any special tips for me?

Thanks in advance

0 投票
1 回答
18140 浏览

assembly - 组装中的二维数组

我在数据部分定义了一个二维数组和两个一维数组(一个用于列总和,一个用于行和),我编写了一个函数,将二维数组求和到一维数组中。我同时使用 eax 和 ebx 作为二维数组的索引,但是当 eax 或 ebx becase 1 并尝试访问内存中的未知地址时,我的程序失败。如何修复对这一行中内存的访问:

这是我的程序:

0 投票
2 回答
3400 浏览

assembly - 组装多个条件跳转

我无法为以下伪代码组织跳转(到 Assembly 8086):

我试过这样的事情:

您对如何修复此代码有任何想法吗?

0 投票
9 回答
55895 浏览

assembly - 有多少种方法可以将寄存器设置为零?

我很好奇在 x86 汇编中有多少种方法可以将寄存器设置为零。使用一条指令。有人告诉我,他设法找到至少 10 种方法来做到这一点。

我能想到的有:

0 投票
2 回答
1426 浏览

assembly - 对数组中的偶数进行计数和平均,并检查素数

mov al,2; int 21h使用 ( )时,我所有的显示都是 ASCII 。

我只能检查一种情况,但不能检查全部。如何同时检查所有并输出?

我的任务是

考虑数组中一组预先存储的 1 字节正整数元素。请执行下列操作。

  1. 计算数组中元素的数量并显示它们;
  2. 识别并显示小于特定阈值的所有数字(您可以根据需要设置此阈值)。如果没有,则显示一条消息;
  3. 识别偶数,计算它们并计算它们的平均值。显示您的结果;
  4. 识别数组中的所有素数并显示它们;
0 投票
1 回答
1690 浏览

assembly - IN/OUT 访问 2^16 以上的地址?

如何使用 IN/OUT 指令将数据加载/存储到地址大于 2 16的外围设备。

当我使用 IN/OUT 指令时,比如说OUT DX, AL,我知道 DX 的段寄存器没有被使用,所以我只能访问前 2个 16地址(因为 DX 是 16 位宽)。

我的一台设备在地址上18000h。我怎样才能达到它?内存/IO 空间重叠(未使用 M/IO 引脚),所以可以这样说