x86 Assembly

Moderators: None (Apply to moderate this forum)
Number of threads: 4556
Number of posts: 16011

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
32 bit problem with tasm Posted by Scorpie on 26 Sept 2003 at 2:51 AM
hello,

i wrote a program for tasm in a 16 bit version. i use lot of jump commands, so that the jumps are out of range for a 286 cpu.
so i replace it to 386. but now the data segment cant initialisized, i think.the errormassage is: "instruction can be compacted with override" and if i use a variable from the datasegment: "offset or pointer is 32-bit"
i thougt that the adressing is the same but it doesnt work.
is it possible to use 32bit in real dos mode (ms-dos 6)?
at least i use of course an 486 computer

thanks for the fast help

Scorpie
Report
Re: 32 bit problem with tasm Posted by Bitdog on 26 Sept 2003 at 5:23 PM
I believe many of the 286 jumps are the same for a 386 & 486.
I mean a short jump is 128 bytes in either direction on all CPUs.
If your jump is out of range on one it will be out of range on the next.
Do work around code. What looks big, extra, uneeded, .asm code
adds up to a few extra bytes of code. So it's meaningless.
AND since asm is fast any way, slower code that works is fine is ok
in most all circumstances, avoiding repeat situations, loops, REPZ MOV/STO, stuff.
I use JNZ then JMP to jump 65535 in any direction,
or JMP FAR 0x####:####h ; jumps anywhere (hopefully the code is correct?)
CMP AL,SOMETHING ;this is yer standard CMP & JMP NEAR code
JNZ NOJMP
JMP ITsSame ; extra code is only a few bytes machine code
NOJMP:

My Masm6 didn't count instruction code bytes properly and
wouldn't give the short jump out of range error when it was needed.
I don't know if Tasm has that flaw?
There are Tasm .asm programmers around here, a short code snipit
like a small blank template, might get some comments that point out
Tasm errors for you.

Bitdog

Report
Re: 32 bit problem with tasm Posted by Scorpie on 28 Sept 2003 at 6:58 AM
Hello,

thanks for the fast feedback.
with the tasm it is possible when it is 386 or higher to make unlimited jumps.
if i define it for 386 the error appears like descripted in my first message.
the jump on a 286 is limited as you wrote.
is it possible that i send you my little project, that you could have a look at it? that might help me to find stupid little bugs.
i have only one problem, the whole documentation is in german, but if you would be so kind to have a look at it, it wouldnt be a problem to translate it into english.

best regards, thank you for your help

Scorpie



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.