【发布时间】:2012-01-24 13:42:50
【问题描述】:
我的老板让我将其转换为组装,而我对组装知之甚少。有人可以帮帮我吗?
这是给我的C伪代码
//Global Variables
#define HRM_PERIOD 15
int hrArr [HRM_PERIOD]
int *hrPt = hrArr;
/*
Function addtoarray
Parameter: int np - a value to add to the array
Description: Stores 16-bit value np in array using global pointer hraPt.
hraPt is incremented so that the next call will add the value
to the next element in the array. The pointer wraps to start
when it reaches the end of the array
*/
void addToArray(int np)
{
*hraPt = np;// save value
hraPt++; // increment pointer
// wrap around
if (hraPt == hrArr + HRM_PERIOD)
hraPt = hrArr
}
请帮帮我
【问题讨论】:
-
适用于什么架构和处理器?
-
听起来不要太刻薄,但您的老板似乎在有效地分配任务到资源方面存在问题。如果公司需要完成组装开发,他们可能需要聘请组装开发人员。
-
你的“老板”是大学教授吗?
-
你不能用编译器来做吗?这基本上就是他们所做的,而且他们通常比我们做得更好。为什么你的老板要求你这样做?这看起来更像是家庭作业而不是工作。
-
该死的。我刚刚用 MOS-6502 程序集写了它,问题就解决了。 :-(