如果你要坚持MPLAB8,你至少应该得到“最新的和最伟大的”版本,892.你可以从http://www. McCux.com……下载/下载文件,几乎可以肯定的是,你使用的是“绝对”模式,它已经在1980年中变老了。“帮助”,“主题”,“MPASM汇编程序”。扫描索引“可重新定位对象”,以了解更多。这是说,完全可以在绝对模式下完成一个大项目,但这是你的责任,把代码划分成小于2KB的块,并且确保没有块太大。将代码划分在块之间以最小化需要从一个块跳到另一个块的次数。当您想调用另一个块中的子例程时,需要在调用之前执行页面选择,然后再调用另一个块。“PaSeEL”宏使得这很容易。你可以缩短前两个指令,像这样,但要注意,它仍然不是一个单一的指令,不只是一个BTFSC类型的指令之前!
以上来自于百度翻译
以下为原文
If you're going to stick with MPLAB8, you should at least get the "latest and greatest", version 8.92.
You can get it from
http://www.microchip.com/...ools/downloads-archive
That almost certainly means you are using "Absolute" mode, which was already getting old back in the 1980's.
In the IDE, select "Help", "Topics", "MPASM Assembler".
Scan the index for "Relocateable objects" to learn more.
That said, it is perfectly possible to do a large project in Absolute mode, but it is then YOUR RESPONSIBILITY, to divide your code up into blocks of less than 2KB, and ensure no block gets too big.
You need to divide your code between the blocks to minimise how often you need to jump from one block to another one.
When you want to call a subroutine in another block, you need to do a page select before the CALL, and another one after it. The "PAGESEL" macro makes this easy.
pagesel FAR_SUB ;prepare PCLATH with destination page (takes two instructions)
call FAR_SUB ;call to the other page
pagesel $ ;restore the page select to us
you can shorten the first two instructions like this
lcall FAR_SUB ;set PCLATH and call to the other page (this is three instructions)
pagesel $ ;restore the page select to us
but beware that it is still not a single instruction, do NOT but a BTFSC type instruction before it!
如果你要坚持MPLAB8,你至少应该得到“最新的和最伟大的”版本,892.你可以从http://www. McCux.com……下载/下载文件,几乎可以肯定的是,你使用的是“绝对”模式,它已经在1980年中变老了。“帮助”,“主题”,“MPASM汇编程序”。扫描索引“可重新定位对象”,以了解更多。这是说,完全可以在绝对模式下完成一个大项目,但这是你的责任,把代码划分成小于2KB的块,并且确保没有块太大。将代码划分在块之间以最小化需要从一个块跳到另一个块的次数。当您想调用另一个块中的子例程时,需要在调用之前执行页面选择,然后再调用另一个块。“PaSeEL”宏使得这很容易。你可以缩短前两个指令,像这样,但要注意,它仍然不是一个单一的指令,不只是一个BTFSC类型的指令之前!
以上来自于百度翻译
以下为原文
If you're going to stick with MPLAB8, you should at least get the "latest and greatest", version 8.92.
You can get it from
http://www.microchip.com/...ools/downloads-archive
That almost certainly means you are using "Absolute" mode, which was already getting old back in the 1980's.
In the IDE, select "Help", "Topics", "MPASM Assembler".
Scan the index for "Relocateable objects" to learn more.
That said, it is perfectly possible to do a large project in Absolute mode, but it is then YOUR RESPONSIBILITY, to divide your code up into blocks of less than 2KB, and ensure no block gets too big.
You need to divide your code between the blocks to minimise how often you need to jump from one block to another one.
When you want to call a subroutine in another block, you need to do a page select before the CALL, and another one after it. The "PAGESEL" macro makes this easy.
pagesel FAR_SUB ;prepare PCLATH with destination page (takes two instructions)
call FAR_SUB ;call to the other page
pagesel $ ;restore the page select to us
you can shorten the first two instructions like this
lcall FAR_SUB ;set PCLATH and call to the other page (this is three instructions)
pagesel $ ;restore the page select to us
but beware that it is still not a single instruction, do NOT but a BTFSC type instruction before it!
举报