任何汇编语言都被认为有用的最低指令集是什么? [英] What is the minimum instruction set required for any Assembly language to be considered useful?

查看:138
本文介绍了任何汇编语言都被认为有用的最低指令集是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通常在学习汇编程序设计,因此我决定尝试用软件实现虚拟微处理器",该软件具有寄存器,标志和RAM,可以使用变量和数组来实现.但是由于我只想模拟任何微处理器的最基本行为,所以我想创建一种只包含基本指令的汇编语言,而只有这些指令不能使用.我的意思是,有些汇编语言可以执行乘法和交换寄存器值等操作,但是这些操作不是基本操作,因为您可以使用更简单的指令来实现它们.我不想执行类似的指令.

I am studying Assembly programming in general, so I've decided to try and implement a "virtual microprocessor" in software, which has registers, flags and RAM to work with, implemented with variables and arrays. But since I want to simulate only the most basic behavior of any microprocessor, I want to create an assembly language that has only the essential instructions, only those instructions without which it couldn't be useful. I mean, there are assembly languages that can do multiplication and swapping register values, etc, but these operations are not basic because you can implement them using simpler instructions. I don't want to implement instructions like those.

我可以想象一些指令(我相信)必须始终以任何汇编语言出现,例如 MOV 用于移动字节,而 JP 用于发送字节.指向另一个地址的指令指针.

I can imagine a couple of instructions which (I believe) must always be present in any assembly language, such as MOV to move bytes around and JP to send the instruction pointer to another address.

您能建议一套最基本和必要的组装说明吗?谢谢!

Could you suggest a set of the most basic and essential assembly instructions? Thanks!

推荐答案

嗯,这是一个非常广泛的主题.我想您需要熟悉随机访问计算机.我不是专家,但是很难说出此基本微处理器应支持哪些指令.例如:减法和乘法可以通过加法运算来模拟.如果微处理器支持跳转和条件指令,则可以进行乘法运算,并且可以通过加负数来进行减法运算.

Well, this is a very broad subject. I suppose you need to get familiar with Random Access Machine. I'm not an expert, but it's difficult to tell which instructions should be supported by this very basic microprocessor. For example: Subtraction and multiplication may be simulated by Addition operation. Multiplication is possible if microprocessor supports jumps and conditional instructions and subtraction is possible by adding negative number.

这篇关于任何汇编语言都被认为有用的最低指令集是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