嗨…我试图把一些汇编代码(合理的复杂度)给17C176到16F1719,并且有字大小的问题。17C代码使用RES指令在RAM组中分配内存,它指定要分配的字节数。例如,温度Res 2与16F分配2字节,相同的语句分配2个字。我找不到另一个分配字节的指令:似乎DB指令只能用于“代码”(即初始化常数)。不幸的是,我们使用的是MPASM 5.73,所有的银行都是满的,并且没有足够的空间来存储两个字节以用于单个字节变量,所以我需要找到一种在存储的RAM中声明单个字节的方法。有人知道怎么做吗?我怀疑我忽略了一些显而易见的东西。
以上来自于百度翻译
以下为原文
Hi..
I am trying to port some assembly code (of reasonable complexity) for a 17c756 to the 16f1719,
and have an issue with word size.
The 17c code used the RES direc
tive to allocate memory in the RAM banks, which specifies the number
of bytes to allocate. E.g. TEMPERATURE RES 2 allocates 2 bytes
With the 16f, the same statement allocates 2 WORDS. I couldn't find an alternative directive to allocate
bytes: it seems as if the DB directive can only be used for 'CODE' (i.e. initialised constants).
We are using MPASM 5.73
Unfortunately, all of the banks are quite full, and there isn't enough space to reserve two bytes for each
single byte variable, so I need to find a way of declaring single bytes in the banked RAM.
Does anyone know how to do this? I suspect that I have overlooked something embarassingly obvious.