Recently I have started making code on 6502-based systems, and I have used the ca65 macro assembler. However I found out that it supports procedures using .proc . So I have been wondering what is the difference between these blocks of code:
mainLabel:
jsr subroutine
subroutine:
;Code
rts
and this code:
mainLabel:
jsr procedure
.proc procedure
;Code
rts
.endproc
When I try running my programs using these 2 syntaxes I seem to get the same result. From what I can tell from the ca65 documentation, procedures prevent code from outside it from entering labels within it.