If you try to build an old MPASM project ( .asm ) in MPLAB X v5.x or v6.x, you will get errors. You must either port your code to XC8 assembly or revert to an obsolete MPLAB version.
Adding an assembly file is straightforward: right-click the Source Files folder and select "New > Other > Assembler > AssemblyFile.s". Note the .s extension, which is the standard for the XC8 assembler, distinguishing it from the older .asm format. Core Syntax and Directives mplab xc8 pic assembler user 39-s guide
This article gives you the roadmap, but the (the official PDF) contains: If you try to build an old MPASM project (
A typical PSECT declaration looks like this: PSECT myCode,class=CODE,delta=2 mplab xc8 pic assembler user 39-s guide