Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There is a lot wrong here, so I'll try and explain each section separately.</p> <p>First, the test for lowercase (testing <code>01100000b</code>) isn't going to work. It'll never be zero, for either case, since they both have the 6th bit set.</p> <p>If think the only way to make sure you're only uppercasing 'a' to 'z' is to explicitly compare for characters in that range. So your first test becomes something like this:</p> <pre><code> cmp al,'a' jl noChange cmp al,'z' jle toUpperCase noChange: mov [edi],al ... </code></pre> <p>Then the additional <code>test al,01000000b</code> you had before <code>mov [edi],al</code> does nothing, so that can be removed.</p> <p>And once you've copied the character in the branch that is already uppercase, you should be jumping to the top of the loop, otherwise you're going to fall through to the <code>toUpperCase</code> branch and store the character a second time.</p> <p>Also you should be incrementing edi, otherwise you're going to write to the same position over and over again.</p> <pre><code> mov [edi],al inc edi ; You need to add this inc esi jmp getNext ; You need to add this </code></pre> <p>Same thing goes for the <code>toUpperCase</code> branch. You need to increment edi, and again you have a test there that does nothing.</p> <pre><code>toUpperCase: AND al,11011111b mov [edi],al inc edi ; Add this inc esi jmp getNext </code></pre> <p>Finally, when exiting, you need to add a NULL to the end of the outStr. And there is no need to assign edi back to outStr, especially since it is now pointing to the end of the string.</p> <pre><code>exitProc: mov [edi],0 </code></pre> <p>Now this could be made more efficient, in that you have a lot of repeated code as well. But that is all that <em>has</em> to be done to get it working.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload