?login_element?

Subversion Repositories NedoOS

Rev

Rev 129 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;; Test case for IFUSED / IFNUSED ;;
  3. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  4.  
  5. ;; Compilation:
  6. ;;      sjasmplus.exe ifused_test.asm --lstlab --lst=ifused_test.lst
  7. ;;
  8. ;; After compilation, please check the listing file "ifused_test.lst"
  9.  
  10.  
  11. ;; This must generate syntax errors
  12.  
  13.         IFUSED                      /* some white space */ ; in comments
  14.         IFNUSED                     /* some white space */ ; in comments
  15.  
  16. ;; All rest of code must be compiled without errors
  17.  
  18. start
  19.  
  20. ;; Some little user program :)
  21.  
  22. .noused call    EnableInt
  23. .used   call    Wait
  24.         jr      .used
  25.  
  26. ;; Some little direct tests
  27.  
  28.         IFUSED                      /* some white space */ ; in comments
  29.             db      'ok'
  30.         ELSE
  31.             fail
  32.         ENDIF
  33.  
  34.         IFNUSED                     /* some white space */ ; in comments
  35.             fail
  36.         ELSE
  37.             db      'ok'
  38.         ENDIF
  39.  
  40.         IFUSED  .used               /* some white space */ ; in comments
  41.             db      'ok'
  42.         ELSE
  43.             fail
  44.         ENDIF
  45.         IFUSED  start.used          /* some white space */ ; in comments
  46.             org $-2 : db      'ok'
  47.         ELSE
  48.             fail
  49.         ENDIF
  50.         IFUSED  @start.used         /* some white space */ ; in comments
  51.             org $-2 : db      'ok'
  52.         ELSE
  53.             fail
  54.         ENDIF
  55.  
  56.         IFUSED  .noused             /* some white space */ ; in comments
  57.             fail
  58.         ENDIF
  59.         IFUSED  start.noused        /* some white space */ ; in comments
  60.             fail
  61.         ENDIF
  62.         IFUSED  @start.noused       /* some white space */ ; in comments
  63.             fail
  64.         ENDIF
  65.  
  66.         IFUSED  not_defined_label   /* some white space */ ; in comments
  67.             fail
  68.         ENDIF
  69.  
  70. ;; Some little library :)
  71.  
  72. EnableInt
  73.         IFUSED  EnableInt
  74.         ei
  75.         ret
  76.         ENDIF
  77.  
  78. Wait    IFUSED
  79.         ld      b,#FF
  80. .loop
  81.         IFUSED  EnableInt
  82. .halter halt
  83.         ELSE
  84.         ld      c,#FF           ;; When the "call EnableInt" is commented out,
  85. .cycle  dec     c               ;; this branch after ELSE must be generated.
  86.         jr      nz,.cycle
  87.         ENDIF                   ;; End of IFUSED EnableInt
  88.  
  89.         djnz    .loop
  90.         ret
  91.         ENDIF                   ;; End of IFUSED Wait
  92.  
  93. ;; ADDENDUM: different code path to generate some more syntax errors
  94.         IFUSED  Invalid&Label
  95.         IFNUSED Invalid%Label
  96.         IFUSED  ..InvalidLabel
  97.         IFNUSED  ..InvalidLabel
  98.