Skip to content

Commit 973c8e5

Browse files
committed
Jump in .ENDR added offset of 1 for line numbers in errors. Should fix Github issue #653.
1 parent 3fc80ca commit 973c8e5

File tree

6 files changed

+113
-3
lines changed

6 files changed

+113
-3
lines changed

Diff for: CHANGELOG

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
1... WLA GB-Z80/Z80/Z80N/6502/65C02/65CE02/65816/68000/6800/6801/6809/8008/8080/HUC6280/SPC-700/SuperFX History
44
---------------------------------------------------------------------------------------------------------------
55

6-
v10.7 (12-Mar-2025) [ALL] Prefixed by a hashtag didn't propagate though nested .MACRO
6+
v10.7 (22-Apr-2025) [ALL] Prefixed by a hashtag didn't propagate though nested .MACRO
77
calls.
88
[ALL] Listfile creation for library files should now work.
99
[ALL] If an object file contained only .SECTIONs in ROM
@@ -21,6 +21,7 @@ v10.7 (12-Mar-2025) [ALL] Prefixed by a hashtag didn't propagate though nested .
2121
[ALL] Added built-in functions is(), get(), org(), orga() and
2222
substring().
2323
[ALL] Added LATESTDIR and RELATIVEDIR to .INCLUDE and .INCBIN.
24+
[ALL] Jump in .ENDR added offset of 1 for line numbers in errors.
2425
[68k] Added alias SP for register a7.
2526
[68k] BCLR, BSET and BTST used wrong range [1, 8] / [1, 32] for
2627
bits, fixed to [0, 7] / [0, 31].

Diff for: main.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ FILE *g_file_out_ptr = NULL;
3434
__near long __stack = 200000;
3535
#endif
3636

37-
char s_version_string[] = "$VER: wla-" WLA_NAME " 10.7a (12.3.2025)";
37+
char s_version_string[] = "$VER: wla-" WLA_NAME " 10.7a (22.4.2025)";
3838
char s_wla_version[] = "10.7";
3939

4040
extern struct incbin_file_data *g_incbin_file_data_first, *g_ifd_tmp;

