I have found the source of my problem, and can get around it, but I don't
quite understand why it's happening.
The start of all this trouble is an ASM source file which was created by
running ROM images through a disassembler. The example below was something I
created in order to track this down, so it only vaguely resembles my real
code. The disassembled source would re-assemble just fine using DXP, but
when I started adding new RAM variables, all hell broke loose. The original
source had a bunch of .EQU statements to locate the address of all the
variables and define all the constants. As I've always understood it, EQU is
merely a replacement of one thing with another. The Altium docs state:
symbol .EQU expression
With the .EQU directive you assign permanently the value of expression to
symbol.
Keeping that in mind, I was getting all sorts of E240 errors if I moved the
.section statement in line 19 below up to the area of lines 7 and 8.
(Highlighted in RED)
When I move line 19 to line 7, several errors occur. The error type is E240,
and says "Incompatible expression type." The error lines are 46-48
(Highlighted in GREEN)
So it doesn't like me using EQU names indirectly, but it doesn't mind if I
use them directly, shown in line 44 (Highlighted in ORANGE)
The list file below shows how everything is working properly and not the
errors mentioned above.
ADDR CODE CYCLES LINE SOURCE LINE
1
;...........................................................................
....
0000 2 .section ports, sfr, at(0000H)
3
0000 RESERVED 4 PORT0OUT .dsb 1
0000
5
6
7
8
9
10 MYRAM .EQU 9000h
11
12 oldvar1 .EQU 9000h
13 oldvar2 .EQU 9001h
14 oldvar3 .EQU MYRAM+3
15
16
17
18
;...........................................................................
....
A000 19 .section myram, data, at(0A000H)
20
A000 RESERVED 21 var1 .dsb 1
A000
A001 RESERVED 22 var2 .dsb 1
A001
23
24
25 const1 .EQU 0x0A
26 const2 .EQU 0x0B
27
28
29
;...........................................................................
....
0000 30 .section text1, code, at(0000H)
31
0000 C30001 3 3 32 JP MainProc
33
;...........................................................................
....
0100 34 .section text2, code, at (0100H)
35
36
;...........................................................................
....
0100 37 MainProc:
38
0100 310002 2 2 39 LD SP,0x200
0103 3E7F 2 4 40 LD A, 0x7F
0105 3200A0 4 8 41 LD (var1), A
0108 D300 3 11 42 OUT (PORT0OUT),A
43
010A 210090 2 13 44 ld hl, oldvar1
010D 7E 2 15 45 ld a,(hl)
010E 320190 4 19 46 ld (oldvar2),a
0111 320090 4 23 47 ld (MYRAM),a
0114 320390 4 27 48 ld (oldvar3),a
0117 3E0B 2 29 49 ld a,const2
50
0119 C30001 3 32 51 JP MainProc
52
53
011C 54 END
55
Section summary:
ABS (00000000) 1 ports
ABS (0000a000) 2 myram
ABS (00000000) 3 3 text1
ABS (00000100) 1c 32 text2
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* To post a message: mailto:[EMAIL PROTECTED]
*
* To leave this list visit:
* http://www.techservinc.com/protelusers/leave.html
*
* Contact the list manager:
* mailto:[EMAIL PROTECTED]
*
* Forum Guidelines Rules:
* http://www.techservinc.com/protelusers/forumrules.html
*
* Browse or Search previous postings:
* http://www.mail-archive.com/[EMAIL PROTECTED]
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * *