?login_element?

Subversion Repositories NedoOS

Rev

Blame | Last modification | View Log | Download

  1.     DEVICE ZXSPECTRUM128
  2.     MMU 0 3, 4
  3.     ORG     0x4000-2
  4. orgL1:
  5. .local:
  6.     ASSERT  4 == $$.local
  7.     DISP    0xC000-1
  8. dispL1:
  9.     ASSERT  4 == $$orgL1 && 4 == $$     ; label and page in 0000-3FFF is 4
  10.     ASSERT  6 == $$dispL1               ; dispL1 page is taken from current mapping
  11.     ; also the CSpect export of displaced labels is sort of "bogus", affected by this
  12.     set     5,(ix+0x41)     ; 4B opcode across both ORG and DISP boundaries
  13.     ENT
  14. orgL1end:
  15.     ASSERT  5 == $$orgL1end && 5 == $$  ; label and page in 4000-7FFF is 5
  16.  
  17.     ; exercise the label parsing/evaluation, line parsin
  18.     ASSERT  4 == $$orgL1.local && 4 == $$@orgL1.local && 1
  19.     ASSERT  -1 == $$MissingLabel && 1
  20.     ASSERT  $$ == $$..invalidLabelName  ; parsing breaks completely, evaluating only first part
  21.  
  22.     ;; exercise macro nesting and reaching out for labels
  23. TM  MACRO   expPageOuter?, expPage1?, expPage2?, recursion?
  24.         ASSERT  expPageOuter? == $$.outer
  25.         ASSERT  expPageOuter? == $$MacroNestingAndReaching.outer
  26.         ASSERT  expPageOuter? == $$@MacroNestingAndReaching.outer
  27.         IF recursion?
  28.             ASSERT  expPage1? == $$.inner
  29.             TM expPageOuter?, expPage1?, expPage2?, 0
  30.         ELSE
  31.             ASSERT  expPage2? == $$.inner
  32.         ENDIF
  33. .inner:
  34.         nop
  35.     ENDM
  36.  
  37.     ORG $7FFF
  38. MacroNestingAndReaching:
  39.     ; MacroNestingAndReaching.outer = $8001, 0>inner = $8000, 1.0>inner = $7FFF
  40.     TM      6, 6, 5, 1
  41. .outer:
  42.  
  43.     CSPECTMAP "get_label_page_operator.sym"
  44.