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 Rugxulo Homepage, Usono, 03.05.2013, 10:40
(edited by Rugxulo on 03.05.2013, 10:54)

> > BTW: will be supported the inline assembler with all modetn instructions
> > known to FPC?
>
> Nikolay said that the assembler reader is basically the i386 one, only he
> has it now artificially limited to root out 186+ instructions easier.

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, but I can't remember exactly without checking. That was useful for porting xWcopy, though.)

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). In other words, the latest 16-bit DOS .EXE (0.98.39) was here. And IIRC there was a bug (only fixed in unofficial Apple 0.98.40) regarding crashes on 256 or more externs. Also, can't remember, but the newer NASM manuals omit the (large) instruction reference, though at least latest seems to have a small index of instructions and cpus when introduced (though not as friendly, IMHO, without full descriptions).

If it helps, there's also a 186 asm/disasm ASCII chart (table) made back in the day on Simtel.net mirrors under /asmutl/ : disasm.zip

I also made my own wimpy refernce for my own amusement:


                         +---------------------------------+
                         | Intel 80186, 80188 (aka, "186") |
                         +---------------------------------+
Features:
=========

    shl cx,5      ; (shr,sar,rol,ror,rcl,rcr,...)
   
    imul ax,5
    imul ax,bx,5
   
    push 5
    pusha
    popa
   
    enter         ; enter stack frame (nested procedure variables)
    leave         ; leave stack frame
   
    bound         ; array bounds checking (calls INT 5)
    into          ; overflow checking     (calls INT 4)

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

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


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!!

 

Complete thread:

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