flat assembler
Message board for the users of flat assembler.

Index > Main > Real mode version of fasm?

Author
Thread Post new topic Reply to topic
SoLo2



Joined: 09 Mar 2007
Posts: 14
SoLo2 27 Aug 2007, 03:47
I was trying to assemble
with fasm, but the DOSBox
would ask for some
memory extensor.

So I found in a wiki a link
to CWSDPMI which has to
be called every time
before fasm.

Is there a possibility of
having fasm in 16 bits?
Is it all 32bits code?

Thanks for this nice ass!

SoLo2
Post 27 Aug 2007, 03:47
View user's profile Send private message Visit poster's website Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u 27 Aug 2007, 04:12
Why not just assemble the 16bit code, with the windows or linux ver ?.
What OS are you running ?, also why not make a bat file ?.
Do you need to run it in DosBox to run the program afterwards ?.

PS: Cool demos.
Post 27 Aug 2007, 04:12
View user's profile Send private message Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1900
DOS386 27 Aug 2007, 04:36
> I was trying to assemble
> with fasm, but the DOSBox
> would ask for some
> memory extensor.

Why don't you use the Win32 version if you must run it on Vi$ta ? Confused

> So I found in a wiki a link to CWSDPMI
> which has to be called every time before fasm.

Yes. Works. But CWSDPMI is obsolete, HDPMI32 is much better (for DOS).

> Is there a possibility of
> having fasm in 16 bits?

[NO] Question

> Is it all 32bits code?

YES. Would be extremely difficult to port to 16-bit. And, you would have "out of memory" problems then Sad

What is your CPU ? P4 ? AMD64 ? And with such you ask for 16-bit ? Confused

BTW: NASM has a 16-bit RM version ... untested by me Confused


Last edited by DOS386 on 27 Aug 2007, 21:16; edited 1 time in total
Post 27 Aug 2007, 04:36
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8351
Location: Kraków, Poland
Tomasz Grysztar 27 Aug 2007, 09:32
Versions <=1.48 had a 16-bit FRM version for DOS, but it was no longer supported later.
It may still be possible to re-assembler fasm into 16-bit MZ (as it would no longer fit into .com), thought it would require a bit of work.
I suggest that you visit http://fasm.sourceforge.net/archive/ and grab the 1.48 package to try the FASM.COM version (it's in SOURCE/DOS subdirectory).
Post 27 Aug 2007, 09:32
View user's profile Send private message Visit poster's website Reply with quote
DOS386



Joined: 08 Dec 2006
Posts: 1900
DOS386 27 Aug 2007, 21:20
Quote:
Versions <=1.48 had a 16-bit FRM version for DOS, but it was no longer supported later.


FRM = Unreal mode with 16-bit CS (and all 32-bit stuff prefixed ?) ?

Later used 32-bit Unreal mode ?

The memory management of FASM is and always was somewhat black magic Confused and undocumented (no mentions about it in version history) ... and seems there were many changes to this code ...

http://board.flatassembler.net/topic.php?t=472

bttr complained about FASM preferring Unreal from DPMI ... and it hasn't been fixed up to now. The issue is not critical for me, but I still stink that DPMI should be preferred from Unreal ... FASM still doesn't work if it finds CPU in real mode and DPMI present Sad

BTW, FASMD seems to no longer use Unreal ... only DPMI ... so it doesn't suffer from bttr's "DPMI bug" Wink

Code:
; flat assembler  version 1.0
; Copyright (c) 1999-2000, Tomasz Grysztar
; All rights reserved.

init_flatrm:
        push    sp                      ; store stack frame
        pop     ax
        cmp     ax,sp                   ; compare stack frame values
        jne     processor_error         ; if not equal, CPU is 8086-80186 !!! BUG !!! Sad
        smsw    ax
        test    al,1                    ; processor is in protected mode?
        jnz     pm_error                ; if yes, generate error
        pushf
        pop     ax
        or      ah,F0h                  ; try to set high 4 bits of FLAGS
        push    ax
        popf
        pushf
        pop     ax
        test    ah,F0h
        jz      processor_error         ; if bits not set, CPU is 80286
        xor     eax,eax                 ; calculate linear address of GDT
        mov     ax,cs
        shl     eax,4
        add     eax,GDT
        mov     dword [cs:GDTR+2],eax
        cli                             ; disable interrupts
        lgdt    pword [cs:GDTR]         ; load GDT register
    


SORRY but I have to report a BUG in FASM 1.0 (better late than never Laughing ) - the "found <80286 CPU" jump is out of "short" range, encoded with $0F ... ... ... so it will always freeze on the affected CPU's ... I guess ... attempt to POPE CS Question ... please correct me if I'm wrong Wink

No need for a 8086_only directive ? Wink

16-bit CPUID'ding discussed also here:

http://board.flatassembler.net/topic.php?t=7204

The archive is definitely interesting :

Code:
version 1.02
[06-07-2000]
------------
[-] minor bugs fixed
[+] some documentation changes

version 1.01
[01-07-2000]
------------
[-] fixed bug in MZ header generator

version 1.00
[19-06-2000]
------------
[+] first official release

version 0.90
[04-05-1999]
------------
[+] first version able to recompile itself

version 0.00
[23-03-1999]
------------
[+] flat assembler project was started at 14:24:33
    


- Project start known with precision of seconds Laughing

- 1.00 Needed 21 days from compile to release Wink

- 1.00 Seems to have very exclusively supported pure real mode DOS only Smile
Post 27 Aug 2007, 21: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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.