Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spurious warning SW802 and status code 3 when the last flash page is less than 1024 bytes #81

Open
bxparks opened this issue Jun 20, 2024 · 0 comments

Comments

@bxparks
Copy link

bxparks commented Jun 20, 2024

(I realize that spasm-ng may be an abandoned project, but I am filing the ticket here to preserve a historical record).

Problem:

When the size of the last flash page is < 1024, spasm-ng (at least for Linux) prints out a warning that looks like this:

$ make 
.../spasm -I /home/brian/Downloads/TICalc/Z80/dev/spasm/inc -N multipage.asm multipage.8xk
Pass one... 
Pass two... 
--------------------------------------------------
Beginning APP "multipag", courtesy of SPASM macros
--------------------------------------------------
Warning: Skipping page 1 at user request.
Page 0 free space: 16150
Warning: Skipping page 2 at user request.
Page 1 free space: 16301
Page 2 free space: 16365
Success: Page sizes validated and "multipag" is ready for signing.
           In 3 page(s), 48816 bytes are available.
exporter: warning SW802: Only 115 bytes are used on the last APP page
make: *** [Makefile:8: multipage.8xk] Error 3

Spasm may have signed the app anyway, since the resulting multipage.8xk file seems to upload and run ok. However, the spasm binary returns a non-zero status code of 3, which terminates the make command.

Workaround

I have always gotten around this problem by just writing some more code into the last flash page.

But it occurred to me while writing up this ticket that I could just insert some padding into the last flash page using the .fill directive:

    .fill 1024

Diagnosis

A bit of code digging reveals that:

I don't know the code base well enough to know where this triggers a fatal status code 3 error.

Expectation

  • I don't understand why this warning exists. During the course of development, the code can spill over just enough to the next flash page, so that the size of the next flash page is small, under 1024 bytes.
  • If this is just a warning, then the spasm binary should return a status code 0, instead of nonzero 3, so that shell scripts and make can continue processing.

Related Issue

I had initially misremembered the problem with the flash size being < 256, which is what I thought was causing Issue #80. But that seems to be a different problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant