编写一个在4K范围内调用宏,在跨页调用后导致标号地址出错问题 宏如下: MCALL MACRO NUM IF (NUM>>11)==($>>11) CALL NUM ELSE CALL $+2 JMP $+2 JMP NUM ENDIF ENDM 如果改为: MCALL MACRO NUM IF (NUM>>11)==($>>11) nop CALL NUM nop ELSE CALL $+2 JMP $+2 JMP NUM ENDIF ENDM 就没问题。
有朋友说由于不对称引起的,但下面的宏也没问题。 MSET MACRO NUM ;对位NUM,置1 ;数据,位,如400H=40H的0位 IF ((NUM>>11)&07H)==0 IF (NUM&0FH)==0 ORIM (NUM>>4),0001B ELSE IF (NUM&0FH)==1 ORIM (NUM>>4),0010B ELSE IF (NUM&0FH)==2 ORIM (NUM>>4),0100B ELSE IF (NUM&0FH)==3 ORIM (NUM>>4),1000B ENDIF ENDIF ENDIF ENDIF ELSE IF (NUM&00FH)==0 LDI ACC,0001B ORM (NUM>>4&7FH),((NUM>>11)&07H) ELSE IF (NUM&00FH)==1 LDI ACC,0010B ORM (NUM>>4&7FH),((NUM>>11)&07H) ELSE IF (NUM&00FH)==2 LDI ACC,0100B ORM (NUM>>4&7FH),((NUM>>11)&07H) ELSE IF (NUM&00FH)==3 LDI ACC,1000B ORM (NUM>>4&7FH),((NUM>>11)&07H) ENDIF ENDIF ENDIF ENDIF ENDIF ENDM 请高手帮忙解决 |