<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Aptos;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Aptos",sans-serif;
        mso-ligatures:standardcontextual;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#467886;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        font-size:11.0pt;
        font-family:"Aptos",sans-serif;
        mso-ligatures:standardcontextual;}
span.EmailStyle22
        {mso-style-type:personal-reply;
        font-family:"Aptos",sans-serif;
        color:#80340D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        mso-ligatures:none;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:563562675;
        mso-list-type:hybrid;
        mso-list-template-ids:1960607492 792340844 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;
        mso-fareast-font-family:Aptos;
        mso-bidi-font-family:"Times New Roman";}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l1
        {mso-list-id:921069381;
        mso-list-template-ids:485140480;}
@list l1:level1
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l1:level2
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:1.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l1:level3
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:1.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l1:level4
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:2.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l1:level5
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:2.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l1:level6
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:3.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l1:level7
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:3.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l1:level8
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:4.0in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l1:level9
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:4.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        mso-ansi-font-size:10.0pt;
        font-family:Symbol;}
@list l2
        {mso-list-id:1334914818;
        mso-list-template-ids:1557969270;}
@list l3
        {mso-list-id:1401252228;
        mso-list-type:hybrid;
        mso-list-template-ids:617894190 67698703 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l3:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l3:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l3:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l3:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l3:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l3:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l3:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l3:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;}
@list l3:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#467886" vlink="#96607D" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#80340D">Thanks for the information.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#80340D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#80340D">There are unofficial patches to both gcc and gdb to support 6809.  Neither of them support DWARF.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#80340D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#80340D">As you said, MAME could in theory just come up with a register mapping, and compiler writers (e.g., CMOC for 6809) would have to adhere to that mapping to be compatible with MAME.  And we’d definitely want to
 publish that mapping.  It would need to be published somewhere obvious and official enough that others would find it--even if MAME is not their target scenario.  For example, if gcc or gdb decided to officially support 6809 years later, MAME would be in a
 tough spot if they chose a different mapping.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#80340D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#80340D">Might it be possible for someone to publish register mappings for CPUs without ABIs somewhere on
<a href="https://dwarfstd.org/">https://dwarfstd.org/</a>?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#80340D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#80340D">Or, are there ways to write custom tags into DWARF to identify it as a "MAME-compatible", so MAME could detect when the register mapping is compatible?<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#80340D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#80340D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#80340D">Thanks again for your help!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#80340D">David<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#80340D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-family:"Calibri",sans-serif;mso-ligatures:none">From:</span></b><span style="font-family:"Calibri",sans-serif;mso-ligatures:none"> John DelSignore <JDelSignore@perforce.com>
<br>
<b>Sent:</b> Monday, May 5, 2025 4:07 AM<br>
<b>To:</b> David Broman <davbrdavbr@hotmail.com>; dwarf-discuss@lists.dwarfstd.org<br>
<b>Cc:</b> John DelSignore <JDelSignore@perforce.com><br>
<b>Subject:</b> RE: DWARF on vintage CPUs<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hi David,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">There’s no standard ABI document (that I could find). You might want to look in the GDB sources on the off chance that it supported at some point.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Ultimately, the thing that matters is how the compilers you are using numbers the registers. There is a decent description of the microprocessor here:
<a href="https://en.wikipedia.org/wiki/Motorola_6809">https://en.wikipedia.org/wiki/Motorola_6809</a>, which contains as model of the registers here:
<a href="https://en.wikipedia.org/wiki/File:6809_Internal_Registers.svg">https://en.wikipedia.org/wiki/File:6809_Internal_Registers.svg</a>. It’s up to the compilers, but the numbering of the registers might be something like: D=0, A=1, B=2, X=3, Y=5, U=6,
 S=7, PC=8, DP=9, and CC=10. So, for example, when you see register 6 in the DWARF, you’ll know it’s register U. And whatever numbering you pick, you should publish it somewhere so that others can know the register numbering you picked.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Cheers, John D.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-family:"Calibri",sans-serif;mso-ligatures:none">From:</span></b><span style="font-family:"Calibri",sans-serif;mso-ligatures:none"> Dwarf-discuss <<a href="mailto:dwarf-discuss-bounces~jdelsignore=perforce.com@lists.dwarfstd.org">dwarf-discuss-bounces~jdelsignore=perforce.com@lists.dwarfstd.org</a>>
