Jump to content
IGNORED

Synassembler monitor crash


Recommended Posts

I'm working on a program that reads paddle A and displays the value as a decimal number. It's a little buggy. Sometimes it displays a ":" instead of a digit. So I'm trying to figure it out with Synassembler's built in monitor (Zynapse monitor). When tracing or stepping through, it locks up the system - black screen, unresponsive - at line 280 (it's a DEX). I'm using Altirra and I've tried a couple different OS ROMs, switching PAL/NTSC, different RAM configuration, different Synassembler executables, and different versions of Altirra. Is Synapse's monitor just buggy and can't do it? What's going on?

Paddle to decimal.atr

Link to comment
Share on other sites

First, this is the problem in your program:

00460          LSR  ;NYBBLE
00470          ADC #$10 ; CONVERT TO ATASCII

You have a stray carry from bit 3 into the ADC operation here. Either insert a CLC before the ADC or use ORA #$10 instead.

 

As for why the Synassembler monitor crashes, it has a bug with leaving the decimal flag on when emulating branches:

  27008:231:  3 | A=04 X=00 Y=00 (    ZC) | B854: B1 D8             LDA ($D8),Y  ;$401D
  27008:231:  8 | A=D0 X=00 Y=00 (N    C) | B856: 99 B2 00          STA $00B2,Y  ;$00B2
  27008:231: 13 | A=D0 X=00 Y=00 (N    C) | B859: 88                DEY
  27008:231: 15 | A=D0 X=00 Y=FF (N    C) | B85A: 10 F8             BPL $B854
- 27008:231: 17 | A=D0 X=00 Y=FF (N    C) | B85C: 20 B3 BA          JSR $BAB3
    27008:231: 23 | A=D0 X=00 Y=FF (N    C) | BAB3: A5 BE             LDA $BE
    27008:231: 27 | A=38 X=00 Y=FF (     C) | BAB5: 48                PHA
    27008:231: 31 | A=38 X=00 Y=FF (     C) | BAB6: A5 BB             LDA $BB
    27008:231: 35 | A=00 X=00 Y=FF (    ZC) | BAB8: A6 BC             LDX $BC
    27008:231: 39 | A=00 X=07 Y=FF (     C) | BABA: A4 BD             LDY $BD
    27008:231: 43 | A=00 X=07 Y=00 (    ZC) | BABC: 28                PLP
    27008:231: 48 | A=00 X=07 Y=00 (  D   ) | BABD: 58                CLI
    27008:231: 51 | A=00 X=07 Y=00 (  D   ) | BABE: 60                RTS
  27008:231: 59 | A=00 X=07 Y=00 (  D   ) | B85F: 4C B2 00          JMP $00B2
  27008:231: 62 | A=00 X=07 Y=00 (  D   ) | 00B2: D0 04             BNE $00B8
  27008:231: 65 | A=00 X=07 Y=00 (  D   ) | 00B8: 4C F0 B8          JMP $B8F0
  27008:231: 68 | A=00 X=07 Y=00 (  D   ) | B8F0: 18                CLC
  27008:231: 70 | A=00 X=07 Y=00 (  D   ) | B8F1: A0 01             LDY #$01
  27008:231: 72 | A=00 X=07 Y=01 (  D   ) | B8F3: B1 D8             LDA ($D8),Y  ;$401E

The monitor then tries to print text to the Screen Editor (E:) device, which dies horribly with decimal mode on because its address calculations are all wrong.

 

  • Like 2
Link to comment
Share on other sites

First, this is the problem in your program:

 

00460          LSR  ;NYBBLE
00470          ADC #$10 ; CONVERT TO ATASCII

You have a stray carry from bit 3 into the ADC operation here. Either insert a CLC before the ADC or use ORA #$10 instead.

 

 

Hey, it works. Thanks!

 

Would I be better off using another monitor? One of the OS replacements like Omnimon?

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...