Diff for: phase_1.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -11020,7 +11020,7 @@ int directive_endr_continue(void) {
1102011020

1102111021
if (rr->is_while == NO) {
1102211022
g_source_index = rr->start;
11023-
g_active_file_info_last->line_current = rr->start_line;
11023+
g_active_file_info_last->line_current = rr->start_line + 1;
1102411024
g_ifdef = rr->start_ifdef;
1102511025

1102611026
/* roll past the count */

Diff for: tests/gb-z80/ai_generated_tests/linkfile

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[objects]
2+
main.o
3+
4+
[definitions]
5+
DIVME 524288
6+
HERE 4096
7+

Diff for: tests/gb-z80/ai_generated_tests/main.s

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
2+
; testing .continue
3+
4+
.MEMORYMAP
5+
DEFAULTSLOT 1
6+
SLOT 0 $0000 $2000
7+
SLOT 1 STArT $2000 sIzE $6000
8+
SLOT 2 START $8000 SIZE $2000
9+
.ENDME
10+
11+
.ROMBANKMAP
12+
BANKSTOTAL 2
13+
BANKSIZE $2000
14+
BANKS 1
15+
BANKSIZE $6000
16+
BANKS 1
17+
.ENDRO
18+
19+
.EMPTYFILL $ff
20+
21+
.BANK 0 SLOT 0
22+
.ORGA 0
23+
24+
; @BT linked.gb
25+
26+
///////////////////////////////////////////////////////////////////////////////////////////////
27+
/// AI (Gemini 2.5 Pro) GENERATED TESTS
28+
///////////////////////////////////////////////////////////////////////////////////////////////
29+
30+
.db "01>" ; @BT TEST-01 01 START
31+
.DB 10 + 2 * 6 ; @BT 16
32+
.DB (10 + 2) * 6 ; @BT 48
33+
.DB 100 / 5 + 10 ; @BT 1E
34+
.DB 100 / (5 + 10) ; @BT 06
35+
.DB 200 - 50 * 2 + 10 ; @BT 6E
36+
.DB (200 - 50) * (2 + 10) / 12 ; @BT 96
37+
.DB 255 # 10 * 3 ; @BT 0F
38+
.DB 255 # (10 * 3) ; @BT 0F
39+
.DB $F0 + 15 ; @BT FF
40+
.DB $100 / 2 - 1 ; @BT 7F
41+
.DB %11110000 & %00001111 ; @BT 00
42+
.DB %11001100 | %00110011 ; @BT FF
43+
.DB ($F0 >> 2) | $03 ; @BT 3F
44+
.DB ((10 + $A) * 4) / %10 ; @BT 28
45+
.DB (($F0 & $CC) | ($33 & $AA)) ; @BT E2
46+
.DB (1 + 2 * 3 + 4 * 5 + 6 * 7) ; @BT 45
47+
.DB (255 / (2 + 3)) * 2 ; @BT 66
48+
.DB (1000 # 256) + 1 ; @BT E9
49+
.DB (($12 + %1100) * (10 / 2)) ; @BT 96
50+
.DB ($FF - ($10 * %101)) + $01 ; @BT B0
51+
.DB ( (10*10) + (200/10) + (17#4) ) ; @BT 79
52+
.DB ( $F0 / ($0F / 3) ) + 1 ; @BT 31
53+
.DB ( %11110000 >> 2 ) & ( %00111100 << 2 ) ; @BT 30
54+
.DB (( (5+3)*10 ) / 4) # 7 ; @BT 06
55+
.DB -(10 - 20) * 5 ; @BT 32
56+
.DB 100 + (-2 * 10) ; @BT 50
57+
.DB ((-$10 + $20) * 4) & $7F ; @BT 40
58+
.DB 255 - ( ( ( $A + 10 ) * 2 ) / %100 ) ; @BT F5
59+
.DB ((($FF + 1) / 2) # 128) * 2 ; @BT 00
60+
.DB (( ($10 * 10) + %11001101 ) / 2 ) & $FE ; @BT B6
61+
.DB 2 ^ 7 ; @BT 80
62+
.DB 3 ^ 5 ; @BT F3
63+
.DB 5 ^ 3 ; @BT 7D
64+
.DB 10 ^ 2 ; @BT 64
65+
.DB ($E + 1) ^ 2 ; @BT E1
66+
.DB (2 ^ 2) ^ 3 ; @BT 40
67+
.DB 10 + 2 ^ 3 ; @BT 12
68+
.DB 200 / (1 + 3 ^ 2) ; @BT 14
69+
.DB 5 ^ ( 10 # 4 ) ; @BT 19
70+
.DB ($A0 / (2^4)) + 1 ; @BT 0B
71+
.DB (11 # 4) ^ 5 ; @BT F3
72+
.DB $F0 # (2 ^ 4 + 1) ; @BT 02
73+
.db "<01" ; @BT END
74+
75+
.db "02>" ; @BT TEST-02 02 START
76+
.db "<02" ; @BT END

Diff for: tests/gb-z80/ai_generated_tests/makefile

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
2+
CC = $(WLAVALGRIND) wla-gb
3+
CFLAGS = -i -x -o
4+
LD = $(WLAVALRGIND) wlalink
5+
LDFLAGS = -i -v -s
6+
7+
SFILES = main.s
8+
IFILES =
9+
OFILES = main.o
10+
11+
all: linked.gb check
12+
13+
linked.gb: $(OFILES) makefile
14+
$(LD) $(LDFLAGS) linkfile linked.gb
15+
16+
main.o: main.s
17+
$(CC) $(CFLAGS) main.o main.s
18+
19+
check: linked.gb
20+
byte_tester -s main.s
21+
22+
$(OFILES): $(HFILES)
23+
24+
25+
clean:
26+
rm -f $(OFILES) core *~ linked.gb linked.sym main.lst

0 commit comments

Comments
 (0)