Quantcast
Channel: Ubuntu 18.04.3 LTS get terminal columns and rows NASM - Code Review Stack Exchange
Viewing all articles
Browse latest Browse all 5

Answer by Fifoernik for Ubuntu 18.04.3 LTS get terminal columns and rows NASM

$
0
0

A code-size optimization

If you move the mov edi, Metrics instruction to just below the FindMatch label and thus have it repeat with each iteration, you can remove 4 instructions from the code. I've marked these with an exclamation mark:

      xor     edx, edx      mov     ecx, edx  FindMatch:      mov     edi, Metrics      ;Restore it from here      lodsq        !     push    rdi      add     edi, ecx      add     cl, 2!     jmp     .cmpstr + 1     ; No need to save RDI again  .cmpstr:!     push    rdi      push    rsi      ...  .nextone:      pop     rsi!     pop     rdi             ; Restore pointer to array of pointers.      jmp     FindMatch

cmp     bl, 'L'jz      .cmpstrcmp     bl, 'C'

Are these environment strings guaranteed to be in uppercase?


Viewing all articles
Browse latest Browse all 5

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>