News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Does UASM not like the register fs?

Started by Gunther, March 08, 2021, 05:28:40 PM

Previous topic - Next topic

Gunther

This may not be a smart question, but I'll ask it anyway. I need the following statements in a protected mode program:

    mov      al, ds:[esi]
    mov      byte ptr fs:[edi], al

The first instruction assembles JWASM/UASM without complaint. The second completely correct instruction, which should lead to the machine code 646807h, generates an error 2183 (JWASM) or 2184 (UASM).

The same happens in the reverse case:

    mov      al, fs:[esi]

This should result as machine code 648A06h, but again results in the error message. This occurs in JWASM for DOS version 2.13 and also in the latest version 2.51 of UASM.

Something has obviously not been right for a long time.

Gunther
You have to know the facts before you can distort them.

nidud

#1
deleted

Gunther

Nidud,

Quote from: nidud on March 08, 2021, 10:38:40 PM
FS and GS is assumed to ERROR in flat mode:

    assume cs:flat,ds:flat,ss:flat,es:flat,fs:ERROR,gs:ERROR

Try this:

    assume  fs:nothing
    mov     al,fs:[edi]
    assume  fs:error


fine, but that doesn't help. It is a 32-bit protected mode program. I know exactly what I am doing and what fs and gs contain for descriptors.
Other assemblers translate these instructions correctly and without complaint. Do I need to hack in these commands via db in the future?

Gunther
You have to know the facts before you can distort them.

jj2007

if it's not flat, ERROR, nothing, what is the correct name then?

nidud

#4
deleted

Gunther

Nidud,

the workaround with the assume works well, but it's a bit awkward.

It seems to me as an incapacitation through the assembler maintainers. The DJGPP has fs as the only free segment register. It's not my decision.

Gunther 
You have to know the facts before you can distort them.

nidud

#6
deleted

Gunther

Casually, with the latest version of JWASM for DOS (version 2.13 from July 23, 2015) maintained by Japheth, the error no longer occurs. The corresponding instructions are translated correctly
and without complaint. The described behavior can only be found very exclusively in UASM.

For the further development of JWASM please also note this post.

Gunther
You have to know the facts before you can distort them.

johnsa

I think we could safely NOT assume fs/gs to ERROR if the output format is not -coff ?

Gunther

Johnsa,

be careful, the DJGPP requires coff. It is the 32-bit com model.

Gunther
You have to know the facts before you can distort them.

Gunther

Johnsa,

what is supposed to happen when fs and gs no longer assume to ERROR? JWASM for DOS from 2015 shows that it works.

When someone in protected mode uses the segment registers with a valid selector, they know exactly what they are doing.
If a novice fiddles with the segment registers in Protected Mode, he will simply get a GPF. This is the worst thing that can happen. So what?

Gunther
You have to know the facts before you can distort them.

johnsa

Agreed, you can even use fs: in win32 .. I'm inclined to say just remove the ERROR assume outright.

Gunther

Johnsa,

Quote from: johnsa on March 11, 2021, 02:19:04 AM
Agreed, you can even use fs: in win32 .. I'm inclined to say just remove the ERROR assume outright.

I need register fs under DJGPP (32-bit Protected Mode DOS).

Gunther
You have to know the facts before you can distort them.