Rev 129 | Blame | Compare with Previous | Last modification | View Log | Download
# file opened: align.asm1 0000 STRUCT SPOS,42 0000 ~ X WORD3 0000 ~ Y BYTE4 0000 ~ ALIGN 25 0000 ~ BLOCK 3, '_'6 0000 ~ ALIGN 4, '!'7 0000 ~ AD WORD8 0000 ENDS9 000010 0000 ASSERT SPOS.X == 4 && SPOS.Y == 6 && SPOS.AD == 12 && SPOS == 1411 000012 0000 STRUCT ST213 0000 ~ ONEB DB 'a'align.asm(14): warning: Struct SPOS did use ALIGN 4 in definition, but here it is misaligned by 3 bytes14 0000 ~ P1 SPOS { 'bc', 'd', 'ef' } ; will emit warning about misalignment (4 vs 3)15 0000 ENDS16 000017 0000 ASSERT ST2.ONEB == 0 && ST2.P1 == 1 && ST2.P1.X == 5 && ST2.P1.Y == 7 && ST2.P1.AD == 13 && ST2 == 1518 000019 0000 DEVICE ZXSPECTRUM4820 0000 ; "old data" in memory (structs will be defined over, to check preservation)21 0000 ORG 0x800022 8000 41 42 43 44 db "ABCDEFGHIJKLMNOPQRSTUVWXYZ"22 8004 45 46 47 4822 8008 49 4A 4B 4C22 800C 4D 4E 4F 5022 8010 51 52 53 5422 8014 55 56 57 5822 8018 59 5A23 801A 41 42 43 44 db "ABCDEFGHIJKLMNOPQRSTUVWXYZ"23 801E 45 46 47 4823 8022 49 4A 4B 4C23 8026 4D 4E 4F 5023 802A 51 52 53 5423 802E 55 56 57 5823 8032 59 5A24 803425 8034 ;; TEST data from structs26 8034 ORG 0x800027 800028 8000 41 42 43 44 POS1 SPOS '12', '3', '4:'28 8004 32 31 33 4828 8008 5F 5F 5F 2128 800C 3A 3429 800E ; 4Bx old_value (to reach offset 4), X:0x1234, Y:0x56, 1Bx old_value, AD:0x789A30 800E31 800E 0A 50 51 52 POS2 ST2 "\n", {,,"\ne"}31 8012 53 63 62 6431 8016 57 5F 5F 5F31 801A 21 65 0A32 801D ; '\n' (ONEB), then 4x old value (offset), 'cbd' (X,Y), 1x old (align)33 801D ; '___!' (block+align), 'e\n' (AD) => final result: "\nPQRScbdW___!e\n"34 801D35 801D SAVEBIN "align.bin", POS1, SPOS + ST236 801D37 801D ; more misalignment warnings tests38 801D39 801D ORG 0x800040 8000 41 42 43 44 NoWarning SPOS {1, 2, 3}40 8004 01 00 02 4840 8008 5F 5F 5F 2140 800C 03 0041 800E ORG 0x8001align.asm(42): warning: Struct SPOS did use ALIGN 4 in definition, but here it is misaligned by 3 bytes42 8001 42 43 44 01 Warn3B SPOS {1, 2, 3}42 8005 01 00 02 5F42 8009 5F 5F 5F 2142 800D 03 0043 800F ORG 0x8002align.asm(44): warning: Struct SPOS did use ALIGN 4 in definition, but here it is misaligned by 2 bytes44 8002 43 44 01 01 Warn2B SPOS {1, 2, 3}44 8006 01 00 02 5F44 800A 5F 5F 5F 2144 800E 03 0045 8010 ORG 0x8003align.asm(46): warning: Struct SPOS did use ALIGN 4 in definition, but here it is misaligned by 1 bytes46 8003 44 01 01 01 Warn1B SPOS {1, 2, 3}46 8007 01 00 02 5F46 800B 5F 5F 5F 2146 800F 03 0047 8011 ORG 0x800448 8004 01 01 01 01 NoWarning2 SPOS {1, 2, 3}48 8008 01 00 02 5F48 800C 5F 5F 5F 2148 8010 03 0049 8012# file closed: align.asmValue Label------ - -----------------------------------------------------------0x8000 X NoWarning0x800C X NoWarning.AD0x8004 X NoWarning.X0x8006 X NoWarning.Y0x8004 X NoWarning20x8010 X NoWarning2.AD0x8008 X NoWarning2.X0x800A X NoWarning2.Y0x8000 POS10x800C X POS1.AD0x8004 X POS1.X0x8006 X POS1.Y0x800E X POS20x800E X POS2.ONEB0x800F X POS2.P10x801B X POS2.P1.AD0x8013 X POS2.P1.X0x8015 X POS2.P1.Y0x000E SPOS0x000C SPOS.AD0x0004 SPOS.X0x0006 SPOS.Y0x000F ST20x0000 ST2.ONEB0x0001 ST2.P10x000D ST2.P1.AD0x0005 ST2.P1.X0x0007 ST2.P1.Y0x8003 X Warn1B0x800F X Warn1B.AD0x8007 X Warn1B.X0x8009 X Warn1B.Y0x8002 X Warn2B0x800E X Warn2B.AD0x8006 X Warn2B.X0x8008 X Warn2B.Y0x8001 X Warn3B0x800D X Warn3B.AD0x8005 X Warn3B.X0x8007 X Warn3B.Y