Skip to content

sna2skool.py produces invalid Skool file for two-character operands #142

@morozov

Description

@morozov
➜ sna2skool.py --version
SkoolKit 9.6

There is an issue with sna2skool.py with regard to processing character values.

I'm disassembling code from a *.sna file. The assembly equivalent of this code is:

LD HL,$3030

The meaning of this code is loading two zero characters into to H and L, so I'm annotating it as follows in the control file:

@ $5D78 isub=LD HL,"00"

sna2skool.py renders it as follows (incorrectly):

@isub=LD HL,"00"
 $5D78 LD HL,"0"

Then, in my build pipeline, skool2bin.py produces incorrect bytes instead of failing:

-21 30 30
+21 30 00

As a result, my seemingly valid @isub annotation makes Skoolkit quetly produce an invalid binary.

For reference Pasmo also allows one-character calue for a 2-byte operand, so this is probably correct:

➜ echo 'LD HL,"0"' | pasmo - - | xxd
00000000: 2130 00                                  !0.

I expect that the Skool file will look something like:

 $5D78 LD HL,"00"

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions