Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

EDR-DOS kernel ported to JWasm - ident86 validated DRBIO port (Announce)

posted by Rugxulo Homepage, Usono, 24.07.2024, 00:25

> > It would be useful to change some instructions "LEA Dst,Addr" to the
> > shorter "MOV Dst,OFFSET Addr"
>
> Apparently this is done by some version of MASM, but JWasm doesn't do it.

TASM and A86 do it by default, but newer MASMs (since v5?) don't do it anymore. Some purists complain when an assembler does things "behind your back".

IIRC, the recommended fix is via a macro with opattr 8 (or such). You probably have to use "option nokeyword:<lea>" first if you insist on calling the macro LEA.

It only saves a byte per instance and probably isn't noticeably faster.

> MASM 6.11 README.TXT
> The MASM 6.1 Reference indicates that the LEA instruction is
> encoded as a MOV when the source operand is a direct memory address.
>
> In response to programmer requests, MASM 6.1x no longer performs this
> optimization automatically. The optimization can be performed by
> using the OPATTR operator, as shown in the following macro:

          MOVLEA MACRO Dest, Symbol
          IF (OPATTR(Symbol)) AND 08h
               MOV Dest, OFFSET Symbol
          ELSE
               LEA Dest, Symbol
          ENDIF
          ENDM

 

Complete thread:

Back to the forum
Board view  Mix view
22049 Postings in 2034 Threads, 396 registered users, 84 users online (0 registered, 84 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum