NO

Author Topic: PoASM v5.0 (good, but still has some bugs)  (Read 5077 times)

japheth

  • Guest
PoASM v5.0 (good, but still has some bugs)
« on: February 01, 2008, 02:23:17 pm »
Hello,

thanks for PoASM v5.0! Good to see this tool is still being developed. I will use this event to report some bugs :)).

I just fed it with some code and noticed:

1. PoASM complains about

Code: [Select]
    .386
    .data
flatsel dd 0
    .code
 ....
mov ds,[flatsel]

saying "invalid combination of opcode and operands"

thus forcing me to change the last line to "mov ds, word ptr [flatsel]"

That's bad. The move to/from segment registers can have both a word and dword memory reference.

2. PoASM assembles without error this code:

Code: [Select]
    .386
    .model flat
WIN386_Emulator proto
...

but the linker complains about unresolved external "_WIN386_Emulator". Obviously PoASM decorates the name with an "_" prefix. But please note that there is no calling convention behind the ".model" directive, that is, PoASM should NOT decorate such symbol names.

3. PoASM apparently wants to help the programmer. Good, but asm coders are a bit cautious if it comes to "helpful" assemblers. See this little piece of code:

Code: [Select]
VDWORDOUT proc C public
push eax
shr eax,16
call VWORDOUT
pop eax
VDWORDOUT endp  
VWORDOUT proc C public
push eax
mov al,ah
call VBYTEOUT
pop eax
VWORDOUT endp
VBYTEOUT proc C public
pushfd
push eax
....

There are several PROCs and some lack the RET at the end ... deliberately! But PoASM includes this missing RET silently, which is not appreciated here. MASM doesn't do such things.

btw, POLINK still has problems and reports "duplicate symbols" if ASM code contains a "DllMain" function.

Regards

Japheth




« Last Edit: February 01, 2008, 04:27:19 pm by japheth »

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2084
    • http://www.smorgasbordet.com
Re: PoASM v5.0 (good, but still has some bugs)
« Reply #1 on: February 01, 2008, 09:49:26 pm »
1. I can't find a mov Sreg,r/m32 in my docs, and anyway messing with segment registers in 32/64 bit assembly should be so uncommon that the word form should be plenty enough.
2. C is default, and if you don't specify a convention in the .model directive it will continue to be the default. Use syscall for no decoration. RTFM.
3. If you don't want the extra fluff associated with PROC - ENDP, don't use it. Use a label. POASM iss not MASM. Again, RTFM.
/Pelle

japheth

  • Guest
Re: PoASM v5.0 (good, but still has some bugs)
« Reply #2 on: February 02, 2008, 12:04:39 pm »

> 3. If you don't want the extra fluff associated with PROC - ENDP, don't use it. Use a label. POASM iss not
> MASM. Again, RTFM.

Why RTFM? I did and didn't find this "feature" being mentioned in the description of the PROC/ENDP directives.


Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2084
    • http://www.smorgasbordet.com
Re: PoASM v5.0 (good, but still has some bugs)
« Reply #3 on: February 15, 2008, 11:12:43 am »
Sorry, I was tired - it has been covered before, but probably in other forums...
/Pelle