如何使用c程序找到控制器是8位还是16位还是32位? [英] how to find the controller is 8 bit or 16 bit or 32 bit using c program?

查看:104
本文介绍了如何使用c程序找到控制器是8位还是16位还是32位?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用c或c ++程序找出我的微控制器是8位还是16位。

I want to find whether my micro-controller is 8 bit or 16 bit using c or c++ program.

推荐答案

你不能用C做到这一点程序(或任何其他语言甚至汇编程序)。微控制器具有特定的命令集。虽然来自一个系列的控制器可能具有相同或兼容的命令集,但当架构不同时,这是不正确的。 8,16和32位控制器的体系结构因设计而异,因此具有不兼容的命令集。



您必须始终检查使用的控制器类型并使用编译器或支持它的汇编程序。
You can't do that using a C program (or any other language and even assembler). Micro controllers have specific command sets. While controllers from one family may have identical or compatible command sets this is not true when the architecture is different. The architecture of 8, 16, and 32 bit controllers is different by design anf have therefore incompatible command sets.

You must always check the used controller type and use a compiler or assembler that supports it.


这篇关于如何使用c程序找到控制器是8位还是16位还是32位?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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