?login_element?

Subversion Repositories NedoOS

Rev

Blame | Last modification | View Log | Download

  1. ;; DEVICE + DISP case
  2.     DEVICE ZXSPECTRUM1024
  3.     SLOT 2 : ORG $8000, 2 : DISP $A000, 3
  4.         ; inside DISP block displaced to fake $A000 and page 3
  5.         ; machine code landing to $8000 and page 2 (physically)
  6. dispAdr     EQU     $
  7. dispPage    EQU     $$
  8. noDispAdr   EQU     $$$     ; (!) this symbol has still "page" set to 3 (disp page)
  9. noDispPage  EQU     $$$$    ; you must use `$$$$` operator to extract non-disp page
  10.     ENT
  11.  
  12.     ASSERT $A000 == dispAdr
  13.     ASSERT 3 == $$dispAdr
  14.     ASSERT 3 == dispPage
  15.     ASSERT $8000 == noDispAdr
  16.     ASSERT 2 == noDispPage
  17.  
  18.     ; "2 == $$noDispAdr" would be more logical, but impossible to implement in simple way
  19.     ASSERT 3 == $$noDispAdr
  20.  
  21. ;; NO_DEVICE + DISP
  22.     DEVICE NONE
  23.     ORG $C000 : DISP $E000
  24.         ; inside DISP block displaced to $E000, machine code landing to $C000
  25.         ; no pages, because no virtual device is used
  26. dispAdr2    EQU     $
  27. dispPage2   EQU     $$      ; error: unexpected "$"
  28. noDispAdr2  EQU     $$$
  29. noDispPage2 EQU     $$$$
  30.     ENT
  31.  
  32.     ASSERT $E000 == dispAdr2
  33.     ASSERT $C000 == noDispAdr2
  34.     ASSERT -1 == noDispPage2
  35.  
  36. ;; NO_DEVICE + NO_DISP
  37.     ORG $4000
  38.         ; NO disp block, no DEVICE block
  39. dispAdr3    EQU     $
  40. dispPage3   EQU     $$      ; error: unexpected "$"
  41. noDispAdr3  EQU     $$$     ; error: unexpected "$$"
  42. noDispPage3 EQU     $$$$    ; error: unexpected "$$$"
  43.  
  44.     ASSERT $4000 == dispAdr3
  45.  
  46. ;; DEVICE + NO_DISP
  47.     DEVICE ZXSPECTRUM1024
  48.     SLOT 1 : ORG $6000, 4
  49.         ; inside DISP block displaced to fake $A000 and page 3
  50.         ; machine code landing to $8000 and page 2 (physically)
  51. dispAdr4    EQU     $
  52. dispPage4   EQU     $$
  53. noDispAdr4  EQU     $$$     ; error: unexpected "$"
  54. noDispPage4 EQU     $$$$    ; error: unexpected "$$"
  55.  
  56.     ASSERT $6000 == dispAdr4
  57.     ASSERT 4 == $$dispAdr4
  58.     ASSERT 4 == dispPage4
  59.  
  60. ;;;; extended test/example after explicit ",pageNum" was added to EQU mechanics
  61.  
  62. ;; DEVICE + DISP case
  63.     DEVICE ZXSPECTRUM1024
  64.     SLOT 2 : ORG $8000, 2 : DISP $A000, 3
  65. nda1        EQU     $$$,$$$$    ; this symbol has now page 2 (not disp page 3)
  66.     ENT
  67.  
  68.     ASSERT $8000 == nda1
  69.     ASSERT 2 == $$nda1
  70.  
  71. ;; NO_DEVICE + DISP
  72.     DEVICE NONE
  73.     ORG $C000 : DISP $E000
  74. nda2        EQU     $$$,$$$$    ; extended example after adding explicit ",pageNum" to EQU
  75.     ENT
  76.  
  77.     ASSERT $C000 == nda2
  78.     ASSERT $$nda2               ; error: "unexpected $nda2", $$label is disabled w/o device
  79.  
  80. ;; NO_DEVICE + NO_DISP
  81.     ORG $4000
  82. nda3        EQU     $$$,$$$$    ; error: "unexpected $$,$$$$"
  83.  
  84. ;; DEVICE + NO_DISP
  85.     DEVICE ZXSPECTRUM1024
  86.     SLOT 1 : ORG $6000, 4
  87. nda4        EQU     $$$,$$$$    ; error: "unexpected $,$$$$"
  88.