1
0
mirror of https://github.com/cc65/cc65.git synced 2024-11-19 06:31:31 +00:00

Move code to a subroutine.

git-svn-id: svn://svn.cc65.org/cc65/trunk@3804 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2007-08-31 20:23:37 +00:00
parent e8b90752d9
commit 10efd998e0
3 changed files with 16 additions and 4 deletions

View File

@ -360,6 +360,17 @@ void ForwardLabel (unsigned Offs)
void ForwardLabels (unsigned Size)
/* Define forward labels for the range PC to PC+Size-1 if necessary */
{
unsigned I;
for (I = 0; I < Size; ++I) {
ForwardLabel (I);
}
}
static void DefOutOfRangeLabel (unsigned long Addr)
/* Define one label that is outside code range. */
{

View File

@ -94,6 +94,9 @@ void ForwardLabel (unsigned Offs);
* bytes and is therefore output as "label = * + x".
*/
void ForwardLabels (unsigned Size);
/* Define forward labels for the range PC to PC+Size-1 if necessary */
void DefOutOfRangeLabels (void);
/* Output any labels that are out of the loaded code range */

View File

@ -408,10 +408,8 @@ static void OneOpcode (unsigned RemainingBytes)
*/
if (D->Size <= RemainingBytes) {
/* Output labels within the next insn */
unsigned I;
for (I = 1; I < D->Size; ++I) {
ForwardLabel (I);
}
ForwardLabels (D->Size);
/* Output the insn */
D->Handler (D);
PC += D->Size;
break;