EuroAssembler Index Manual Download Source Macros


Sitemap Links Forum Tests Projects

Test t1644: Attributes of symbol in expression


Description
Subtraction of attributes SECTION# and SEGMENT# of symbols in different sections and segments.
Tested procedures
PgmRelocResolve  
Source & expected listing t1644.htm.lst
| | EUROASM LIST=ON,DUMP=ON,DUMPWIDTH=16 | |t1644 PROGRAM FORMAT=BIN,MODEL=SMALL,WIDTH=16, \ | | LISTMAP=ON,LISTGLOBALS=ON,IMAGEBASE=3000h |[CODE] |[CODE] SEGMENT PURPOSE=CODE,ALIGN=16 |0000:909090 | DB 0x90,0x90,0x90 ; Identificator in dumped file. |0003:B8C0C0 |CSym:: MOV AX,0xC0C0 ; Definition of a code address symbol in section/segment [CODE]. |0006:90 | NOP |[DATA] |[DATA] SEGMENT PURPOSE=DATA,ALIGN=16 |0000:DDDD | DW 0xDDDD ; Identificator in dumped file. |0002:B0B0 |BSym:: DW 0xB0B0 ; Definition of a data address symbol in base section [DATA]. |[DSECT] |[DSECT] ; Definition of a subsection in segment [DATA]:0010h. |0000:AAAA | DW 0xAAAA ; Identificator in dumped file. | |;; Attributes: |0002:4900 | DW TYPE# CSym ; 'I'. |0004:5700 | DW TYPE# BSym ; 'W'. |0006:5700 | DW TYPE# DSym ; 'W'. |0008:4100 | DW TYPE# $ ; 'A'. |000A:0300 | DW SIZE# CSym ; 3. |000C:0200 | DW SIZE# BSym ; 2. |000E:0200 | DW SIZE# DSym ; 2. |0010:0000 | DW SIZE# $ ; 0. |0012:0300 | DW OFFSET# CSym ; 3. |0014:0200 | DW OFFSET# BSym ; 2. |0016:3A00 | DW OFFSET# DSym ; 0x3A. |0018:1800 | DW OFFSET# $ ; 0x18. |001A:[0000] | DW SECTION# CSym ; Relocated to 0x0000. |001C:[0000] | DW SECTION# BSym ; Relocated to 0x0000. |001E:[0000] | DW SECTION# DSym ; Relocated to 0x0010. |0020:[0000] | DW SECTION# $ ; Relocated to 0x0010. |0022:[0000] | DW SEGMENT# CSym ; Relocated to 0x0000. |0024:[0000] | DW SEGMENT# BSym ; Relocated to 0x0000. |0026:[0000] | DW SEGMENT# DSym ; Relocated to 0x0000. |0028:[0000] | DW SEGMENT# $ ; Relocated to 0x0000. |002A:[0000] | DW GROUP# CSym ; Relocated to 0x0000. |002C:[0000] | DW GROUP# BSym ; Relocated to 0x0000. |002E:[0000] | DW GROUP# DSym ; Relocated to 0x0000. |0030:[0000] | DW GROUP# $ ; Relocated to 0x0000. |0032:{0000} | DW PARA# CSym ; Relocated to 0x0300. |0034:{0000} | DW PARA# BSym ; Relocated to 0x0301. |0036:{0000} | DW PARA# DSym ; Relocated to 0x0301. |0038:{0000} | DW PARA# $ ; Relocated to 0x0301. |003A:A0A0 |DSym:: DW 0xA0A0 ; Definition of a data address symbol in section [DSECT]. |003C:00000000 | ALIGN 16 | |;; Legal calculations with scalar attributes of symbols from different segments: |0040:3700 | DW OFFSET# DSym - OFFSET# CSym ; 0x3A - 3 = 0x37. |0042:4000 | DW OFFSET# $ - OFFSET# BSym ; 0x42 - 2 = 0x40. |0044:0100 | DW SIZE# CSym - SIZE# BSym ; 3 - 2 = 1. |0046:F2FF | DW TYPE# CSym - TYPE# BSym ; 'I' - 'W' = -14. Nonsence but legal. | |;; Legal calculations with address attributes of symbols from the same sections: |0048:0000 | DW SECTION# $ - SECTION# DSym ; [DSECT] - [DSECT] = 0. |004A:0000 | DW SEGMENT# $ - SEGMENT#BSym ; [DATA] - [DATA] = 0. | |;; Differences between addresses from different sections are not supported at asm-time, E6331 expected: |004C: | DW SECTION# $ - SECTION# BSym ; [DSECT] - [DATA]. |### E6331 Subtraction of addresses from different sections in expression "SECTION# $ - SECTION# BSym". |004C: | DW SEGMENT# BSym - SECTION# DSym; [DATA] - [DSECT]. |### E6331 Subtraction of addresses from different sections in expression "SEGMENT# BSym - SECTION# DSym". |004C: | DW SECTION# CSym - SECTION# BSym; [CODE] - [DATA]. |### E6331 Subtraction of addresses from different sections in expression "SECTION# CSym - SECTION# BSym". |004C: | DW SEGMENT# CSym - SEGMENT# BSym; [CODE] - [DATA]. |### E6331 Subtraction of addresses from different sections in expression "SEGMENT# CSym - SEGMENT# BSym". |004C: | DW SECTION# $ - SECTION# BSym ; [DSECT] - [DATA]. |### E6331 Subtraction of addresses from different sections in expression "SECTION# $ - SECTION# BSym". | | ENDPROGRAM | **** ListMap "t1644.bin",model=SMALL,groups=2,segments=2,entry=,stack= | [CGROUP],FA=00000000h,VA=00003000h,size=00000007h=7,group [CODE] | [CODE],FA=00000000h,VA=00003000h,size=00000007h=7,width=16,align=0010h,purpose=CODE | [DGROUP],FA=00000010h,VA=00003010h,size=0000005Ch=92,group [DATA] | [DATA],FA=00000010h,VA=00003010h,size=0000005Ch=92,width=16,align=0010h,purpose=DATA | **** ListGlobals "t1644.bin",Global=0,Public=3,Extern=0,eXport=0,Import=0 | BSym,[DGROUP]:00000002h,VA=00003012h,scope='P' | CSym,[CGROUP]:00000003h,VA=00003003h,scope='P' | DSym,[DGROUP]:0000004Ah,VA=0000305Ah,scope='P'
Expected messages t1644.out
I0180 Assembling source file "t1644.htm". I0270 Assembling source "t1644". I0310 Assembling source pass 1. I0330 Assembling source pass 2 - final. I0470 Assembling program "t1644". "t1644.htm"{52} I0510 Assembling program pass 1. "t1644.htm"{52} E6331 Subtraction of addresses from different sections in expression "SECTION# $ - SECTION# BSym". "t1644.htm"{103} E6331 Subtraction of addresses from different sections in expression "SEGMENT# BSym - SECTION# DSym". "t1644.htm"{105} E6331 Subtraction of addresses from different sections in expression "SECTION# CSym - SECTION# BSym". "t1644.htm"{107} E6331 Subtraction of addresses from different sections in expression "SEGMENT# CSym - SEGMENT# BSym". "t1644.htm"{109} E6331 Subtraction of addresses from different sections in expression "SECTION# $ - SECTION# BSym". "t1644.htm"{111} I0510 Assembling program pass 2. "t1644.htm"{52} E6331 Subtraction of addresses from different sections in expression "SECTION# $ - SECTION# BSym". "t1644.htm"{103} E6331 Subtraction of addresses from different sections in expression "SEGMENT# BSym - SECTION# DSym". "t1644.htm"{105} E6331 Subtraction of addresses from different sections in expression "SECTION# CSym - SECTION# BSym". "t1644.htm"{107} E6331 Subtraction of addresses from different sections in expression "SEGMENT# CSym - SEGMENT# BSym". "t1644.htm"{109} E6331 Subtraction of addresses from different sections in expression "SECTION# $ - SECTION# BSym". "t1644.htm"{111} I0530 Assembling program pass 3 - final. "t1644.htm"{52} E6331 Subtraction of addresses from different sections in expression "SECTION# $ - SECTION# BSym". "t1644.htm"{103} E6331 Subtraction of addresses from different sections in expression "SEGMENT# BSym - SECTION# DSym". "t1644.htm"{105} E6331 Subtraction of addresses from different sections in expression "SECTION# CSym - SECTION# BSym". "t1644.htm"{107} E6331 Subtraction of addresses from different sections in expression "SEGMENT# CSym - SEGMENT# BSym". "t1644.htm"{109} E6331 Subtraction of addresses from different sections in expression "SECTION# $ - SECTION# BSym". "t1644.htm"{111} I0660 16bit SMALL BIN file "t1644.bin" created, size=108. "t1644.htm"{113} I0650 Program "t1644" assembled in 3 passes with errorlevel 6. "t1644.htm"{113} I0750 Source "t1644" (167 lines) assembled in 2 passes with errorlevel 6. I0860 Listing file "t1644.htm.lst" created, size=5066. I0990 EuroAssembler terminated with errorlevel 6.
Expected output file t1644. bin
0000: 90 90 90 B8 C0 C0 90 00 00 00 00 00 00 00 00 00  ¤¤¤¤¤¤¤°°°°°°°°°
0010: DD DD B0 B0 00 00 00 00 00 00 00 00 00 00 00 00  ¤¤¤¤°°°°°°°°°°°°
0020: AA AA 49 00 57 00 57 00 41 00 03 00 02 00 02 00  ¤¤I°W°W°A°·°·°·°
0030: 00 00 03 00 02 00 3A 00 18 00 00 00 00 00 10 00  °°·°·°:°·°°°°°·°
0040: 10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ·°°°°°°°°°°°°°°°
0050: 00 00 00 03 01 03 01 03 01 03 A0 A0 00 00 00 00  °°°·······¤¤°°°°
0060: 37 00 40 00 01 00 F2 FF 00 00 00 00              7°@°·°¤¤°°°°

▲Back to the top▲