User Tools

Site Tools


features

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
features [2020/02/24 17:40]
jtwine [Debugging Steps]
features [2020/02/26 16:39]
jtwine [Enhanced Semantic Checks and Warnings]
Line 31: Line 31:
 Also, address ranges are validated against the specified Pod as well. Also, address ranges are validated against the specified Pod as well.
  
-The 10LC compiler will also check for things like labels ​or programs ​that are never referenced, helping you look for bugs like cut-n-paste errors where you may have forgotten to change something.+The 10LC compiler will also check for things like Programs, Labels, Constants ​or Aliases ​that are never referenced, helping you look for bugs like cut-n-paste errors where you may have forgotten to change something. ​ Here are some example diagnostic warnings: 
 + 
 +<​code>​ 
 +ScriptFile.s(45:​1):​ Warning L0525: A global Constant named Speech1 was created but was never referenced 
 +ScriptFile.s(51:​1):​ Warning L0529: A global Alias named Unused was created but was never referenced 
 +ScriptFile.s(74:​5):​ Warning L0518: Program Main contains a defined Label UnusedLabel which was never referenced 
 +ScriptFile.s(230:​5):​ Warning L0519: Program TestSound contains a constant named None which was never referenced 
 +ScriptFile.s(231:​5):​ Warning L0519: Program TestSound contains a constant named Mute1 which was never referenced 
 +ScriptFile.s(237:​5):​ Warning L0519: Program TestSound contains a constant named Enable2 which was never referenced</​code>​
  
 You can check out the full list of [[Warnings]] and [[Errors]] that can be emitted by 10LC. You can check out the full list of [[Warnings]] and [[Errors]] that can be emitted by 10LC.
Line 137: Line 145:
 Read From 0x3200 Into Control1Bits; ​ Read From 0x3200 Into Control1Bits; ​
 Read From 0x3201 Into Control2Bits;​ Read From 0x3201 Into Control2Bits;​
 +</​code>​
 +
 +
 +==== Sequence Reading Shortcut ====
 +If you need to read a small block of contiguous memory into a set of registers, you normally have to create a block of ''​Read''​ and register copy statements. ​ 10LC has a ''​ReadEx''​ statement that provides a shortcut way of doing this.  This statement allows you to set a starting place in memory followed by a list of registers. ​ 10LC will automatically //unroll// this ''​ReadEx''​ statement into multiple ''​Read''​ and register copy statements (essentially ''​Read Into''​ statements),​ automatically incrementing the address as it goes.  Aliases and Registers can all be used for the target registers. ​ For example:
 +
 +<code c>
 +ReadEx From 0x2000 Into RegA RegB Control2Bits Reg1;
 +</​code>​
 +
 +The above code will compile into the equivalent of the following discrete ''​Read Into''​ statements:
 +
 +<code c>
 +Read From 0x2000 Into RegA;
 +Read From 0x2001 Into RegB;
 +Read From 0x2002 Into Reg2;
 +Read From 0x2003 Into Reg1;
 </​code>​ </​code>​
  
features.txt · Last modified: 2020/02/26 17:15 by jtwine