Jump to content
IGNORED

dasm hang on repeat macro?


rbairos

Recommended Posts

I've tried 3 versions of dasm (one I just compiled from scratch to be sure), and it keeps hanging/crashing when I try to compile the following: (any or no compile options)

    processor 6502
    org $F000
Start
        repeat 2
    STA $02
        repend
    LDA #0
;    STA $02
    jmp Start


    org $FFFC
    .word Start
    .word Start

Whether it not it compiles successfully is completely finicky.
Deleting an extra blank line will fix the problem etc.
Anyone else suffer from this?

Edited by rbairos
Link to comment
Share on other sites

Worked OK on my Mac using DASM 2.20.11.

------- FILE test.asm LEVEL 1 PASS 1
      1  0000       processor 6502
      2  f000       org $F000
      3  f000    Start
      4  f000       repeat 2
      5  f000        85 02       STA $02
      4  f000       repend
      5  f002        85 02       STA $02
      6  f004       repend
      7  f004        a9 00       LDA #0
      8  f006 ;    STA $02
      9  f006        4c 00 f0        jmp Start
     10  f009
     11  f009
     12  fffc       org $FFFC
     13  fffc        00 f0       .word.w Start
     14  fffe        00 f0       .word.w Start
Link to comment
Share on other sites

Thanks guys.

I edit in unix style by default.
That was driving me nuts!

Here's an even simpler example that produces several repeated warning unless I switch do CR/LF , if anyone's interested in a small example:

    processor 6502
    org $F000


        repeat 10
    STA $02
        repend
Link to comment
Share on other sites

I changed the fopen() call used to open the assembly source file (and includes) to use binary mode ("rb") instead of text mode. ("r")

 

For non-POSIX systems, text mode will translate newlines. Unfortunately the functions responsible for reporting/moving the current position within the file (ftell and fseek) don't have a correct definitive behavior when translating newlines. (ie. serious cross-platform bug territory)

 

The dasm REPEAT/REPEND functionality uses ftell and fseek to bounce around in the assembly code, which made me think of the above being the cause of the bug.

 

I don't believe there will be ill effects from opening in binary mode. Just in case, I'll leave the above zip up for a week or so, before moving it into the official 7800 assembly dev kit.

  • Like 3
Link to comment
Share on other sites

  • 1 year later...
On 12/6/2017 at 9:41 PM, RevEng said:

The problem doesn't reproduce on Linux either, but I gave a theory a shot - does the version inside the attached zip avoid the bug?

7800AsmDevKit.0.6-20171206.zip 1.29 MB · 29 downloads

 

Is this the most up to date version of DASM around?  If so I'll use it for the DPC+, BUS, and CDFJ examples I'll be posting in the Harmony/Melody Club.

 

Thanks!

Link to comment
Share on other sites

Best to grab a fresh copy from here.

 

Since DASM is used by other communities, I suspect there's might be other minorly tweaked releases elsewhere. Mine would be the latest AA-homegrown version, except it's missing your string define patch. I meant to add that, but life got in the way. I'll add it when I get a good chance to test it out, as I need to ensure it doesn't break anything with bB and 7800basic.

  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...