Skip to content

Macro11 v0.9#31

Open
Rhialto wants to merge 50 commits intoopen-simh:masterfrom
Rhialto:macro11-v0.9
Open

Macro11 v0.9#31
Rhialto wants to merge 50 commits intoopen-simh:masterfrom
Rhialto:macro11-v0.9

Conversation

@Rhialto
Copy link
Copy Markdown
Contributor

@Rhialto Rhialto commented Apr 15, 2026

I was reminded by an old comment to make an update request for macro-11. Here it is.

pkoning2 and others added 30 commits August 9, 2022 10:22
When adding a symbol, check if a "permanent" symbol (read: a label) is
being redefined and issue an appropriate diagnostic.
This makes sure that the symbols named in .narg .nchr and .ntype are
checked appropriately (not just those in .packed).
Avoid the term "illegal".
In case of syntax errors, more often indicate what was expected, instead
of just complaining it was invalid.
This is unusual and discouraged by the documentation, but it is valid
and occasionally encountered in the wild.
In the documentation, the convention seems to be that a label is a
symbol marking the start of an assembly line, followed by a colon.
The .END directive now ends assembly so remove it from the concatenated
file.
Temporarily remove the test that causes an infinite loop (test-prec).
In many calls, __VA_ARGS__ is empty, and this causes errors.
There is a gcc-specific extension (use , ##__VA_ARGS__) but apparently
not all other compilers support this.
From inspection, all changes look innocuous.
and add the options "-ylls -e ME" to the assembler invocation,
since they show information that's useful for regression testing.
Found by gcc.
cc -std=gnu99 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow -ggdb  -O3  -c -o stream2.o stream2.c
stream2.c: In function 'inject_source':
stream2.c:511:21: warning: 'strcpy' accessing 1 byte at offsets [0, 4294967295] and [0, 4294967295] overlaps 1 byte at offset [0, 4294967295] [-Wrestrict]
  511 |                     strcpy(&line[i], &line[i+1]);
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Rhialto and others added 20 commits April 30, 2023 13:24
listing.c:209:13: warning: conflicting types for built-in function 'trunc'; expected 'double(double)' [-Wbuiltin-declaration-mismatch]
  209 | static void trunc(
      |             ^~~~~
listing.c:20:1: note: 'trunc' is declared in header '<math.h>'
   19 | #include "util.h"
  +++ |+#include <math.h>
   20 |

listing.c: In function 'list_process':
listing.c:412:12: warning: suggest explicit braces to avoid ambiguous 'else' [-Wdangling-else]
  412 |         if (symbol_list_locals)
      |            ^

listing.c: In function 'show_error_line':
listing.c:461:24: warning: field width specifier '*' expects argument of type 'int', but argument 3 has type 'long unsigned int' [-Wformat=]
  461 |     fprintf(stderr, "%-*s%.132s\n", offsetof(LSTFORMAT, words), binline, listline);
      |                      ~~^~
      |                        |
      |                        int
Assume the indentation expresses correctly how the statements are meant to be
guarded by the ifs.

cc -std=gnu99 -Wall -Wshadow -Wextra -pedantic -Woverflow -Wstrict-overflow -ggd
b  -O3  -c -o assemble.o assemble.c
assemble.c: In function 'assemble':
assemble.c:963:29: warning: this 'if' clause does not guard... [-Wmisleading-ind
entation]

  963 |                             if (op->value == P_PRINT)
      |                             ^~
assemble.c:966:33: note: ...this statement, but the latter is misleadingly inden
ted as if it were guarded by the 'if'
  966 |                                 if (show_print_lines) {
      |                                 ^~

This last one I'm guessing the `if (show_print_lines)` is meant to be guarded
by the `if (op->value == P_PRINT)` because of the comment.
Also, stop assembling for both object file formats, since at the moment
psects have different default flags.
and add .end to some tests to clean them up.
While writing the documentation I found two buglets:
        - .LIBRARYs should only be opened once (and not on both passes).
        - .LIBRARYs (and -m) should be searched in reverse order (see J.3.6
V5.0 Update Changes).

I've also added two new command-line qualifiers:
        -apb and -ff get closer to the original listing format.
        They can also be used with -xl ...
                '-m maclib.mlb -l maclst.lst -apb [ -ff ] -xl'
        will also put page-breaks between macros.
…v0.9

Update to latest released version of macro-11.

Command run: git subtree pull --prefix=crossassemblers/macro11 ../macro11 macro11-v0.9
(should be equivalent to git subtree pull --prefix=crossassemblers/macro11 git://gitlab.com/Rhialto/macro11.git macro11-v0.9)
@LegalizeAdulthood
Copy link
Copy Markdown

LegalizeAdulthood commented Apr 15, 2026

In my fork (develop branch), I've got a CMake build for the entire tree that does configure, build, test, and package for macOS, linux and Windows. It runs the macro11 tests as CTest test cases and they pass on all platforms.

I haven't yet submitted this to open-simh/simtools as a PR yet, I'm working through smaller PRs first.

However, when I saw that macro11 was hosted on gitlab, I was thinking that we should be pulling in macro11 as a git submodule using the gitlab URL so that we don't have to manually copy things over. To get a new version of macro11 we would just update the submodule to the new version.

I had planned on doing this in my tree and submitting it as PR, but since this got bubbled up to the top, I'd like to hear other people's thoughts on this.

@Rhialto
Copy link
Copy Markdown
Contributor Author

Rhialto commented Apr 17, 2026

Yes, a submodule also makes sense here. The two repos are sufficiently separate.
(If the super- and submodule are essentially maintained together, a submodule gets annoying, but that's not the case here).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants