alberthdev / spasm-ng

SPASM-ng is a z80 assembler with extra features to support development for TI calculators.
GNU General Public License v2.0
97 stars 23 forks source link

Name field, incorrect behavior #53

Open Zeda opened 6 years ago

Zeda commented 6 years ago

It seems that when trying to compile an app with a minimal (but valid) header, it can trip up the exporter. As an example, my minimal header has a name field of: .db $80,$46, "Batlib This is a valid field-- just the first byte and upper nibble define this field ($80,$4x). However, I get exporter: error SE504: Name field missing. When I change it to $48 and pad the name with two bytes, it compiles just fine.

On a previous build, I forgot to include app signing functionality so I had to manually use rabbitsign in conjunction with spasm and consequently, I did not have this problem. Thanks!

alberthdev commented 6 years ago

Somewhat curious... does the original spasm exhibit this sort of behavior? It looks like export.cpp line 267 seems to imply that they really want 8 characters...

That said... according to the magical wiki, the 0x48 that export.cpp looks for can in fact be a 0x43 or some variant of 0x4N (assuming N>0). So because this is a strict assumption for 8 bytes, it will fail.

Did some tweaking to the source, try this branch out and see if it helps! https://github.com/alberthdev/spasm-ng/tree/feature/app-name-var-size

Zeda commented 6 years ago

Yes, it works! Thanks a bunch!

alberthdev commented 4 years ago

Finally merged, thanks to @tari for the reminder! Sometime later this week if I can remember to do so, I'll make a new spasm-ng release to pick this change up. Leaving this open until said release is made.

Zeda commented 4 years ago

Awesome, thanks! I personally appreciate this :)