3

My 6809 assembly language program for the coco3 is causing the assembler to issue a warning with no message. How can I find out why the warning is being issued?

From the assembly listing, showing the line with the "W" warning flag:

00121   0074            tstn2a   equ   *
00122   0074 3406                pshs  a,b
00123   0076 5F                  clrb
00124   0077            tstn2a.1 equ   *
00125   0077 1F98                tfr   b,a
00126   0079 1700CE              lbsr  n2a
00127   007C 17008E              lbsr  putc
00128   007F 5C                  incb
00129   0080 C110                cmpb  #$10
00130   0082 25F3                blo   tstn2a.1
00131 W 0084 17007E              lbsr  putcr
00132   0087 3586                puls  pc,a,b
...
00000 error(s)
00001 warning(s)

Based on the LBSR offset being "007E", the warning is because I've used LBSR (long branch to subroutine) when BSR (short branch to subroutine) would do. But is there any way to get the assembler to explicitly tell me what the warning is for?

Assembler command:

asm console.a o=/d1/console l #32k >/p

Versions:

  • NitrOS9 3.3.0
  • Microware OS-9 Assembler RS Version 01.00.00

1 Answer 1

5

The Microware Assembler has no way to inform you of why it is issuing a warning. It keeps track of the total number of warnings, and also of the number of warnings on each line. If a line has any warnings, then when it is listed the assembler puts the "W" flag on that line1. At the end of the listing, the assembler prints the total number of warnings. There is no code for printing additional information about the warnings.

If there were a large number of warning reasons, or if they were tricky, then the lack of an explicit warning reason would be a problem. Fortunately, there are only a few reasons, and they aren't difficult to figure out.

  • "Register size mismatch" - The code is a little tricky to read, but I think this warning is issued when a TFR instruction is copying a 16-bit register to an 8-bit register.

  • "Could use short relative here" - A long relative branch could be coded as a short relative branch, saving a byte. This is the reason for the warning in the question.

  • "Extended addressing mode" - Extended Indirect Indexed or Extended addressing mode is used. Normal OS9 programming is done using relocatable code; extended addressing, which is not relocatable, should not be used.

Source: Examination of the assembler source code (nitros9-v3.3.0/level1/cmds/asm.asm from nitros9-v3.3.0.tar.gz)

1However, if the line has any errors, then the "E" flag appears in place of the warning flag.

1
  • Looks like the sort of issue that a larger system might post-process the listing, but not on a micro.
    – scruss
    Feb 16, 2020 at 14:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .