<br><br><div class="gmail_quote">On Thu, Oct 7, 2010 at 9:55 AM, Andreas Raab <span dir="ltr">&lt;<a href="mailto:andreas.raab@gmx.de">andreas.raab@gmx.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
You *really* need to learn how to use the simulator </blockquote><div><br>Is it working? I&#39;ve been told it is not working at all and that it should take me time to fix it.<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
(and read the code in the VM). </blockquote><div><br>I am reading the code in the VM as much as possible. <br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Asking people here to debug your code is an extremely slow way to do it.<br>
<br>
That said, replacing popStack with stackValue is NOT EQUIVALENT. Thus your transformation of popStack -&gt; stackValue is entirely incorrect. Where you previously had:<br>
<br>
1) popStack<br>
2) popStack<br>
3) test and...<br>
        3a) return result<br>
        3b) unpop 2<br>
<br>
with stackValue you need to use<br>
<br>
1) stackValue: 0.<br>
2) stackValue: 1.<br>
3) test and ...<br>
        3a) pop 2 and return result<br>
        3b) =do nothing=<br>
<br>
I.e., stackValue does NOT POP but rather indexes into the stack.<br></blockquote><div><br><br>Ok, I understand that. But before doing that, I just replced    <br><br><br>integerArgument := self popPos32BitInteger.<br>integerReceiver := self popPos32BitInteger.<br>
<br>by<br><br>arg := self popStack.<br>integerArgument := self positive32BitValueOf: arg.<br>rcvr := self popStack.<br>integerReceiver := self positive32BitValueOf: rcvr.<br><br>So....I JUST copy the code of #popPos32BitInteger and put it there.....I didn&#39;t change anything else, and I have the same problem.<br>
<br>At the end:<br><br>primitiveBitOr<br>
     | integerReceiver integerArgument arg rcvr |<br>
     arg := self popStack.<br>
     integerArgument := self positive32BitValueOf: arg.<br>
     rcvr := self popStack.<br>
     integerReceiver := self positive32BitValueOf: rcvr.<br>
<br>
     successFlag<br>
         ifTrue: [<br>
             self push: (self positive32BitIntegerFor:<br>
                     (integerReceiver bitOr: integerArgument))]<br>
         ifFalse: [self unPop: 2]<br>
<br><br>is has CPU100 and <br><br>primitiveBitOr<br>    | integerReceiver integerArgument |<br>    integerArgument := self popPos32BitInteger.<br>    integerReceiver := self popPos32BitInteger.<br>    successFlag<br>        ifTrue: [self push: (self positive32BitIntegerFor:<br>
                    (integerReceiver bitOr: integerArgument))]<br>        ifFalse: [self unPop: 2]<br><br>works perfect.<br><br>And I am not using stackValue.<br><br>Anyway, thanks for the explanation about both differences.<br>
<br>Cheers<br><br>Mariano<br>
<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
Cheers,<br><font color="#888888">
  - Andreas</font><div><div></div><div class="h5"><br>
<br>
On 10/7/2010 12:39 AM, Mariano Martinez Peck wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
<br>
<br>
<br>
Hi, I want to change #primitiveBitOr or #primitiveBitAnd and in both<br>
cases, I compile the VM, I run an image, and the image cannot even start<br>
and CPU 100%  :(<br>
I have a loop somewhere.<br>
<br>
This is the current implementation of #primitiveBitOr for example:<br>
<br>
primitiveBitOr<br>
     | integerReceiver integerArgument |<br>
     integerArgument := self popPos32BitInteger.<br>
     integerReceiver := self popPos32BitInteger.<br>
     successFlag<br>
         ifTrue: [self push: (self positive32BitIntegerFor:<br>
                     (integerReceiver bitOr: integerArgument))]<br>
         ifFalse: [self unPop: 2]<br>
<br>
<br>
I NEED to have the receiver oop and the argument oop. So, I&#39;ve change it to:<br>
<br>
primitiveBitOr<br>
     | integerReceiver integerArgument arg rcvr |<br>
     arg := self popStack.<br>
     integerArgument := self positive32BitValueOf: arg.<br>
     rcvr := self popStack.<br>
     integerReceiver := self positive32BitValueOf: rcvr.<br>
<br>
     successFlag<br>
         ifTrue: [<br>
             self push: (self positive32BitIntegerFor:<br>
                     (integerReceiver bitOr: integerArgument))]<br>
         ifFalse: [self unPop: 2]<br>
<br>
<br>
And then to:<br>
<br>
primitiveBitOr<br>
     | integerReceiver integerArgument arg rcvr |<br>
     arg := self stackValue: 0.<br>
     integerArgument := self positive32BitValueOf: arg.<br>
     rcvr := self stackValue: 1.<br>
     integerReceiver := self positive32BitValueOf: rcvr.<br>
<br>
     successFlag<br>
         ifTrue: [<br>
             self push: (self positive32BitIntegerFor:<br>
                     (integerReceiver bitOr: integerArgument))]<br>
         ifFalse: [self unPop: 2]<br>
<br>
But in both cases, while trying to start an image, I have cpu 100%<br>
Of course, the same happens if I do this in #primitiveBitAnd<br>
<br>
Any ideas what can be happening? because I tried to understand but<br>
nothing :(<br>
<br>
Thanks in advance<br>
<br>
Mariano<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
</blockquote>
</div></div></blockquote></div><br>