<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Eugene Hutorny &#187; e#</title>
	<atom:link href="http://hutorny.in.ua/category/projects/e/feed" rel="self" type="application/rss+xml" />
	<link>http://hutorny.in.ua</link>
	<description>Programming in a small</description>
	<lastBuildDate>Tue, 16 Mar 2010 07:25:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>Random theses</title>
		<link>http://hutorny.in.ua/projects/e/random-theses</link>
		<comments>http://hutorny.in.ua/projects/e/random-theses#comments</comments>
		<pubDate>Fri, 15 Sep 2006 22:09:28 +0000</pubDate>
		<dc:creator>Eugene</dc:creator>
				<category><![CDATA[e#]]></category>

		<guid isPermaLink="false">http://hutorny.in.ua/projects/e/random-theses</guid>
		<description><![CDATA[This post collects and organizes discussion theses posted on different forums. MCU Models Despite it is not explicitly spelled out, assemblers and C-compilers do use one or the other kind of MCU model, defined in terms of the programming language (assembly, C or preprocessor). These models are &#8216;flat&#8217; (set of constants or static variables). These [...]]]></description>
			<content:encoded><![CDATA[<p>This post collects and organizes discussion theses posted on different forums.<br />
<span id="more-73"></span></p>
<h3>MCU Models</h3>
<p>Despite it is not explicitly spelled out, assemblers and C-compilers do use one or the other kind of MCU model, defined in terms of the programming language (assembly, C or preprocessor). These models are &#8216;flat&#8217; (set of constants or static variables). These models are often incomplete and can be easily misused without any compilation error.<br />
Linkers and simulators use another way of defining the same model and doing it in other, different languages with no or very little documentation support.<br />
e# will give ability to define a formal, self-descriptive MCU model once and open it for use everywhere ??“ in compiler, application, and simulator. This indeed does not negate the need to learn the hardware. Instead e# will provide a formalized addendum to the device datasheet.<br />
Defining MCU model in the same language as the program is written will open up possibilities hardly achievable in the current tools.</p>
<h3>Cost of abstractions</h3>
<p>All proposed abstractions are abstractions of the tool language. They will be constructed and executed on the host computer. There will be no abstraction one would have to use on the device. One still will be able to program in terms of instructions, and on top of that, may define abstractions for the device in extents of available device resources. For example, one would be able to define (and implement) an interface method call using whatever calling convention is appropriate and use it as if it were a HLL language.</p>
<h3>Generic MCU</h3>
<p>Many parts in an embedded application (such as state machine, math, conversion, etc.) can be written for a &#8216;more generic MCU&#8217; and these parts can be transferred to other MCU that fit under the same &#8216;generality umbrella&#8217;. This will give developers freedom to make such choice &#8211; either writing with very limited very generic MCU and have highly portable code or writing for a given MCU and have more efficient and, of course, less portable code.</p>
]]></content:encoded>
			<wfw:commentRss>http://hutorny.in.ua/projects/e/random-theses/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>e# language vision as an &#8216;embryonic development&#8217; story</title>
		<link>http://hutorny.in.ua/projects/e/e-language-vision-as-an-embryonic-development-story</link>
		<comments>http://hutorny.in.ua/projects/e/e-language-vision-as-an-embryonic-development-story#comments</comments>
		<pubDate>Sat, 09 Sep 2006 12:41:16 +0000</pubDate>
		<dc:creator>Eugene</dc:creator>
				<category><![CDATA[e#]]></category>

		<guid isPermaLink="false">http://hutorny.in.ua/projects/e/e-language-vision-as-an-embryonic-development-story</guid>
		<description><![CDATA[In this post I present my vision of e# reflected through history of assemblers. For each stage in the assemblers&#8217; history I am providing presumptive equivalents in e#, incrementing the complexity of each next example. Statements, reused from the previous step are grayed out to focus you attention on new features. Bold indicates possible keywords [...]]]></description>
			<content:encoded><![CDATA[<p>In this post I present my vision of e# reflected through history of assemblers. For each stage in the assemblers&#8217; history I am providing presumptive equivalents in e#, incrementing the complexity of each next example.<br />
<span id="more-72"></span><br />
Statements, reused from the previous step are grayed out to focus you attention on new features. Bold indicates possible keywords of e#-tool language.</p>
<p>I hope this way of expressing will help the reader to understand my idea and an approach on its implementation.</p>
<p>&nbsp;</p>
<table border="1" cellspacing="0" cellpadding="0" width="674" style="border-collapse:collapse;">
<tr style="page-break-inside:avoid;">
<td width="271" valign="top" style="padding:0cm 5pt 0cm 5pt;">
<p><em><u>&#8216;Ancient&#8217; programming</u></em><br />
        <span style="text-align:justify;">Instruction codes are directly placed to the current location of the executable image as binary values.</span></p>
</td>
<td width="403" valign="bottom" style="padding:0cm 0pt 0cm 0pt;"><code><br />
<table border=0 width="100%" style="border-collapse:collapse;">
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>B'00 0000 0000 0000'</td>
</tr>
<tr>
<td>B'00 0000 0000 0000'</td>
</tr>
<tr>
<td>B'10 1000 0000 0000'</td>
</tr>
</table>
<p></code></td>
</tr>
<tr style="page-break-inside:avoid;">
<td width="271" valign="top" border="1" style="padding:0cm 5pt 0cm 5pt;">
<p><em><u>Mnemonic assembler</u></em><br />
        <span style="text-align:justify;">Instead of writing in binary codes, commands are replaced with their mnemonic names. Mnemonics are defined with keyword <strong>instruction</strong> and implemented as a placement of proper instructions codes</span></p>
</td>
<td width="403" valign="bottom" style="padding:0cm 0pt 0cm 0pt;"><code><br />
<table border=0 width="100%" style="border-collapse:collapse;">
<tr>
<td><strong>instruction</strong> nop {<strong> </strong>(B'00 0000 0000 0000'); };</td>
</tr>
<tr>
<td><strong>instruction</strong> goto(<strong>bit11</strong> addr)</td>
</tr>
<tr>
<td>{(B'10 1000 0000 0000' | ( addr &amp; B'111 1111 1111')); };</td>
</tr>
<tr>
<td>nop;</td>
</tr>
<tr>
<td>nop;</td>
</tr>
<tr>
<td>goto 0;</td>
</tr>
</table>
<p></code></td>
</tr>
<tr style="page-break-inside:avoid;">
<td width="271" valign="top" style="padding:0cm 5pt 0cm 5pt;">
<p><em><u>Symbolic assembler</u></em><br />
        <span style="text-align:justify;">On this stage addresses are replaced with symbolic names and instructions operate on names rather then on addresses. A new essence is introduced &ndash; <strong>label</strong>. Instruction goto renamed to go due to change in notation and it is defined for the label only, thus developer can not apply it for a data address.</span></p>
</td>
<td width="403" valign="bottom" style="padding:0cm 0pt 0cm 0pt;"><code><br />
<table border=0 width="100%" style="border-collapse:collapse;">
<tr>
<td style="background:#F3F3F3;"><strong><span style="color:gray; ">instruction</span></strong><span style="color:gray; "> nop {<strong> </strong>(B'00 0000 0000 0000'); }</span></td>
</tr>
<tr>
<td><strong>instruction</strong> label.go</td>
</tr>
<tr>
<td>{(B'10 1000 0000 0000' | (<strong>this</strong> &amp; B'111 1111 1111' )); };</td>
</tr>
<tr>
<td><strong>&nbsp;</strong></td>
</tr>
<tr>
<td>label there;</td>
</tr>
<tr>
<td>nop; nop;</td>
</tr>
<tr>
<td>there.go;</td>
</tr>
</table>
<p></code></td>
</tr>
<tr style="page-break-inside:avoid;">
<td width="271" valign="top" style="padding:0cm 5pt 0cm 5pt;">
<p><em><u>Relocatable assembler</u></em><br />
        <span style="text-align:justify;">This approach has introduced sections &ndash; logical portions of code with unspecified absolute addresses<a href="#_ftn1" name="_ftnref1" title="see footnote 1" id="_ftnref1"><sup>1</sup></a>. A new essence is introduced &ndash; section. Section is started by specifying its class (type) and optionally name. Section scope is denoted by braces. Named sections are accessible as build-time objects, some of their properties (such as size, absolute addresses) can be made available as run-time constants.</span></p>
</td>
<td width="403" valign="bottom" style="padding:0cm 0pt 0cm 0pt;"><code><br />
<table border=0 width="100%" style="border-collapse:collapse;">
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray;"><strong>instruction</strong> nop { (B'00 0000 0000 0000'); };</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray;"><strong>instruction</strong> label.go</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; ">&nbsp;{ (B'10 1000 0000 0000' | (<strong>this</strong> &amp; B'00 0111 1111 1111' )); };</span></td>
</tr>
<tr>
<td><strong>instruction</strong> file.inc</td>
</tr>
<tr>
<td>{ (B'00 1010 1000 0000' | (<strong>this</strong> &amp; B'00 0111 1111' )); };</td>
</tr>
<tr>
<td><strong>data </strong>&nbsp;mydata  { file myvar; };</td>
</tr>
<tr>
<td><strong>code </strong>{</td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; ">&nbsp;label there;</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; ">&nbsp;nop; nop;</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; ">&nbsp; there.go;</span></td>
</tr>
<tr>
<td>&nbsp; myvar.inc; };</td>
</tr>
</table>
<p></code></td>
</tr>
<tr style="page-break-inside:avoid;">
<td width="271" valign="top" style="width:203.4pt;padding:0cm 5pt 0cm 5pt;">
<p><em><u>Infix  assembler</u></em><br />
        <span style="text-align:justify;">Assemblers of this kind have drifted from operation mnemonics and fixed-column format toward to more &#8216;natural&#8217; syntax, especially for assignment and arithmetic operations. This example illustrates alternative definition of instruction <strong>inc</strong><a href="#_ftn2" name="_ftnref2" title="see footnote 2" id="_ftnref2"><sup>2</sup></a>.</span></p>
</td>
<td width="403" valign="bottom"><code><br />
<table border=0 width="100%" style="border-collapse:collapse;">
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray;"><strong>instruction</strong> nop {(B'00 0000 0000 0000'); };</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray;"><strong>instruction</strong> label.go </span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray;">{(B'10 1000 0000 0000' | (<strong>this</strong> &amp; B'00 0111 1111 1111' )); };</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray;"><strong>instruction</strong> file.inc </span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray;">{(B'00 1010 1000 0000' | (<strong>this</strong> &amp; B'00 0000 0111 1111' )); };</span></td>
</tr>
<tr>
<td><strong>instruction</strong> file '+=' (<strong>const</strong> 1) {<strong> this.</strong>inc; }</td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray;"><strong>data </strong>&nbsp;{ file myvar; };</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray;"><strong>code </strong>{</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray;"><strong>label</strong> there;</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray;">nop; nop;</span></td>
</tr>
<tr>
<td>myvar += 1;</td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray;">there.go; };</span></td>
</tr>
</table>
<p></code></td>
</tr>
<tr style="page-break-inside:avoid;">
<td width="271" valign="top" style="padding:0cm 5pt 0cm 5pt;">
<p><em><u>Meta-assembler</u></em><br /><span style="text-align:justify;">Meta-assemblers  were aimed making the language device independent by providing a separate,  replaceable device and instruction set definitions. New concepts are introduced  &ndash; device definition and application&#8217;s target device.</span></p>
</td>
<td width="403" valign="bottom"><code><br />
<table border=0 width="100%" style="border-collapse:collapse;">
<tr>
<td><strong>device </strong>PIC16F84;</td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray;"><strong>&nbsp; instruction</strong> nop {(B'00 0000 0000  0000'); };</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray;"><strong>&nbsp; instruction</strong> label.go </span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray;">&nbsp; {(B'10 1000 0000 0000' | (<strong>this</strong> &amp; B'00 0111 1111 1111' )); };</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray;"><strong>&nbsp; instruction</strong> file.inc</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray;">&nbsp; {(B'00 1010 1000 0000' | (<strong>this</strong> &amp; B'00 0000 0111 1111' )); };</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray;"><strong>&nbsp; instruction</strong> file '+=' (<strong>const</strong> 1)</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray;">&nbsp; {<strong> this</strong>.inc; }</span></td>
</tr>
<tr>
<td><strong>end device;</strong></td>
</tr>
<tr>
<td><strong>application </strong>myapp <strong>for</strong> PIC16F84;</td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray;"><strong>&nbsp; data </strong>&nbsp;{ file myvar; };</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray;"><strong>&nbsp; code </strong>{</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray;"><strong>&nbsp; &nbsp;&nbsp;label</strong> there;</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray;">nop; nop;</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray;">&nbsp;&nbsp;&nbsp;myvar <strong>+=</strong> 1; </span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray;">&nbsp;&nbsp;&nbsp;there.go;  };</span></td>
</tr>
<tr>
<td><strong>end application;</strong></td>
</tr>
</table>
<p></code></td>
</tr>
<tr style="page-break-inside:avoid;">
<td width="271" valign="top" style="padding:0cm 5pt 0cm 5pt;">
<p><em><u>Object-oriented  meta-assembler</u></em><a href="#_ftn3" name="_ftnref3" title="see footnote 3" id="_ftnref3"><sup>3</sup></a><br />
        <span style="text-align:justify;">This stage  contributes object-oriented approach to the device definition and application  programming. Each device resource is defined as an object of a class, these  classes forms a hierarchy and encapsulate implementation details.</span></p>
<p>Application defines and uses build-time  abstractions. Mapping of these abstractions to MCU resources is explicitly  provided by the developer.</p>
</td>
<td width="403" valign="bottom" style="padding:0cm 0pt 0cm 0pt;"><code><br />
<table border=0 width="100%" style="border-collapse:collapse;">
<tr>
<td><strong>device</strong> PIC16F84 <strong>extends</strong> PIC16;</td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; ">&nbsp;<strong>instruction</strong> nop {(B'00 0000 0000  0000'); };</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><strong>&nbsp; class</strong> label</td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; ">&nbsp; <strong>instruction</strong> go </span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; ">&nbsp; {(B'10 1000 0000 0000' | (<strong>this</strong> &amp; B'00 0111 1111 1111' )); };</span></td>
</tr>
<tr>
<td><strong>&nbsp; end class;</strong></td>
</tr>
<tr>
<td><strong>&nbsp; class</strong> subroutine <strong>extends</strong> label</td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; ">&nbsp;&nbsp;&nbsp;&nbsp; <strong>instruction</strong> call</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; ">&nbsp;&nbsp;&nbsp;  {(B'10 0000 0000 0000' | (<strong>this</strong> &amp; B'00 0111 1111  1111' )); };</span></p>
<tr>
<td><strong>&nbsp; end class;</strong></td>
</tr>
<tr>
<td><strong>&nbsp; class</strong> file</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp; <strong>constructor</strong> { <strong>reserve</strong>(1); }</td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><strong><span style="color:gray; ">&nbsp;&nbsp;&nbsp;  instruction</span></strong><span style="color:gray; "> inc</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; ">&nbsp;&nbsp;&nbsp;  {(B'00 1010 1000 0000' | (<strong>this</strong> &amp; B'00 0000 0111  1111' )); };</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><strong><span style="color:gray; ">&nbsp;&nbsp;&nbsp;  instruction</span></strong><span style="color:gray; "> '+=' (<strong>const</strong> 1)</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; ">&nbsp;&nbsp;&nbsp;  {<strong> this.inc</strong>; }</span></td>
</tr>
<tr>
<td><strong>&nbsp; end class;</strong><span style="color:gray; "> </span></td>
</tr>
<tr>
<td><strong>end device; </strong></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><strong><span style="color:gray; ">application </span></strong><span style="color:gray; ">myapp <strong>for</strong> PIC16F84;</span></td>
</tr>
<tr>
<td>&nbsp; <strong>class</strong> mycount <strong>extends</strong> <strong>private</strong> file</td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp; <strong>public</strong> <strong>instruction</strong> inc;</td>
</tr>
<tr>
<td><strong>&nbsp; end class;</strong><span style="color:gray; "> </span></td>
</tr>
<tr>
<td><strong>&nbsp; data </strong>&nbsp;{ mycount myvar;  };</td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><strong><span style="color:gray; ">&nbsp; code </span></strong><span style="color:gray; ">{</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><strong><span style="color:gray; ">&nbsp; &nbsp;&nbsp;label</span></strong><span style="color:gray; "> there;</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><strong><span style="color:gray; ">&nbsp; &nbsp;&nbsp;nop</span></strong><span style="color:gray; ">; <strong>nop</strong>;</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; ">&nbsp; &nbsp;&nbsp;myvar <strong>+=</strong> 1; </span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; background:#F3F3F3; ">&nbsp; &nbsp;&nbsp;there.<strong>go</strong>;  }</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><strong><span style="color:gray; ">end application;</span></strong><span style="color:gray; "> </span></td>
</tr>
</td>
</tr>
</table>
<p></code></td>
</tr>
<tr style="page-break-inside:avoid;">
<td width="271" valign="top" style="padding:0cm 5pt 0cm 5pt;">
<p><u><span style="e3">e#</span></u><br />
        <span style="text-align:justify;">Proposed  language will support capabilities of all mentioned assemblers and in  addition will provide ability to program builder behavior for all kinds of  activities: resource allocation, image verification, simulation, programming  (the device), documenting and others. This example illustrates statements for  simulation-time verification and documentation<a href="#_ftn4" name="_ftnref4" title="see footnote 4" id="_ftnref3"><sup>4</sup></a>. Device definition provides  code for validating currently selected bank (page) against the bank (page)  intended for access and raises a error if a mismatch is detected. This  technique will help to detect banking errors on early stage. Application uses  simulation-time code to validate initial state of a variable.</span></p>
</td>
<td width="403" valign="bottom" style="padding:0cm 0pt 0cm 0pt;"><code><br />
<table border=0 width="100%" style="border-collapse:collapse;">
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; "><strong>device</strong>PIC16F84<strong> extends</strong> PIC16;</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; ">&nbsp;  <strong>instruction</strong> nop {(B'00 0000 0000 0000'); };</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; ">&nbsp;  <strong>class</strong> label</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; ">&nbsp;  <strong>instruction</strong> go </span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; ">&nbsp; {(B'10 1000 0000 0000' | (<strong>this</strong> &amp; B'00 0111 1111 1111' )); }</span></td>
</tr>
<tr>
<td><strong>&nbsp;&nbsp;sim </strong>{ <strong>if</strong> !  pageCheck(<strong>this</strong>) <strong>then</strong> <strong>raise</strong> error('&quot;go&quot; paging error);  }</td>
</tr>
<tr>
<td>&nbsp; <strong>doc</strong> { 'GO is  an unconditional branch. The eleven bit immediate value is loaded into PC  bits &lt;10:0&gt;. The upper bits of PC are loaded from PCLATH&lt;4:3&gt;. GOTO  is a two cycle instruction.'};</td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; ">&nbsp;  <strong>end class;</strong></span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; ">&nbsp;  <strong>class</strong> subroutine <strong>extends</strong> label</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; ">&nbsp;&nbsp;&nbsp; <strong>instruction</strong> call</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; ">&nbsp;&nbsp;&nbsp;  {(B'10 0000 0000 0000' | (<strong>this</strong> &amp; B'00 0111 1111  1111' )); }</span></td>
</tr>
<tr>
<td><strong>&nbsp;&nbsp;sim </strong>{ <strong>if</strong> !  pageCheck(<strong>this</strong>) <strong>then</strong> </td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <strong>raise</strong> error('call paging error'); }</td>
</tr>
<tr>
<td>&nbsp; <strong>doc</strong> { 'Call  Subroutine. First, the 13-bit return address (PC+1) is pushed onto the stack&hellip;'};</td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; ">&nbsp;  <strong>end class;</strong></span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; ">&nbsp; <strong>class</strong> file</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; ">&nbsp;&nbsp;&nbsp; <strong>constructor</strong> { <strong>reserve</strong>(1); }</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; ">&nbsp;&nbsp;&nbsp;  <strong>instruction</strong> inc</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; ">&nbsp;&nbsp;&nbsp;  {(B'00 1010 1000 0000' | (<strong>this</strong> &amp; B'00 0000 0111  1111' )); };</span></td>
</tr>
<tr>
<td><strong>&nbsp; sim </strong>{ <strong>if</strong> ! bankCheck(<strong>this</strong>) <strong>then</strong> <strong>raise</strong> error('banking error'); }</td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; ">&nbsp;&nbsp;&nbsp;  <strong>instruction</strong> '+=' (<strong>const</strong> 1)</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; ">&nbsp;&nbsp;&nbsp;  {<strong> this.inc</strong>; }</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; ">&nbsp;  <strong>end class;</strong></span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; "><strong>end device</strong>;</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; "><strong>application </strong>myapp <strong>for</strong> PIC16F84;</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; ">&nbsp; <strong>class</strong> mycount <strong>extends</strong> <strong>private</strong> file</span></td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp; <strong>doc</strong> {  'mycount is a GPR with restricted access')</td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; ">&nbsp;&nbsp;&nbsp; <strong>public instruction</strong> inc;</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; "><strong>&nbsp;  end class;</strong></span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; "><strong>&nbsp;  data</strong> mydata { mycount myvar; };</span></td>
</tr>
<tr>
<td>&nbsp; <strong>if</strong> pic.banks[3].present <strong>then</strong> mydata.bank :=&nbsp; pic.banks[3];</td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; "><strong>&nbsp;  code </strong>{</span></td>
</tr>
<tr>
<td><strong>&nbsp; sim </strong>{ <strong>if</strong> myvar.value  &lt;&gt; 0 <strong>then</strong> </td>
</tr>
<tr>
<td>&nbsp;&nbsp;&nbsp; <strong>debug.print </strong>'myvar is not initialized!'; }</td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; "><strong>&nbsp;&nbsp;&nbsp;  label</strong> there;</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; ">&nbsp;&nbsp;&nbsp; nop; nop;</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; ">&nbsp;&nbsp;&nbsp;  myvar <strong>+=</strong> 1; </span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray;">&nbsp;&nbsp;&nbsp; there.go; }</span></td>
</tr>
<tr>
<td bgcolor="#F3F3F3"><span style="color:gray; "><strong>end application;</strong> </span></td>
</tr>
</table>
<p></code></td>
</tr>
</table>
<p>&nbsp;</p>
<div>
<div id="ftn1">
<p><a href="#_ftnref1" name="_ftn1" title="" id="_ftn1"><sup>1</sup></a>In the traditional approaches a linker (loader) picks a &#8216;good enough&#8217; space for each section and places codes in that space. Then it goes trough a fixup-table and adjusts instructions according to actual addresses. e# will implement a different technique &ndash; since all build steps (assembling, linking, etc) will be performed in a single run, the linker routine will operate on the same internal representation of object created by the compiler routine</p>
</p></div>
<div id="ftn2">
<p><a href="#_ftnref2" name="_ftn2" title="" id="_ftn2"><sup>2</sup></a>In this example I did not use postfix form &#8216;++&#8217; intentionally, in my opinion this kind of syntax does not improve readability.</p>
</p></div>
<div id="ftn3">
<p><a href="#_ftnref3" name="_ftn3" title="" id="_ftn3"><sup>3</sup></a>I am not aware about existence of such in the real world</p>
</p></div>
</div>
<div id="ftn4">
<p><a href="#_ftnref4" name="_ftn4" title="" id="_ftn3"><sup>4</sup></a>Documentation samples are taken from PICmicro?„? Mid-Range MCU Family Reference Manual</p>
</p></div>
]]></content:encoded>
			<wfw:commentRss>http://hutorny.in.ua/projects/e/e-language-vision-as-an-embryonic-development-story/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Benefits of using e#</title>
		<link>http://hutorny.in.ua/projects/e/benefits-of-using-e</link>
		<comments>http://hutorny.in.ua/projects/e/benefits-of-using-e#comments</comments>
		<pubDate>Sat, 02 Sep 2006 19:11:21 +0000</pubDate>
		<dc:creator>Eugene</dc:creator>
				<category><![CDATA[e#]]></category>

		<guid isPermaLink="false">http://hutorny.in.ua/projects/e/benefits-of-using-e</guid>
		<description><![CDATA[I envision the following benefits of using e# It will allow writing better quality code in shorter time It will reduce maintenance cost by providing abilities for regression testing (on a simulator or in-circuit debugger) It will reduce impact of migrating to another device/platform e# will be more restrictive to human errors and misusages. It [...]]]></description>
			<content:encoded><![CDATA[<p>I envision the following benefits of using <span class="e3">e#</span></p>
<ol start="1" type="1">
<li>It will allow writing better quality code in shorter time</li>
<li>It will reduce maintenance cost by providing abilities for regression testing (on a simulator or in-circuit debugger)</li>
<li>It will reduce impact of migrating to another device/platform</li>
</ol>
<p><span id="more-71"></span></p>
<p><span class="e3">e#</span> will be more restrictive to human errors and misusages. It will generate errors at places where a regular assembler gives no warning, such as use of literal instead of address (<code>movf myconst,F</code>) use of improper address (goto myvar), using a flag on a wrong register (bsf OPTION,GIE) and so on.</p>
<p></p>
<p><span class="e3">e#</span> will provide facilities for &#8216;in-place&#8217; validation which can be performed in scope of a simulator run or under an in-circuit debugger. For example, each call to a square root routine can be validated against square root calculated by the e# builder upon actual parameters passed to the routine. Developer will be able to program such validations in e# and apply appropriate action if an invalid condition is detected (log a message, raise an exception, etc.). Another example ??“ a delay routine can be validated against expected delay.</p>
<p></p>
<p><span class="e3">e#</span> will provide facilities for automated testing (unit, integration, etc). Once established, these tests can be used for regression testing, allowing early problem detection when a new firmware version is in work (application maintenance) or when application is being moved to another target device (migration). These facilities will provide great help for debugging code, although they will not replace a visualized interactive debugger.</p>
<p><span class="e3">e#</span> will give ability to use essential level of abstractions when designing and implementing applications and still giving developers full control on costs and penalties contributed by those abstractions. For example, developer will be able to define a &#8216;function call abstraction&#8217; and implement proper mechanism for passing parameters and returning the result. Once it is done, the function call can be used in a similar way it is used on HLL and compiler will control if it is used as designed at syntax level, while developer may program code to verify it at semantic level.</p>
<p></p>
<p><span class="e3">e#</span> will provide ability to program for an &#8216;abstract MCU&#8217;. Yes, I know, MCUs are different, but nevertheless, I believe, it is possible to define a generic MCU model with a most common set of registers and instructions, such as load a literal, move, add, subtract, branch etc. This generic MCU model will not be generating any machine instructions leaving this responsibility to a model of a real-world MCU used in the application. A library routine (such as 16-bit wide addition), written for an abstract 8-bit MCU it terms of abstract MCU instructions, will be instantiated in the application with instructions, provided by the model of actually used MCU.</p>
<p></p>
<p><span class="e3">e#</span> will provide another way of delivering device notices, cautions, silicon errata to the developer. Until explicitly suppressed each notice associated with the device will be printed to the compiler output. These notices may have complex logic for determining if the underlying issue affects the application. This will help identifying problems before they happen and will simplify the migration path.</p>
<p></p>
<p><span class="e3">e#</span> MCU model will be yet another source to learn the target device either by inspecting the model source or by exploring the device in IDE. Since the model will be defined in a programming language and accessible to IDE as a set of objects, exposing the model to IDE will be a rather routine task.</p>
<p></p>
<p><span class="e3">e#</span> will provide facilities to control object vs resource allocation, eliminating need of separate linkers with their own &#8216;kind-of-a-language&#8217;.</p>
<p></p>
<p><span class="e3">e#</span> will be better suitable for modular and/or OO design providing essential facilities for modularity, encapsulation, and objectivity.</p>
<p></p>
<p><span class="e3">e#</span> will provide ability to debug process of code generation</p>
<p></p>
<p>Besides features not yet available in other languages, <span class="e3">e#</span> will address several shortcomings of assembly and C languages.</p>
<p><a href="#table1" name="table1" title=""></a>Table 1.<span class="e3">e#</span> vs ASM and C</p>
<table border=1 cellspacing=0 cellpadding=0 style="border-collapse:collapse;border:none;">
<tr>
<th width=199 valign=top><em>Language feature</em>
  </th>
<th width=132 valign=top align=center>ASM
  </th>
<th width=132 valign=top align=center>C+ASM
  </th>
<th width=132 valign=top align=center>C
  </th>
<th width=121 valign=top align=center><span class="e3">e#</span>
 </th>
</tr>
<tr>
<td>Syntax control</td>
<td valign=top align=center>poor</td>
<td valign=top align=center>poor</td>
<td valign=top align=center>moderate</td>
<td valign=top align=center><strong>good</strong></td>
</tr>
<tr>
<td valign=top>Modularity</td>
<td valign=top align=center>poor</td>
<td valign=top align=center>moderate</td>
<td valign=top align=center>moderate</td>
<td valign=top align=center><strong>good</strong></td>
</tr>
<tr>
<td valign=top>High-level abstractions</td>
<td valign=top align=center>poor</td>
<td valign=top align=center>moderate</td>
<td valign=top align=center>moderate</td>
<td valign=top align=center><strong>good</strong></td>
</tr>
<tr>
<td valign=top>Access to the device model</td>
<td valign=top align=center>moderate</td>
<td valign=top align=center>moderate</td>
<td valign=top align=center>moderate</td>
<td valign=top align=center><strong>good</strong></td>
</tr>
<tr>
<td valign=top>Low-level coding (in instructions)</td>
<td valign=top align=center>good</td>
<td valign=top align=center>moderate</td>
<td valign=top align=center>poor</td>
<td valign=top align=center><strong>good</strong></td>
</tr>
<tr>
<td valign=top>Access to link-time variables</td>
<td valign=top align=center>moderate</td>
<td valign=top align=center>moderate</td>
<td valign=top align=center>poor</td>
<td valign=top align=center><strong>good</strong></td>
</tr>
<tr>
<td valign=top>&quot;Transparency&quot; of generated code</td>
<td valign=top align=center>good</td>
<td valign=top align=center>poor</td>
<td valign=top align=center>poor</td>
<td valign=top align=center><strong>good</strong></td>
</tr>
<tr>
<td valign=top>Portability</td>
<td valign=top align=center>poor</td>
<td valign=top align=center>poor</td>
<td valign=top align=center>good</td>
<td valign=top align=center><strong>good</strong><a href="#_ftn1" name="_ftnref1" title=""><sup>1</sup></a></td>
</tr>
</table>
<p><a href="#_ftnref1" name="_ftn1" title=""><sup>1</sup></a> e# will not solve efficiency vs. portability dilemma, however, it will shift this solution from the tool selection stage to the design and implementation stage.</p>
]]></content:encoded>
			<wfw:commentRss>http://hutorny.in.ua/projects/e/benefits-of-using-e/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>e# roadmap</title>
		<link>http://hutorny.in.ua/research/e-roadmap</link>
		<comments>http://hutorny.in.ua/research/e-roadmap#comments</comments>
		<pubDate>Wed, 30 Aug 2006 15:48:16 +0000</pubDate>
		<dc:creator>Eugene</dc:creator>
				<category><![CDATA[Research]]></category>
		<category><![CDATA[e#]]></category>

		<guid isPermaLink="false">http://hutorny.in.ua/research/e-roadmap</guid>
		<description><![CDATA[Refine vision Establish requirements Design a device metamodel Make key design decisions on the language, define a protolanguage Exercise with metamodel and protolanguage on different platforms Refine vision, requirements, metamodel, protolanguage Design the language, write BNF Pick a BNF subset covering the protolanguage and build a protocompiler Exercise with protocompiler on different platforms with different [...]]]></description>
			<content:encoded><![CDATA[<ol start="1" type="1">
<li>Refine vision</li>
<li>Establish requirements</li>
<li>Design a device metamodel</li>
<p><span id="more-70"></span></p>
<li>Make key design decisions on the language, define a protolanguage</li>
<li>Exercise with metamodel and protolanguage on different platforms</li>
<li>Refine vision, requirements, metamodel, protolanguage</li>
<li>Design the language, write BNF</li>
<li>Pick a BNF subset covering the protolanguage and build a protocompiler</li>
<li>Exercise with protocompiler on different platforms with different applications</li>
<li>Make a hierarchical tree of few architectures and devices</li>
<li>Refine vision, requirements, metamodel, protolanguage, BNF</li>
<li>Write e# language reference</li>
<li>Develop a compiler</li>
<li>Design models for few architectures and develop units for few devices</li>
<li>Ooh!</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://hutorny.in.ua/research/e-roadmap/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Concept of a new PL for embedded applications</title>
		<link>http://hutorny.in.ua/research/new-programming-language-embedded-applications</link>
		<comments>http://hutorny.in.ua/research/new-programming-language-embedded-applications#comments</comments>
		<pubDate>Mon, 28 Aug 2006 23:39:46 +0000</pubDate>
		<dc:creator>Eugene</dc:creator>
				<category><![CDATA[Research]]></category>
		<category><![CDATA[e#]]></category>

		<guid isPermaLink="false">http://hutorny.in.ua/research/new-programming-language-embedded-applications</guid>
		<description><![CDATA[Preface I would like to discuss with you my ideas on new programming language for embedded applications, denoted further as e#. I value your time and therefore in this post I am trying to be short and precise as much as possible. Table of Contents &#160; Preface 1 &#160; The core concept 2 &#160; Vision [...]]]></description>
			<content:encoded><![CDATA[<h2 class="Heading2">Preface</h2>
<p>I would like to  discuss with you my ideas on new programming language for embedded  applications, denoted further as <span class="e3">e#</span>. I  value your time and therefore in this post I am trying to be short and precise as much as possible.</p>
<p><span id="more-68"></span></p>
<h3 class="Heading3">Table of Contents</h3>
</p>
<table>
<tr>
<td width="30">&nbsp;</td>
<td>Preface</td>
<td><a href="http://hutorny.in.ua/research/new-programming-language-embedded-applications/1/">1</a></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td>The core concept</td>
<td><a href="http://hutorny.in.ua/research/new-programming-language-embedded-applications/2/">2</a></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td>Vision in examples</td>
<td><a href="http://hutorny.in.ua/research/new-programming-language-embedded-applications/3/">3</a></td>
</tr>
<tr>
<td width="30">&nbsp;</td>
<td>Concept of execution</td>
<td><a href="http://hutorny.in.ua/research/new-programming-language-embedded-applications/4/">4</a></td>
</tr>
</table>
<h3 class="Heading3">My goals are:</h3>
<ul>
<li>Share  ideas and get opinions from experienced people;</li>
<li>Stress  the idea with criticism;</li>
<li>Find  associates for developing the language;</li>
<li>Design  a language that would help other developers to follow OOD paradigm and give  them better ability for reusing once implemented objects.</li>
</ul>
<h3 class="Heading3">The new language should (is expected to):</h3>
<ul>
<li>bring  a disciplined approach to the &quot;programming in a small&quot; field;</li>
<li>suit  for most of MCU platforms and experimental processors;</li>
<li>provide  a good replacement for different ASM-associated languages ; </li>
<li>give  a tool for automated application testing on a simulator;</li>
<li>provide  better porting/multitargeting capabilities;</li>
<li>reduce  impact caused by moving to another hardware platform;</li>
<li>benefit  to all parties involved in developing embedded applications.</li>
</ul>
<h3 class="Heading3">Other languages considered</h3>
<p>JAL, NASM, TAL, HAL, ISDL, VHDL</p>
<h3 class="Heading3">Definitions</h3>
<p>Device language &ndash; its statements, being  translated, are actually executed by the device(s) <br />
  Tool language &ndash; its statements are  executed by a development tool on a host computer.<br />
  Builder &ndash; a development tool that controls all stages  of a build process, e.g. compilation, linking, etc.</p>
]]></content:encoded>
			<wfw:commentRss>http://hutorny.in.ua/research/new-programming-language-embedded-applications/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

