Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

(My) fork of 8086 Assembler for DOS (Announce)

posted by DosWorld, 27.12.2020, 22:11
(edited by DosWorld on 27.12.2020, 23:28)

> Aha, I wouldn't imagine possibility of mixing TP and C-- code (no problems
> with call conventions?).

No problems.

> Can you describe it a bit more detailed?

Here is Michael Schreker C--.

this function return length of string k:
("d" parameter is not need, i just put it for proof params order)

int pascal cmm_length(int d, dword k) {
// k = pascal string
// d - something other
    $push ds;
    $lds  si,k;
    $cld;
    $lodsb;
    AH = 0;
    $pop ds;
}


also, you can define length as far

int pascal far length(int d, dword k) {

compile it with

c-- /x /sobj len.c--
(/sobj mean slave obj, /obj produce obj with entry point in our case we not need entry point)

and use into TP - it must work for TP 5.0 ang great (ver 3.0 had alternative way without obj, 4.0 - i never try and use):

function cmm_length(d:integer;k:string):integer;near;external;
{$L LEN.OBJ}


or far:

function cmm_length(i:integer;k:string):integer;far;external;

and call it:

writeln(cmm_length(0, 'hello world!'));

If i am not wrong (i don't remember preciously now), i am check and compare original C-- source code and Michael's source: original C-- does not produce FIXUP record for obj (i love this [censored] record!) - just put code without relocation info, so you can't use static/global variables into C-- obj's. Michael fix and add it. (This is IMHO, need check it again).

> produce also OMF and then link together with some OMF linker to target EXE?

without linker - TP can consume obj/omf.

Also, no problem linking C-- and Watcom C (i do it for real mode).
Possible easy linking with TP3, but i think it is non-actual.

C-- can do a real magic for you. I have problems only linking with Small C - Small C does not use Borland/Microsoft name convention for segments (TEXT/DATA/BSS etc). It think root cause is - because this convention is created later then Small C. I have idea - rewrite std-library for Small C in C-- (i think it must be a rocket-speed).

PS: Scheker's C-- have a bug - add unwanted byte to driver header (when produce ms-dos .sys file). I send bugreport to Michael, but Michael stop respond on any mail.

---
Make DOS great again!
Make Russia small again!

 

Complete thread:

Back to the forum
Board view  Mix view
22370 Postings in 2073 Threads, 400 registered users, 97 users online (1 registered, 96 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum