flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > Changes from 1.60 -> 1.71

Author
Thread Post new topic Reply to topic
bubach



Joined: 17 Sep 2004
Posts: 341
Location: Trollhättan, Sweden
bubach
Hi, I'm checking some of my old OS code and while trying to get a working development environment going on my Mac I encountered this error:

"Invalid use of symbol"

Something I do not get if I assembly with the older 1.60 version.

The line in question looks like this:
Code:
mov     [(idt_list+ecx/2)], edi             ; add new int to idt entry list     


and it seems to be the divide by 2 part it doesn't like.

I haven't done any assembly programming in years - but this doesn't look pretty Razz Anybody have idea on why it did work at one point, and why it doesn't anymore?

Is there somewhere I could get a summary of changes affecting syntax from 1.60 and forward?

_________________
BOS homepage: http://bos.asmhackers.net/
Post 07 Jan 2015, 19:51
View user's profile Send private message Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc
bubach
Quote:
it seems to be the divide by 2 part it doesn't like

Yes. This is soo wrong. What was actually compiled is "mov [idt_list+eax], edi". This bug has been eliminated in 1.66 and it seems to be summarized under "many other small bugs fixed".
Quote:
Is there somewhere I could get a summary of changes affecting syntax from 1.60 and forward?

WHATSNEW.TXT

_________________
Faith is a superposition of knowledge and fallacy
Post 07 Jan 2015, 20:53
View user's profile Send private message Reply with quote
bubach



Joined: 17 Sep 2004
Posts: 341
Location: Trollhättan, Sweden
bubach
you must mean "mov [idt_list+ecx], edi"? so before the bug fixes it just ignored the divide by 2?
Post 07 Jan 2015, 22:33
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17671
Location: In your JS exploiting you and your system
revolution
bubach wrote:
you must mean "mov [idt_list+ecx], edi"? so before the bug fixes it just ignored the divide by 2?
No, it really does give "mov [idt_list+eax],edi" Exclamation
Post 08 Jan 2015, 00:16
View user's profile Send private message Visit poster's website Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc
bubach
No. I mean eax. My first thought was that fasm just divides the native register number (like you know: ecx/2 = eax, esi/2 = ebx, etc.) But in a couple of superficial tests it always took eax.

_________________
Faith is a superposition of knowledge and fallacy
Post 08 Jan 2015, 00:18
View user's profile Send private message Reply with quote
bubach



Joined: 17 Sep 2004
Posts: 341
Location: Trollhättan, Sweden
bubach
wow. must have been close to miraculous that my old code would run without errors in that case. probably helped that the line above was:
Code:
          movzx   ecx, ax    
Post 08 Jan 2015, 01:29
View user's profile Send private message Reply with quote
bubach



Joined: 17 Sep 2004
Posts: 341
Location: Trollhättan, Sweden
bubach
Hm, I have another strange thing going in my bootsector. It seems as it no longer assembles this

Code:
          jmp     near start
          nop    


into "EB 3C 90" but instead into "E9 3C 00 90"... sigh. something changed with near jumps, or could this be a bug in the hacked OS X version of fasm? Sad
Post 08 Jan 2015, 19:55
View user's profile Send private message Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc
bubach
The keyword near enforces a long encoding of a relative jump. The keyword short enforces a short encoding of a relative jump. If you specify neither of those the short encoding is used unless it's not possible.

See the documentation for explanation of keywords.

_________________
Faith is a superposition of knowledge and fallacy
Post 08 Jan 2015, 20:39
View user's profile Send private message Reply with quote
bubach



Joined: 17 Sep 2004
Posts: 341
Location: Trollhättan, Sweden
bubach
That code is untouched since like, 2003. But yeah, okey - probably another thing changed since 1.60. Thanks!
Post 08 Jan 2015, 21:08
View user's profile Send private message Reply with quote
bubach



Joined: 17 Sep 2004
Posts: 341
Location: Trollhättan, Sweden
bubach
Argh, I also had to deal with this issue:
http://board.flatassembler.net/topic.php?t=3286

No way to avoid it any longer. Well, moving the codebase down below 0x10000 to maybe 0x8000 should do it. I hope.
Post 08 Jan 2015, 22:48
View user's profile Send private message Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc
bubach
I can't see any real issues with staying above 0x10000. As for jumping into protected 32-bit mode you just do jmp fword 0x08:do_pmode . As for data shared across both modes, you just define two labels for each shared variable. There are possibilities to make neat and easy-to-use macros for that, so that there's no visual difference to your previous code.

_________________
Faith is a superposition of knowledge and fallacy
Post 08 Jan 2015, 23:20
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.