CompilerGuru wrote:
Obviously in this sample, the cst1 label has the value 0xa00. If you see anything else,
then there must be a bug somewhere.
Many thanks for your comments, Daniel.
You say, 'if you see anything else ..'. So far I have not actually assembled and loaded any programs into the target system, as I'm still waiting for the first prototype board.
What I'm
seeing is in the Assembler Manual: I'm seeing an example piece of code with ORG $A00 immediately followed by a DC.B directive specifying the value of a symbolic constant. This example is meant to illustrate the use of ORG to mark the start of an absolute constant section. Following the example code, I'm seeing an expalantory paragraph that says the ORG directive causes storage space to be allocated in ROM starting at 0xA00, and that the first label following the ORG represents a constant for which one byte of memory is assigned at address 0x8000. The paragraph goes on to make further nonsensical statements.
Although, as I explained, I'm primary an electronic/hardware designer, I do have many years' experience writing software, mainly of a low-level nature and mainly in assembly language (Z80, 8051, PIC Micro, Texas DSPs and others). I have done some embedded C programming and written a few DOS-type computer applications (and one Windows app). I'm therefore reasonably
au fait with programming in general, and writing assembly language programs for embedded applications in particular. I have been using ORG directives for more years than I care to mention, and I think I know enough to judge that the present query is more to do with clumsy document editing and lack of adequate proof reading than anything else.
My main reasons for starting this thread are to introduce myself, to confess to being a novice at writing software for HCS12 type processors and generally to benefit from, and in due course (hopefully) to contribute materially to, the discussion. The embedded controller which is the subject of my present project involves a fairly clear distinction between resident firmware and application software - and nor is the firmware all low-level stuff (hardware interface, bootloader etc). For example, it requires a TCP/IP stack to be implemented, with FTP, HTTP and other OSI Application Layer protocols. Since I will be concentrating on the lower levels while others handle the higher level stuff, it is essential to understand compiler/assembler issues like data types, use of registers by the compiler, calling conventions etc. I want as much as possible to avoid a low-level/high-level hiatus developing between them and me.