English 中文(简体)
16 借方指示
原标题:16 bit asm instruction set

What set of instructions is used in COM files? I assumed it was 8086, but it seems that I was wrong. In a 8086 manual I found, shl can only accept 1 or cl for its second argument, while immediate values other than 1 work fine for me. In case it matters, I m using NASM.
Thanks for your time.

最佳回答

这是这些棘手的问题之一,答案总是误导。

a true DOS COM file has no headers and has to fit inside a single segment of memory, because it had no relocation information, DOS had to put the file where it needed, and so the only true way of being compatible (with x86) was to use 8086 compatible assembly. Edit: To clarify the above, this is because the 8086 didn t have memory pages.

在286/386系列节目中,你当然可以汇编成册,因为一旦节目运行,投技司就没有行政运行时间来阻止你,并且说你不能这样做,那是386项指示。

很幸运的是,为什么COM文件经常在Windows7 x32或完全在Windows7x64上工作,这是其原因的一部分。

由于投管处的工作方式,当你执行你的文件时,指挥.com没有上载,随后又重新上载,因此,你的文件基本上可以查阅系统的所有记忆,从理论上讲,投管处的记忆延伸者,如Phar lap s DOS/4GW和CWSDPMI。

短篇;你可以使用现行系统可以支持的任何指挥,但你只能使用16比×86的相容指挥。

If the above sounds like a PITA, it s because it was, I remember :) It s also why the .EXE format got very popular very quickly.

问题回答

真正的COM公司(我赢得了实际上属于EXEs的商号,等等)只是说它是一种简单的监督事务司可以起诉的。 无论提供何种支持。 我利用了监督事务司(COM和EXE)在8088年通过当天的i486进行方案规划,无论这种方式有何种法律指示,你都可以使用。 例如,在我的目标为“16轨”时,我经常使用32条指示和立即推力(在技术上,应称为“再模式”)。

共有两种类型的COM档案。 其中一个项目是投管处,另一个是设计在CP/MOS运行。 据我所知,监督事务司COM档案应当基于x86。 CP/M COM文档可能为8085,8080,或Wikipedia提供的Z80指令。 正如另一个答复提到的那样,COM只是一种简单的可执行的形式,可以使用任何支持的基本指示。

就SHL指示而言,现代X86硬件(perhaps x64)似乎支持使用这一指示的直接价值。 仅看8086英特时,我看不到这一点,但是,在某个时候必须添加。 这里有两处详细论述这一指示的内容:

http://siyobik.info/main/fer/instruction/SAL%2FSAR%2FSHL%2FSHR

rel=“nofollow>http://ref.x86asm.net/coder32.html





相关问题
How can I do a CPU cache flush in x86 Windows?

I am interested in forcing a CPU cache flush in Windows (for benchmarking reasons, I want to emulate starting with no data in CPU cache), preferably a basic C implementation or Win32 call. Is there a ...

What are the names of the new X86_64 processors registers?

Where can I find the names of the new registers for assembly on this architecture? I am referring to registers in X86 like EAX, ESP, EBX, etc. But I d like them in 64bit. I don t think they are the ...

How do I disassemble raw 16-bit x86 machine code?

I d like to disassemble the MBR (first 512 bytes) of a bootable x86 disk that I have. I have copied the MBR to a file using dd if=/dev/my-device of=mbr bs=512 count=1 Any suggestions for a Linux ...

32bit application access to 64bit registry

I have an OS Shell written in 32bit that is replacing the Explorer.exe of a Vista machine. I run a utility which is also written in 32bit, which allows to switch between the Explorer shell and My ...

Left Shift Overflow on 68k/x86?

I heard that the Motorola 68000 and Intel x86 architectures handle overflow from left shifting differently. Specifically the 68k LSL vs. the Intel SAL/SHL assembly instructions. Does anyone know the ...

Translate a FOR to assembler

I need to translate what is commented within the method, to assembler. I have a roughly idea, but can t. Anyone can help me please? Is for an Intel x32 architecture: int secuencia ( int n, ...

热门标签