flat assembler
Message board for the users of flat assembler.

Index > MenuetOS > relative jump out of range

Author
Thread Post new topic Reply to topic
Chemist



Joined: 24 Dec 2003
Posts: 10
Location: Minsk
Chemist 12 Jan 2004, 19:51
Hi! In TASM 5.0 this errormessage was common and if i'll use MODEL SMALL (etc.) instead of MODEL TINY everything was OK. How to fix this error with FASM 1.50 for Menuet?

P.S. My english is not well.. Wink
Post 12 Jan 2004, 19:51
View user's profile Send private message Reply with quote
eet_1024



Joined: 22 Jul 2003
Posts: 59
eet_1024 12 Jan 2004, 23:15
Do you have that problem with fasm?

Fasm automatically decides which type of jump to use.
Post 12 Jan 2004, 23:15
View user's profile Send private message Reply with quote
Chemist



Joined: 24 Dec 2003
Posts: 10
Location: Minsk
Chemist 13 Jan 2004, 00:08
[quote="eet_1024"]Do you have that problem with fasm?

Yes, i have this problem with fasm. I decided to use dec ecx cmp ecx,0 je ... jmp loop123 instead of loop loop123 and everything is ok now.
Post 13 Jan 2004, 00:08
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 13 Jan 2004, 00:41
Chemist wrote:
Yes, i have this problem with fasm. I decided to use dec ecx cmp ecx,0 je ... jmp loop123 instead of loop loop123 and everything is ok now.


Well, AFAIK, loop is the only instruction where you can get this error. It is because loop have only short form of addressing. Every other jumps (conditional and unconditional) will be optimised by FASM, unless you set the exact operand size.

Regards.
Post 13 Jan 2004, 00:41
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1150
Location: Russian Federation
comrade 13 Jan 2004, 01:31
loop can only go +/- 127 bytes

_________________
comrade (comrade64@live.com; http://comrade.ownz.com/)
Post 13 Jan 2004, 01:31
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
Bitdog



Joined: 18 Jan 2004
Posts: 97
Bitdog 18 Jan 2004, 15:52
Hello. I'm a newbe 2 Fasm, but doesn't "DEC" set the Zero Flag ?
Quote: "dec ecx cmp ecx,0 je ... jmp loop123 instead of loop "
Which makes the CMP redundant ?
I don't know about Fasm, BUT Nasm allows NEAR/WORD conditional jumps?
DEC ECX
JNZ NEAR LABEL ;loop near +-0xFFFF bytes.

Fantastic Fasm appears to use size as:
DEC ECX
JNZ WORD LABEL

But then, this might be a final solution?
DEC ECX
JZ ENDloop
JMP LOOPtop
ENDloop:

I hope I haven't overstepped my boundries here?
But looked at MenuetOS yesterday for the first time,
& it was a life altering event.
I converted all my old PROCs to Fasm last night,
and todays goal is to learn more Fasm MenuetOS,
like how to get it to do something.
(Show fonts, load from HD, run a program, etc.)
(Generic newbe troubles..........Smile

Bitdog
Post 18 Jan 2004, 15:52
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 can 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.