Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

FPC 16-bit (80186 cpu + NASM info) (Announce)

posted by marcov, 03.05.2013, 15:10

> NASM supports "cpu 8086" to avoid (most) invalid instructions. (I think it
> used to only miss catching near 386+ jumps. Perhaps out of range short
> jumps can be conveniently worked around by -O2,

Good to know. But note that inline assembler and backend-assembler are two different things.

The inline assembler is based on converted tables of NASM (for x86 likes at least).

The backend assembler happens to be nasm for the 16-bit port, but is not used otherwise. But e.g. the internal assembler can read an instruction as mnemonic, but output it to the backend assembler using db's.

> Anything NASM version after 0.98.39 only compiles (officially) with C99 and
> 32-bit host (probably due to higher requirements from adding 64-bit).

That's no problem. There is no use for a 16-bit hosted one, since the compiler won't be 16-bit hosted anyway.

> enter ; enter stack frame (nested procedure variables)
> leave ; leave stack frame

Not used in practice, due to nesting limits (31 or 32). Leave is sometimes used.

> bound ; array bounds checking (calls INT 5)
> into ; overflow checking (calls INT 4)

Not used afaik.

> insb, insw ; read from port in DX to [ES:DI]
> outsb, outsw ; write [DS:SI] to port in DX

No instructions a compiler would generate (manual assembler in libraries maybe)

> Quirks:
> =======
>
> shl ax,33 ; doesn't always clear AX anymore (now only uses 5 bits)
> pop cs ; not allowed anymore
> push sp ; still decremented before push, unlike 286
> aam 10 ; not supported by NEC V20/V30
> salc ; undocumented but "should" still work
> [/code]

Of those, probably only push sp could be generated by the compiler, and that that change is fairly known (detections are based on it).

And since I always had a 386+ (even in my 16-bit times), I'm not that well versed in this.

> P.S. Feel free to ignore all of this, you don't have to pass it along to
> Nikolai. Though if he's messing with DOS, perhaps he should visit here
> himself!!

He might already have a look from time to time already.

 

Complete thread:

Back to the forum
Board view  Mix view
22779 Postings in 2122 Threads, 402 registered users (0 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum