<div dir="ltr">Hallo,<div><br></div><div>I stumbled onto something I do not understand, but perhaps there is a compiler specialist.</div><div><br></div><div>Here it is:</div><div><div>MODULE Test1;</div><div>VAR t : INTEGER;</div><div>BEGIN</div><div>   t := 9;</div><div>END Test1.</div></div><div><br></div><div><br></div><div><div>code</div><div>   0     4EE90004       SUB SP SP      4</div><div>   1     AFE00000       STR  LNK SP       0</div><div>   2     40000009       MOV  R0  R0      9</div><div>   3     8D000003       LDR SB  R0       3</div><div>   4     A0D00000       STR   R0 SB       0</div><div>   5     8FE00000       LDR LNK SP       0</div><div>   6     4EE80004       ADD SP SP      4</div><div>   7     C700000F       B LNK</div></div><div><br></div><div><br></div><div>So I assign '9' to 'local' global variable 't'.</div><div><br></div><div>In line 2 constant 9 is moved into R0</div><div>in line 3 SB is loaded with the data from [R0 + 3]</div><div>in line 4 R0 is stored in [SB + 3]</div><div><br></div><div>So R0 is overwritten, unless this is patched by the module loader.</div><div><br></div><div>But the book says that line 3 was designed to read:</div><div><br></div><div>LDR SB R12  3      ;(section 12.7.9 -- 2nd last paragraph)</div><div><br></div><div><br></div><div>Does anyone know what is up here?</div><div><br></div><div>Thanks,</div><div><br></div><div>j.</div><div><br></div><div><br></div><div> </div></div>