Path: csiph.com!aioe.org!.POSTED!not-for-mail From: "Rod Pemberton" Newsgroups: alt.os.development Subject: Re: What form of executable or load module for your OS? Date: Mon, 06 Jul 2015 06:21:08 -0400 Organization: Aioe.org NNTP Server Lines: 38 Message-ID: References: <5bb535cc-0995-4fdd-ae16-a1217c4b8e92@googlegroups.com> <75acded2-9f64-4d9f-81c2-7ec73fd72e01@googlegroups.com> <1687b850-3c16-44ec-9bd9-4eb0dc2a201b@googlegroups.com> <853c70d5-5652-42e9-ac0f-e4b832b56ca3@googlegroups.com> NNTP-Posting-Host: n4wpt9zq8xR26Ttf9mo2BA.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/12.16 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Xref: aioe.org alt.os.development:8308 On Sun, 05 Jul 2015 18:15:50 -0400, Alexei A. Frounze wrote: > For MOVZX. PUSHF/POPF not needed. > > MOVSX is worse: > > PUSH AX ; if dst != AX > MOV AL, src > CBW > MOV dst, AX ; if dst != AX > POP AX ; if dst != AX > It's too bad there is no PUSH reg8 ... > There are two types of comparisons in Smaller C: > 1. comparisons whose result is used for if/while/for: > if (a < b) ... > while (a < b) ... > do ... while (a < b); > for (...; a < b; ...) ... > 2. all other comparisons: > c = a < b; > CMP+Jcc are used in the former. > CMP+SETcc are used in the latter. If those are the only comparisons, what are you using MOVSX for? Signed-arithmetic? If so, delay using CBW until an arithmetic operation is performed when AX is free. Then, no need for MOVSX. Rod Pemberton -- Tolerance and socialism attracts intolerance and terrorism. See: France, United Kingdom, Germany, Denmark, Belgium, Netherlands, ... UK: Strong encryption, non-issue. GR: Eurozone currency, priority.