Arakula / A09

A09 6800/6801/6809/6309/68HC11 Assembler
GNU General Public License v2.0
40 stars 8 forks source link

a09 does not honor END statement with transfer address #19

Closed mickecamino closed 6 months ago

mickecamino commented 6 months ago

I am trying to build a new FLEX version with custom disk driver and console driver. The console driver has the END statement with the transfer address to FLEX cold start. This is not generated when compiling. This was driving me nuts as I was compiling in a09 on Linux and then transferred the binary files to a DSK-file and run the APPEND and LINK in FLEX. And it crashed every time. This is the command line to assemble: ./a09 io.asm -l io.lst -oTSC -oNOS -oNMU -oNUM

This is the code:

        NAM    FLEX9 TERMINAL IO DRIVERS
        OPT    PAG
*******************************************
*
* TERMINAL I/O DRIVERS
* FOR TSC FLEX 3.01
*
*******************************************
CINPUT  EQU    $F804
CINNECH EQU    $F806
CSTATUS EQU    $F808
COUTPUT EQU    $F80A
CBUG    EQU    $F802
CHPR    EQU    $C700     change process routine
COLDST  EQU    $CD00     FLEX 9 cold start

        ORG    $D3E5
INCHNE  FDB    INNECH    INPUT CHAR - NO ECHO
IHANDL  FDB    IHND      IRQ INTERRUPT HANDLER
SWIVEC  FDB    $DFC2     SWI3 VECTOR LOCATION
IRQVEC  FDB    $DFC8     IRQ VECTOR LOCATION
TMOFF   FDB    TOFF      TIMER OFF ROUTINE
TMON    FDB    TON       TIMER ON ROUTINE
TMINT   FDB    TINT      TIMER INITIALIZE ROUTINE
MONITR  FDB    CBUG      MONITOR RETURN ADDRESS
TINIT   FDB    INIT      TERMINAL INITIALIZATION
STAT    FDB    STATUS    CHECK TERMINAL STATUS
OUTCH   FDB    OUTPUT    TERMINAL CHAR OUTPUT
INCH    FDB    INPUT     TERMINAL CHAR INPUT
*

        ORG    $D370

INPUT   JMP    [CINPUT]
INNECH  JMP    [CINNECH]
STATUS  JMP    [CSTATUS]
OUTPUT  JMP    [COUTPUT]

*initialise terminal - set Escape to ASCII
INIT    RTS
*initialize timer - do later
TINT    RTS
*timer on - do later
TON     RTS
*timer off - do later
TOFF    RTS
*IRQ handler
IHND    RTI
        END    COLDST    TRANSFER ADDRESS FOR FLEX

When the binary is generated it is missing the CD00. If I run the ASMB in FLEX it adds CD00 as it should. The lst-file has the transfer address in the listing, but the binary ends with 3B as the last entry. list file:

   1                               NAM    FLEX9 TERMINAL IO DRIVERS
   2                               OPT    PAG
   3                       *******************************************
   4                       *
   5                       * TERMINAL I/O DRIVERS
   6                       * FOR TSC FLEX 3.01
   7                       *
   8                       *******************************************
   9  F804                 CINPUT  EQU    $F804
  10  F806                 CINNECH EQU    $F806
  11  F808                 CSTATUS EQU    $F808
  12  F80A                 COUTPUT EQU    $F80A
  13  F802                 CBUG    EQU    $F802
  14  C700                 CHPR    EQU    $C700     change process routine
  15  CD00                 COLDST  EQU    $CD00     FLEX 9 cold start
  16
  17                               ORG    $D3E5
  18  D3E5 D374            INCHNE  FDB    INNECH    INPUT CHAR - NO ECHO
  19  D3E7 D384            IHANDL  FDB    IHND      IRQ INTERRUPT HANDLER
  20  D3E9 DFC2            SWIVEC  FDB    $DFC2     SWI3 VECTOR LOCATION
  21  D3EB DFC8            IRQVEC  FDB    $DFC8     IRQ VECTOR LOCATION
  22  D3ED D383            TMOFF   FDB    TOFF      TIMER OFF ROUTINE
  23  D3EF D382            TMON    FDB    TON       TIMER ON ROUTINE
  24  D3F1 D381            TMINT   FDB    TINT      TIMER INITIALIZE ROUTINE
  25  D3F3 F802            MONITR  FDB    CBUG      MONITOR RETURN ADDRESS
  26  D3F5 D380            TINIT   FDB    INIT      TERMINAL INITIALIZATION
  27  D3F7 D378            STAT    FDB    STATUS    CHECK TERMINAL STATUS
  28  D3F9 D37C            OUTCH   FDB    OUTPUT    TERMINAL CHAR OUTPUT
  29  D3FB D370            INCH    FDB    INPUT     TERMINAL CHAR INPUT
  30                       *
  31
  32                               ORG    $D370
  33
  34  D370 6E9FF804        INPUT   JMP    [CINPUT]
  35  D374 6E9FF806        INNECH  JMP    [CINNECH]
  36  D378 6E9FF808        STATUS  JMP    [CSTATUS]
  37  D37C 6E9FF80A        OUTPUT  JMP    [COUTPUT]
  38
  39                       *initialise terminal
  40  D380 39              INIT    RTS
  41                       *initialize timer - do later
  42  D381 39              TINT    RTS
  43                       *timer on - do later
  44  D382 39              TON     RTS
  45                       *timer off - do later
  46  D383 39              TOFF    RTS
  47                       *IRQ handler
  48  D384 3B              IHND    RTI
  49  CD00                         END    COLDST    TRANSFER ADDRESS FOR FLEX

0 error(s), 0 warning(s)
Arakula commented 6 months ago

By default, A09 generates binary files (i.e., simple, flat files containing exactly the generated code - nothing more). What you presumably want would be a FLEX binary (which contains records including control information, such as the passed start address), so you might want to try to add the command line flag -f (with or without appended output file name).

mickecamino commented 6 months ago

That did the trick. Note to myself: Read The Manual

mickecamino commented 6 months ago

User error, closing