flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > JECXZ in 16-bit code

Author
Thread Post new topic Reply to topic
CandyMan



Joined: 04 Sep 2009
Posts: 311
Location: film "CandyMan" directed through Bernard Rose OR Candy Shop
CandyMan
attemp of the assembly of the code:

org 0xFFC00000
use16
jcxz $
error: invalid value
Post 14 Sep 2011, 16:36
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
This is happening with all jump instructions actually. In fasm 1.64 this code works.
Post 14 Sep 2011, 17:53
View user's profile Send private message Reply with quote
Tomasz Grysztar
Assembly Artist


Joined: 16 Jun 2003
Posts: 7721
Location: Kraków, Poland
Tomasz Grysztar
It is no longer assembled thanks to corrections made in 1.65.20 release. With "use16" jump defaults to 16-bit (which truncates target address to IP), and so it would jump to "0xFFC00000 and 0FFFFh", which is not the same as $, so fasm refuses to generate such code. You can jump to $=0xFFC00000 with 32-bit jump:
Code:
jcxz dword $    

And if you really wish to jump to "0xFFC00000 and 0FFFFh", then tell fasm that:
Code:
jcxz $ and 0FFFFh    
Post 14 Sep 2011, 19:20
View user's profile Send private message Visit poster's website 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.

Powered by rwasa.