<b>On Behalf Of </b>David Broman via Dwarf-discuss<br>
<b>Sent:</b> Sunday, May 4, 2025 10:36 PM<br>
<b>To:</b> <a href="mailto:dwarf-discuss@lists.dwarfstd.org">dwarf-discuss@lists.dwarfstd.org</a><br>
<b>Subject:</b> [Dwarf-discuss] DWARF on vintage CPUs<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hi, all, a question that may be out of scope for this list, but I’m hoping someone here might have answers anyway or be able to point me in the right direction.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I’m considering using DWARF for reading / writing debugging information for Motorola 6809 programs, but the first issue I come to is this from the DWARF 5 spec, where it references the mapping between registers and numbers:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">“Note that the register number represents a DWARF specific mapping of numbers onto the actual registers of a given architecture… It is recommended that this mapping be defined by the ABI authoring committee for each architecture”<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">In the case of the 6809 I have found no standard register mapping (likely similar situation with other vintage CPUs).<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<ol style="margin-top:0in" start="1" type="1">
<li class="MsoListParagraph" style="margin-left:0in;mso-list:l3 level1 lfo3">Maybe I just missed it… Does anyone know of an official register mapping for 6809?<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:0in;mso-list:l3 level1 lfo3">If not, do you know who I would ask about this, or how a standard register mapping could get defined for 6809?<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:0in;mso-list:l3 level1 lfo3">Can you think of other problems I might encounter later, trying to use DWARF for 6809 or other vintage CPU programs?<o:p></o:p></li></ol>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Background: The MAME project (<a href="https://www.mamedev.org/">https://www.mamedev.org/</a>) emulates many old machines, CPUs, and other hardware.  It comes with a built-in disassembly debugger for the currently emulated CPU.   I’m working
 on adding a feature to the debugger to allow for source-level debugging (useful for developing new software for emulated CPUs).  This involves modifying build tools that target emulated machines to output debugging information, and MAME to consume that debugging
 information.  Largely for assemblers, but also for C-like or BASIC compilers.  Features would include:<o:p></o:p></p>
<ul style="margin-top:0in" type="disc">
<li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo6">Source line mapping<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo6">Symbol resolution (where C-like compilers might store variables at offsets to a register, thus requiring the register mapping)<o:p></o:p></li><li class="MsoListParagraph" style="margin-left:0in;mso-list:l0 level1 lfo6">Maybe at some point in the future: stack unwinding (for compilers).<o:p></o:p></li></ul>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Thanks for your help!<o:p></o:p></p>
<p class="MsoNormal">David<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:12.0pt;mso-ligatures:none"><o:p> </o:p></span></p>
<div align="center">
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse">
<tbody>
<tr>
<td width="532" valign="top" style="width:399.35pt;border:double #FFC000 1.5pt;background:#FFFBEF;padding:0in 5.4pt 0in 5.4pt">
<p class="MsoNormal"><b><span style="color:#BF8F00">CAUTION:</span></b><span style="color:black"> This email originated from outside of the organization. Do not click on links or open attachments unless you recognize the sender and know the content is safe.</span><o:p></o:p></p>
</td>
</tr>
</tbody>
</table>
</div>
<p class="MsoNormal"><span style="font-size:12.0pt;mso-ligatures:none"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:12.0pt;mso-ligatures:none"><o:p> </o:p></span></p>
<p><i><span style="font-size:8.0pt;color:#A6A6A6">This e-mail may contain information that is privileged or confidential. If you are not the intended recipient, please delete the e-mail and any attachments and notify us immediately.</span></i><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;mso-ligatures:none"><o:p> </o:p></span></p>
</div>
</body>
</html>