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: 413
Location: film "CandyMan" directed through Bernard Rose OR Candy Shop
CandyMan 14 Sep 2011, 16:36
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: 4624
Location: Argentina
LocoDelAssembly 14 Sep 2011, 17:53
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



Joined: 16 Jun 2003
Posts: 8353
Location: Kraków, Poland
Tomasz Grysztar 14 Sep 2011, 19:20
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.