?login_element?

Subversion Repositories NedoOS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1.         OUTPUT "Issue138_if_vs_label.bin"
  2.  
  3.         IFDEF BORDER
  4.  
  5. ; ELSE - extra test to check the comment starting at beginning of line is safe
  6.  
  7.         ; v1.18.2 didn't find nested IFNDEF inside false-block, because of label in front of it
  8.         ; causing the ELSE to be processed for IFDEF BORDER, making the blocks incorrect:
  9.  
  10.         ; the fix works only for user not using --dirbol, and still fails for temporary labels (the number-ones)
  11.         ; (just split it into two lines then, temporary/normal label on one line, IF/IFDEF/ELSE/... on next line)
  12.  
  13. @Border:        IFNDEF RED
  14.                         ld a,1 : out (254),a
  15.                 ELSE
  16.                         ld a,2 : out (254),a
  17.                 ENDIF ; RED
  18.  
  19.         ENDIF
  20.  
  21.         DB     0       ; only this zero byte should be emitted for first part
  22.  
  23.         ; do the same block, but with BORDER defined, this should produce the label "Border"
  24.         DEFINE BORDER
  25.  
  26.         IFDEF BORDER
  27.  
  28. @Border:        IFNDEF RED
  29.                         ld a,1 : out (254),a
  30.                 ELSE
  31.                         ld a,2 : out (254),a
  32.                 ENDIF ; RED
  33.  
  34.         ENDIF
  35.  
  36.         ; do the same block, but with RED defined
  37.         DEFINE RED
  38.  
  39.         IFDEF BORDER
  40.  
  41. @Border2:       IFNDEF RED
  42.                         ld a,1 : out (254),a
  43.                 ELSE
  44.                         ld a,2 : out (254),a
  45.                 ENDIF ; RED
  46.  
  47.         ENDIF
  48.  
  49.         ASSERT 1 == Border
  50.         ASSERT 5 == Border2
  51.