
The code I was supposedly testing above was wrapped in #IF 0 / #ENDIF tags. No wonder the compiler never complained when the jumps were obviously out of range.

FUNCTION PBMAIN () AS LONG !jmp short target 'try a short jump to a distant target JumpFrom: '127 bytes follow !db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 !db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 !db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 !db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 !db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 !db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 !db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 !db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 '!nop 'the 128th byte. Uncomment this line and the compile will fail target: PRINT HEX$(CODEPTR(JumpFrom)),HEX$(CODEPTR(target)) PRINT "Distance of jump=";CODEPTR(Target)-CODEPTR(JumpFrom) WAITKEY$ END FUNCTION
FUNCTION PBMAIN () AS LONG !jmp short target 'try a short jump to a distant target '127 bytes follow !db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 !db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 !db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 !db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 !db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 !db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 !db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 !db 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 '!nop 'the 128th byte. Uncomment this line and the compile will fail target: END FUNCTION
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Leave a comment: