• DSK and SAV directives in Merlin32

    From Eric N@21:1/5 to All on Tue Jul 25 18:16:17 2023
    Do the DSK and SAV commands work in the Merlin32 cross-compiler by Brutal Deluxe? I'm porting some SC-MASM ROM patch code over to Merlin. I can compile the code as three separate source files in A2 Merlin and Merlin32 with no issues (byte-for-byte
    equivalent). However, since the code ORG's to three different areas, I thought it would be nice to merge everything into one source file and make use of the DSK directive to save three OBJ files. But I only see one file binary file created. I
    attempted this on the Mac and Windows with the same results. Putting SAV at the end of the segments yielded the same results.

    Here's is what I get for the output of the compile and look for DSK ROMP1, DSK ROMP2, and DSK ROMP3 directives.
    ------+--------------------+-------------+----+---------+------+-----------------------+----------------------------------------------------------------------
    Line | # File Line | Line Type | MX | Reloc | Size | Address Object Code | Source Code
    ------+--------------------+-------------+----+---------+------+-----------------------+----------------------------------------------------------------------
    1 | 1 ROMKRK.S 1 | Comment | 11 | | 0 | 00/8000 | * ROM HACK PART 1
    2 | 1 ROMKRK.S 2 | Comment | 11 | | 0 | 00/8000 | * WE INTERCEPT THE RESET VECTOR HERE
    3 | 1 ROMKRK.S 3 | Comment | 11 | | 0 | 00/8000 | * THIS ROUTINE BANK SWITCHES TO THE
    4 | 1 ROMKRK.S 4 | Comment | 11 | | 0 | 00/8000 | * INTCX ROM BANK AND JUMPS TO OUR
    5 | 1 ROMKRK.S 5 | Comment | 11 | | 0 | 00/8000 | * REAL ROM HACK CODE AT $C600 ROM
    6 | 1 ROMKRK.S 6 | Comment | 11 | | 0 | 00/8000 | * IF THE USER DOES NOT BREAK INTO THE
    7 | 1 ROMKRK.S 7 | Comment | 11 | | 0 | 00/8000 | * THE MONITOR, THEN THE C600 ROUTINE (PART 2)
    8 | 1 ROMKRK.S 8 | Comment | 11 | | 0 | 00/8000 | * WILL JMP BACK HERE FOR NORMAL EXIT
    9 | 1 ROMKRK.S 9 | Empty | 11 | | 0 | 00/8000 |
    10 | 1 ROMKRK.S 10 | Equivalence | 11 | | 0 | 00/8000 | ROMHAK EQU $C600 ;OUR REAL CRACK IS HERE
    11 | 1 ROMKRK.S 11 | Equivalence | 11 | | 0 | 00/8000 | INTCX EQU $C007 ;INTCX BANK TOGGLE ADDR
    12 | 1 ROMKRK.S 12 | Equivalence | 11 | | 0 | 00/8000 | SLOTCX EQU $C006 ;NORMAL SLOTCX BANK TOGGLE
    13 | 1 ROMKRK.S 13 | Equivalence | 11 | | 0 | 00/8000 | OLDVEC EQU $FA62
    14 | 1 ROMKRK.S 14 | Equivalence | 11 | | 0 | 00/8000 | A1L EQU $003C ;LSB ADDRESS
    15 | 1 ROMKRK.S 15 | Equivalence | 11 | | 0 | 00/8000 | A1H EQU $003D ;MSB ADDRESS
    16 | 1 ROMKRK.S 16 | Equivalence | 11 | | 0 | 00/8000 | A2L EQU $003E ;LSB OF ADDRESS 2
    17 | 1 ROMKRK.S 17 | Equivalence | 11 | | 0 | 00/8000 | A2H EQU $003F ;MSB OF ADDRESS 2
    18 | 1 ROMKRK.S 18 | Equivalence | 11 | | 0 | 00/8000 | A4L EQU $0042 ;LSB OF ADDRESS 4
    19 | 1 ROMKRK.S 19 | Equivalence | 11 | | 0 | 00/8000 | A4H EQU $0043 ;MSB OF ADDRESS 4
    20 | 1 ROMKRK.S 20 | Equivalence | 11 | | 0 | 00/8000 | MONMOVE EQU $FE2C ;MONITOR MOVE ROUTINE
    21 | 1 ROMKRK.S 21 | Equivalence | 11 | | 0 | 00/8000 | HME EQU $FC58 ;CLEARS TEXT SCREEN
    22 | 1 ROMKRK.S 22 | Equivalence | 11 | | 0 | 00/8000 | TXT EQU $FB2F ;SELECTS TEXT SCREEN
    23 | 1 ROMKRK.S 23 | Equivalence | 11 | | 0 | 00/8000 | MONEXIT EQU $FECD ;PART 3 AND TAPE WRITE SECTION
    24 | 1 ROMKRK.S 24 | Equivalence | 11 | | 0 | 00/8000 | KEYBD EQU $C000 ;KEYBOARD
    25 | 1 ROMKRK.S 25 | Equivalence | 11 | | 0 | 00/8000 | MONITOR EQU $FF59
    26 | 1 ROMKRK.S 26 | Directive | 11 | | 0 | 00/8000 | TYP $06
    27 | 1 ROMKRK.S 27 | Directive | 11 | | 0 | 00/8000 | DSK ROMP1
    28 | 1 ROMKRK.S 28 | Directive | 11 | | 0 | 00/8000 | ORG $FEFD
    29 | 1 ROMKRK.S 29 | Code | 11 | | 3 | 00/FEFD : 8D 07 C0 | STA {$C007} ;TOGGLE TO INTCX ROM BANK
    30 | 1 ROMKRK.S 30 | Code | 11 | | 3 | 00/FF00 : 4C 00 C6 | JMP {$C600} ;AWAY WE GO
    31 | 1 ROMKRK.S 31 | Code | 11 | | 3 | 00/FF03 : 8D 06 C0 | NORMAL STA {$C006} ;NORMAL EXIT
    32 | 1 ROMKRK.S 32 | Code | 11 | | 3 | 00/FF06 : 4C 62 FA | JMP {$FA62}
    33 | 1 ROMKRK.S 33 | Comment | 11 | | 0 | 00/FF09 | * APPLE IIE ROM PATCH FOR BREAKING INTO DEBUGGER
    34 | 1 ROMKRK.S 34 | Comment | 11 | | 0 | 00/FF09 | * PART 2: THIS ROUTINE REPLACES THE SELF-TEST
    35 | 1 ROMKRK.S 35 | Comment | 11 | | 0 | 00/FF09 | * ROM CODE AND STARTS AT $C600.
    36 | 1 ROMKRK.S 36 | Comment | 11 | | 0 | 00/FF09 | * WHEN INVOKED THE USER CAN
    37 | 1 ROMKRK.S 37 | Comment | 11 | | 0 | 00/FF09 | * PRESS EITHER ESC OR SPC.
    38 | 1 ROMKRK.S 38 | Comment | 11 | | 0 | 00/FF09 | * ESC-GO DIRECTLY TO MONITOR
    39 | 1 ROMKRK.S 39 | Comment | 11 | | 0 | 00/FF09 | * SPC-COPY MEMORY LOCATIONS $0000-$08FF
    40 | 1 ROMKRK.S 40 | Comment | 11 | | 0 | 00/FF09 | * TO $2000-$2FFF THEN JUMP TO MONITOR
    41 | 1 ROMKRK.S 41 | Comment | 11 | | 0 | 00/FF09 | * ANY OTHER KEY - PROCEED NORMALLY
    42 | 1 ROMKRK.S 42 | Comment | 11 | | 0 | 00/FF09 | * CALLED FROM $FECD WHEN RESET IS PRESSED
    43 | 1 ROMKRK.S 43 | Comment | 11 | | 0 | 00/FF09 | * THANKS TO THE COMPUTIST MAGAZINE (ISSUE #6)
    44 | 1 ROMKRK.S 44 | Comment | 11 | | 0 | 00/FF09 | * AND KRAKOWITZ TEXT FILES FOR THE INSPIRATION
    45 | 1 ROMKRK.S 45 | Directive | 11 | | 0 | 00/FF09 | DSK ROMP2
    46 | 1 ROMKRK.S 46 | Directive | 11 | | 0 | 00/FF09 | ORG $C600 ;LOCATE IN SELF-TEST SECITON OF MEM
    47 | 1 ROMKRK.S 47 | Code | 11 | | 1 | 00/C600 : 48 | START PHA ;SAVE ACCUMULATOR
    48 | 1 ROMKRK.S 48 | Code | 11 | | 3 | 00/C601 : AD 00 C0 | LOOP LDA {$C000} ;LOOK AT KEYBOARD
    49 | 1 ROMKRK.S 49 | Code | 11 | | 2 | 00/C604 : 10 FB | BPL LOOP ;KEEP READING UNTIL A KEY PRESSED
    50 | 1 ROMKRK.S 50 | Code | 11 | | 2 | 00/C606 : C9 A0 | CMP #$A0 ;WAS SPC PRESSED?
    51 | 1 ROMKRK.S 51 | Code | 11 | | 2 | 00/C608 : F0 08 | BEQ CPY ;YES, START MEM COPY
    52 | 1 ROMKRK.S 52 | Code | 11 | | 2 | 00/C60A : C9 9B | CMP #$9B ;WAS ESC PRESSED?
    53 | 1 ROMKRK.S 53 | Code | 11 | | 2 | 00/C60C : F0 3F | BEQ END ;YES, JUMP STRAIGHT TO MONITOR
    54 | 1 ROMKRK.S 54 | Code | 11 | | 1 | 00/C60E : 68 | PLA ;RESTORE ACCUMULATOR
    55 | 1 ROMKRK.S 55 | Code | 11 | | 3 | 00/C60F : 4C 03 FF | JMP NORMAL ;BACK TO PART 1 FOR PASSTHROUGH
    56 | 1 ROMKRK.S 56 | Code | 11 | | 1 | 00/C612 : 68 | CPY PLA ;RESTORE ACCUMULATOR
    57 | 1 ROMKRK.S 57 | Code | 11 | | 3 | 00/C613 : 8D 02 29 | STA $2902 ;SAVE REGISTERS
    58 | 1 ROMKRK.S 58 | Code | 11 | | 3 | 00/C616 : 8E 03 29 | STX $2903
    59 | 1 ROMKRK.S 59 | Code | 11 | | 3 | 00/C619 : 8C 04 29 | STY $2904
    60 | 1 ROMKRK.S 60 | Code | 11 | | 1 | 00/C61C : BA | TSX
    61 | 1 ROMKRK.S 61 | Code | 11 | | 3 | 00/C61D : 8E 01 29 | STX $2901
    62 | 1 ROMKRK.S 62 | Code | 11 | | 2 | 00/C620 : A0 00 | LDY #0 ;START WITH BYTE 0
    63 | 1 ROMKRK.S 63 | Code | 11 | | 3 | 00/C622 : B9 00 00 | SAVE1 LDA 0,Y ;GET A ZERO PAGE BYTE
    64 | 1 ROMKRK.S 64 | Code | 11 | | 3 | 00/C625 : 99 00 20 | STA $2000,Y ;SAVE IT
    65 | 1 ROMKRK.S 65 | Code | 11 | | 3 | 00/C628 : B9 00 01 | LDA $100,Y ;GET A STACK BYTE
    66 | 1 ROMKRK.S 66 | Code | 11 | | 3 | 00/C62B : 99 00 21 | STA $2100,Y ;SAVE IT
    67 | 1 ROMKRK.S 67 | Code | 11 | | 1 | 00/C62E : C8 | INY
    68 | 1 ROMKRK.S 68 | Code | 11 | | 2 | 00/C62F : D0 F1 | BNE SAVE1 ;IF NOT DONE, MOVE ANOTHER BYTE
    69 | 1 ROMKRK.S 69 | Code | 11 | | 2 | 00/C631 : 84 3C | STY {$003C} ;MSB FROM ADDRESS IS 0
    70 | 1 ROMKRK.S 70 | Code | 11 | | 2 | 00/C633 : 84 42 | STY {$0042} ;MSB OF THE TO ADDRESS IS 0
    71 | 1 ROMKRK.S 71 | Code | 11 | | 2 | 00/C635 : 84 3E | STY {$003E} ;MOVE CODE THROUGH $900
    72 | 1 ROMKRK.S 72 | Code | 11 | | 2 | 00/C637 : A9 09 | LDA #9
    73 | 1 ROMKRK.S 73 | Code | 11 | | 2 | 00/C639 : 85 3F | STA {$003F}
    74 | 1 ROMKRK.S 74 | Code | 11 | | 2 | 00/C63B : A9 02 | LDA #2 ;MOVE CODE STARTING AT $200
    75 | 1 ROMKRK.S 75 | Code | 11 | | 2 | 00/C63D : 85 3D | STA {$003D}
    76 | 1 ROMKRK.S 76 | Code | 11 | | 2 | 00/C63F : A9 22 | LDA #$22 ;MOVE CODE INTO PAGE 22
    77 | 1 ROMKRK.S 77 | Code | 11 | | 2 | 00/C641 : 85 43 | STA {$0043}
    78 | 1 ROMKRK.S 78 | Code | 11 | | 3 | 00/C643 : 20 2C FE | JSR {$FE2C}
    79 | 1 ROMKRK.S 79 | Code | 11 | | 3 | 00/C646 : 20 2F FB | JSR {$FB2F}
    80 | 1 ROMKRK.S 80 | Code | 11 | | 3 | 00/C649 : 20 58 FC | JSR {$FC58}
    81 | 1 ROMKRK.S 81 | Code | 11 | | 1 | 00/C64C : 48 | PHA
    82 | 1 ROMKRK.S 82 | Code | 11 | | 1 | 00/C64D : 68 | END PLA ;RESTORE ACCUMULATOR
    83 | 1 ROMKRK.S 83 | Code | 11 | | 3 | 00/C64E : 4C CD FE | JMP {$FECD} ;JUMP TO PART 3 AND EXIT TO MON
    84 | 1 ROMKRK.S 84 | Comment | 11 | | 0 | 00/C651 | * ROM HACK PART 3
    85 | 1 ROMKRK.S 85 | Comment | 11 | | 0 | 00/C651 | * WE ARE GOING TO THE MONITOR NOW
    86 | 1 ROMKRK.S 86 | Comment | 11 | | 0 | 00/C651 | * THERE IS NOT ENOUGH FREE CODE SPACE
    87 | 1 ROMKRK.S 87 | Comment | 11 | | 0 | 00/C651 | * AT $FEFD SO WE HAVE TO SPLIT OUR EXIT
    88 | 1 ROMKRK.S 88 | Comment | 11 | | 0 | 00/C651 | * VECTORS OUT OF INTCX ROM
    89 | 1 ROMKRK.S 89 | Comment | 11 | | 0 | 00/C651 | * REAL ROM HACK CODE AT $C600 ROM
    90 | 1 ROMKRK.S 90 | Directive | 11 | | 0 | 00/C651 | DSK ROMP3
    91 | 1 ROMKRK.S 91 | Directive | 11 | | 0 | 00/C651 | ORG $FECD ;TAPE WRITE LOCATION
    92 | 1 ROMKRK.S 92 | Code | 11 | | 3 | 00/FECD : 8D 06 C0 | STA {$C006} ;TOGGLE BACK TO NORMAL
    93 | 1 ROMKRK.S 93 | Code | 11 | | 3 | 00/FED0 : 4C 59 FF | JMP {$FF59}
    94 | 1 ROMKRK.S 94 | Empty | 11 | | 0 | 00/FED3 |
    95 | 1 ROMKRK.S 95 | Empty | 11 | | 0 | 00/FED3 |
    ------+--------------------+-------------+----+---------+------+-----------------------+----------------------------------------------------------------------

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From fadden@21:1/5 to Eric N on Wed Jul 26 08:06:24 2023
    On Tuesday, July 25, 2023 at 6:16:18 PM UTC-7, Eric N wrote:
    Do the DSK and SAV commands work in the Merlin32 cross-compiler by Brutal Deluxe?

    With Merlin 32 v1.1.10, I get a single output file when assembling a simple source file that has various DSK and SAV commands.

    You can file a bug report on https://github.com/apple2accumulator/merlin32/issues .

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eric N@21:1/5 to fadden on Sat Jul 29 14:31:57 2023
    On Wednesday, July 26, 2023 at 10:06:26 AM UTC-5, fadden wrote:
    You can file a bug report on https://github.com/apple2accumulator/merlin32/issues.

    I've done so and it looks to be a Merlin32 bug. Merlin8-ProDOS running natively on the Apple II generates the correct OBJ files with the same code.

    Eric N.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kent Dickey@21:1/5 to [email protected] on Mon Jul 31 18:11:20 2023
    In article <[email protected]>,
    Eric N <[email protected]> wrote:
    On Wednesday, July 26, 2023 at 10:06:26 AM UTC-5, fadden wrote:
    You can file a bug report on >https://github.com/apple2accumulator/merlin32/issues.

    I've done so and it looks to be a Merlin32 bug. Merlin8-ProDOS running >natively on the Apple II generates the correct OBJ files with the same
    code.

    Eric N.

    Any github version of Merlin32 is a fork. The original Merlin32 is only available from the Brutal Deluxe website at:

    http://www.brutaldeluxe.fr/products/crossdevtools/merlin/

    You should try that version, I find the forks to often have bugs (though
    I am not familiar with the particular fork you found).

    Kent

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eric N@21:1/5 to All on Tue Aug 1 08:59:14 2023
    http://www.brutaldeluxe.fr/products/crossdevtools/merlin/

    You should try that version, I find the forks to often have bugs (though
    I am not familiar with the particular fork you found).

    I used the Windows binary from the BrutalDeluxe site and saw the same issue.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Antoine Vignau@21:1/5 to All on Sat Aug 19 05:00:55 2023
    Hi There,
    What does Merlin 16+ generate?
    av

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eric N@21:1/5 to Antoine Vignau on Sat Aug 19 14:19:12 2023
    On Saturday, August 19, 2023 at 7:00:58 AM UTC-5, Antoine Vignau wrote:
    Hi There,
    What does Merlin 16+ generate?
    av
    I don't have Merlin 16+ (I only have an 8-bit Apple //e and //e emulator). Merlin 8 correctly generates the three binary files as directed on the native Apple // and Virtual ][.

    I'll email you the file bundle and outputs from Merlin32 separately if you feel like taking a deeper look.

    Eric N.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Antoine Vignau@21:1/5 to All on Mon Aug 21 22:45:26 2023
    Hi Eric,

    It is not a bug, but a design choice. We made the choice to link all the disk commands to a linker source code, not to a program source code.
    In all other version of Merlin, you can use DSK and SAV everywhere.

    If one wants to implement that missing feature in Merlin 32, the source code is yours.

    Antoine & Olivier

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)