⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 objfiles.htm

📁 proteus 6.7及其破解(绝对好用)
💻 HTM
字号:
<HTML>
<HEAD>
   <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
   <META NAME="Author" CONTENT="Gaute Myklebust">
   <META NAME="GENERATOR" CONTENT="Mozilla/4.05 [en] (Win95; I) [Netscape]">
   <TITLE>Object files</TITLE>
</HEAD>
<BODY>

<H1>
File Formats</H1>

<UL>
<LI>
<A HREF="#Generic file format">Generic file format</A></LI>

<LI>
<A HREF="#Object file format">Object file format</A></LI>
</UL>

<H2>
<A NAME="Generic file format"></A>Generic file format</H2>
The Assembler can generate three different output file formats:
<UL>
<LI>
Generic</LI>

<LI>
Motorola S-Records</LI>

<LI>
Intel Intellec 8/MDS</LI>
</UL>
The formats of the latter two are assumed known. The Generic file format
is a simple, self defined format, where each line has the following format:
<BLOCKQUOTE><TT>ADR:OPCODE</TT></BLOCKQUOTE>
Where <TT>ADR</TT> is a 6 digit (24 bit) hexadecimal number and <TT>OPCODE</TT>
is a 4 digit (16 bit) hexadecimal number. <TT>ADR</TT> defines an address
in the Program memory, and <TT>OPCODE</TT> defines the contents of this
address.
<BR>&nbsp;
<H3>
Example</H3>
Given the following assembly file <TT>gen_demo.asm</TT>:
<BLOCKQUOTE><TT>; Demonstration of the Generic file format</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mov r0,r1</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; inc r1</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; call oursub</TT>
<BR><TT>.org 0x50&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
; Set Program space</TT>
<BR><TT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
; address to 50 (Hex)</TT>
<BR><TT>oursub: add r1,r2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
; Do something</TT>
<BR><TT>ret</TT></BLOCKQUOTE>
Then the following output file gen_demo.rom will be produced:
<BLOCKQUOTE><TT>000000:2c01</TT>
<BR><TT>000001:9413</TT>
<BR><TT>000002:940e</TT>
<BR><TT>000003:0050</TT>
<BR><TT>000050:0c12</TT>
<BR><TT>000051:9508</TT></BLOCKQUOTE>
Note that the two-word instructions (<TT>CALL</TT> and <TT>JMP</TT>) need
two lines of coding.
<H2>
<A NAME="Object file format"></A>Object file format</H2>
The object (<TT>.obj</TT>) file produced by the Assembler is also represented
in a self defined format. The object file contains some limited debug information,
and can be used together with AVR Studio

<P>The object file has a header section, a record section and a trailer
section. The header section has the following format:
<UL>
<LI>
Offset to source file names (4 bytes)</LI>

<LI>
Offset to object records (4 bytes)</LI>

<LI>
Number of bytes in each record (1 byte)</LI>

<LI>
Number of file names stored in the Trailer (1 byte)</LI>

<LI>
The string 揂VR Object File\0

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -