?login_element?

Subversion Repositories NedoOS

Rev

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

  1.         STRUCT SPOS,4
  2. X       WORD
  3. Y       BYTE
  4.         ALIGN 2
  5.         BLOCK   3, '_'
  6.         ALIGN 4, '!'
  7. AD      WORD
  8.         ENDS
  9.  
  10.     ASSERT SPOS.X == 4 && SPOS.Y == 6 && SPOS.AD == 12 && SPOS == 14
  11.  
  12.         STRUCT ST2
  13. ONEB    DB      'a'
  14. P1      SPOS    { 'bc', 'd', 'ef' }     ; will emit warning about misalignment (4 vs 3)
  15.         ENDS
  16.  
  17.     ASSERT ST2.ONEB == 0 && ST2.P1 == 1 && ST2.P1.X == 5 && ST2.P1.Y == 7 && ST2.P1.AD == 13 && ST2 == 15
  18.  
  19.         DEVICE  ZXSPECTRUM48
  20.         ; "old data" in memory (structs will be defined over, to check preservation)
  21.         ORG     0x8000
  22.         db      "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  23.         db      "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  24.  
  25.         ;; TEST data from structs
  26.         ORG     0x8000
  27.  
  28. POS1    SPOS    '12', '3', '4:'
  29.         ; 4Bx old_value (to reach offset 4), X:0x1234, Y:0x56, 1Bx old_value, AD:0x789A
  30.  
  31. POS2    ST2     "\n", {,,"\ne"}
  32.         ; '\n' (ONEB), then 4x old value (offset), 'cbd' (X,Y), 1x old (align)
  33.         ; '___!' (block+align), 'e\n' (AD) => final result: "\nPQRScbdW___!e\n"
  34.  
  35.         SAVEBIN "align.bin", POS1, SPOS + ST2
  36.  
  37. ; more misalignment warnings tests
  38.  
  39.         ORG     0x8000
  40. NoWarning   SPOS    {1, 2, 3}
  41.         ORG     0x8001
  42. Warn3B  SPOS    {1, 2, 3}
  43.         ORG     0x8002
  44. Warn2B  SPOS    {1, 2, 3}
  45.         ORG     0x8003
  46. Warn1B  SPOS    {1, 2, 3}
  47.         ORG     0x8004
  48. NoWarning2  SPOS    {1, 2, 3}
  49.