I remember when I was learning some other programming languages that I've since forgotten, there would be something along the lines of the "length" of a variable or some such. Like, string.length or thereabouts. Well, I was wondering if there was something I can do similar to that with a macro in ca65. An example of what I need is this...
I have a table of bytes. The table of bytes gets read through and tested every frame. At the end of the routine that tests these bytes, I have a simple INX/CPX #$xx to see if all the bytes have been read or not. The slight inconvenience I have is that everytime I add some bytes to the end of the table, I have to manually update what the 'X' register is compared to. I was wondering if there was a way to make a macro or something like that which I could plug in, in place of #$xx, that had a parameter of the name of the table. So when the assembler builds the file, it takes the "table.length" and places the proper number where the CPX #$xx is. Is something like this possible?
I have a table of bytes. The table of bytes gets read through and tested every frame. At the end of the routine that tests these bytes, I have a simple INX/CPX #$xx to see if all the bytes have been read or not. The slight inconvenience I have is that everytime I add some bytes to the end of the table, I have to manually update what the 'X' register is compared to. I was wondering if there was a way to make a macro or something like that which I could plug in, in place of #$xx, that had a parameter of the name of the table. So when the assembler builds the file, it takes the "table.length" and places the proper number where the CPX #$xx is. Is something like this possible?