Jay Cotton - 2018-01-17

A resent bug was logged that seems a bit dicey to me.

The asm file has near the end.

 396 FFFE             BUFFER: DW      00H             ;FILLS THE EPROM OUT WITH 00'S
        0000

*** Warning 17 in "dbl.asm": address wrapped at maxval
397 0000 DS 84H
398
399 ;---------------------------------------------------------------
400 ; AND FINALLY THE STACK, WHICH GROWS DOWNWARD
401 ;---------------------------------------------------------------
402 0085 STSP: DS 08H ;SPACE FOR STACK
403 00 8D STACK: EQU $
404
405 END

This seems inocent enough, but the dw is at 0xfffe and the ds forces an address wrap around (or error condition).

The test code was created some time ago. It may be that the use of an org command was not
available.

My interum solution was to break the assembler to let it wrap the address. This seems to work o.k. in the test case, but may be broken in the larger world.

I checked the assembly with an org statment, that fixed the assembly (correctly).

396 FFFE BUFFER: DW 00H ;FILLS THE EPROM OUT WITH 00'S
0000
397 00 00 org 0
398 0000 DS 84H
399
400 ;---------------------------------------------------------------
401 ; AND FINALLY THE STACK, WHICH GROWS DOWNWARD
402 ;---------------------------------------------------------------
403 0084 STSP: DS 08H ;SPACE FOR STACK
404 00 8C STACK: EQU $
405
406 END

I'm thinking about adding a run time switch the enable the broken version as needed, and insisting that users put an org statment in the code for these odd cases.