# file opened: Issue168_temporary_labels_for_all.asm
 1    0000                  ORG     $1000
 2    1000                  ; regular temporary label syntax
 3    1000              1
 4    1000 C3 00 10         jp  1B
 5    1003 C3 06 10         jp  1F
 6    1006              1
 7    1006                  ; new underscore suffix syntax
 8    1006 C3 06 10         jp  1_B
 9    1009 C3 0C 10         jp  1_F
10    100C              1
11    100C                  ; old syntax in regular instructions is ignored ("1B" becomes binary value)
12    100C 21 01 00         ld  hl,1B
13    100F                  ; new underscore suffix syntax enables temporary labels also in regular instructions
14    100F 21 0C 10         ld  hl,1_B
15    1012 21 15 10         ld  hl,1_F
16    1015              1
17    1015                  ; check new underscore suffix in expressions
18    1015 21 15 10         ld  hl,((1_F+(1_B<<1))-1_F)>>1
19    1018              1
20    1018                  ; check usage across macro instances
21    1018                  MACRO node num?, ofs?
22    1018 ~                    ld hl,1_B+ofs?
23    1018 ~                    ld (hl),num?
24    1018 ~                    ld hl,1_F+ofs?
25    1018 ~            1
26    1018                  ENDM
27    1018
28    1018                  node 'A',1
28    1018 21 19 10    >        ld hl,1_B+1
28    101B 36 41       >        ld (hl),'A'
28    101D 21 21 10    >        ld hl,1_F+1
28    1020             >1
29    1020                  node 'B',2
29    1020 21 22 10    >        ld hl,1_B+2
29    1023 36 42       >        ld (hl),'B'
29    1025 21 2A 10    >        ld hl,1_F+2
29    1028             >1
30    1028
Issue168_temporary_labels_for_all.asm(31): error: Missing next digit: 1_B!AD
31    1028                  ld  hl,1_B!AD    ; this should fail ; v1.21.1 now fails as "Missing next digit" and does NOT emit any machine code
32    1028 21 01 00         hex 21 01 00     ; fake old test .lst result to minimize diff after error change in v1.21.1
33    102B              ; Issue #275 -> refactoring implementation to allow flow changes till next to last pass
34    102B                  IF 2 <= 3
35    102B              100:
36    102B                  ENDIF
37    102B C3 2B 10         jp  100_b
38    102E C3 31 10         jp  100_f
39    1031                  IF 2 <= 3
40    1031              100:
41    1031                  ENDIF
42    1031              ; check warnings about value change in last pass
43    1031                  IF 3 <= 3
44    1031 C7               rst 0
45    1032                  ENDIF
46    1032                  IF 2 <= 3
Issue168_temporary_labels_for_all.asm(47): warning: Temporary label has different address
47    1032              101:
48    1032                  ENDIF
49    1032 C3 32 10         jp  101_b
50    1035 C3 37 10         jp  101_f
51    1038                  IF 2 <= 3
Issue168_temporary_labels_for_all.asm(52): warning: Temporary label has different address
52    1038              101:
53    1038                  ENDIF
54    1038              ; check error about flow change in penultimate <-> last pass
55    1038                  IF 2 == 3
56    1038 ~                rst 0       ; neutralize address change from previous block
57    1038                  ENDIF
58    1038              102:
59    1038                  IF 3 <= 3
Issue168_temporary_labels_for_all.asm(60): error: Temporary labels flow differs in last pass (missing/new temporary label since previous pass)
60    1038              103:
61    1038                  ENDIF
62    1038 C3 38 10         jp  102_b
Issue168_temporary_labels_for_all.asm(63): error: Temporary label not found: 102_f
63    103B C3 00 00         jp  102_f
64    103E                  IF 3 <= 3
Issue168_temporary_labels_for_all.asm(65): error: Temporary labels flow differs in last pass (missing/new temporary label since previous pass)
65    103E              103:
66    103E                  ENDIF
Issue168_temporary_labels_for_all.asm(67): error: Temporary labels flow differs in last pass (missing/new temporary label since previous pass)
67    103E              102:
68    103E
# file closed: Issue168_temporary_labels_for_all.asm

Value    Label
------ - -----------------------------------------------------------
