03-07-2004, 08:03 PM
03-07-2004, 08:05 PM
You have to compile them using the MEDIUM memory model and the Pascal calling convention. I've never done that, so I guess more experienced posters will elaborate
03-07-2004, 08:11 PM
Hmm...Wouldn't we want the BASIC model specifier, not PASCAL?
Code:
.model medium, BASIC
03-07-2004, 11:45 PM
I didn't even know that that existed. If you knew it, why did you ask?
All I know is that QB passes parameters using the Pascal "order". You have to declare your functions "pascal" in C if you want to write a library in C, I just thought it was the same with assembly.
All I know is that QB passes parameters using the Pascal "order". You have to declare your functions "pascal" in C if you want to write a library in C, I just thought it was the same with assembly.
03-08-2004, 02:10 AM
Well - maybe QB differs from "BASIC". :lol:
No, my question is mainly how do I turn my objs into a .qlb?
No, my question is mainly how do I turn my objs into a .qlb?
03-08-2004, 02:35 AM
Still asking asm questions here?
A qlb is only needed when you want to use the library inside the qb IDE. Otherwise you use .obj files directly when you link or .lib files which are just a collection of .obj files in one file. Using masm use this frame
Then to create a .lib do this
ml /c myobj.asm
lib mylib +myobj.obj;
And to create a qlb do this
qb 4.5: link /q mylib.lib,mylib.qlb,nul,bqlb45.lib;
qb 7.1: link /q mylib.lib,mylib.qlb,nul,qbxqlb.lib;
vbdos 1.0: link /q mylib.lib,mylib.qlb,nul,vbdosqlb.lib;
The only thing that differs qb 4.x libs (not qlbs) to pds/vbdos libs is that the later uses far strings, so that's something you'll have to think about if you're building a lib for all of them. Atleast i think that's the only thing that differs them, i don't remember. But i'm pretty sure.
A qlb is only needed when you want to use the library inside the qb IDE. Otherwise you use .obj files directly when you link or .lib files which are just a collection of .obj files in one file. Using masm use this frame
Code:
.model medium, basic
.386
.code
mybasroutine proc public uses someregs,\
arg1:word,\
arg2:dword
local mylocalvar:dword
;;
;; Code here
;;
ret
mybasroutine endp
end
Then to create a .lib do this
ml /c myobj.asm
lib mylib +myobj.obj;
And to create a qlb do this
qb 4.5: link /q mylib.lib,mylib.qlb,nul,bqlb45.lib;
qb 7.1: link /q mylib.lib,mylib.qlb,nul,qbxqlb.lib;
vbdos 1.0: link /q mylib.lib,mylib.qlb,nul,vbdosqlb.lib;
The only thing that differs qb 4.x libs (not qlbs) to pds/vbdos libs is that the later uses far strings, so that's something you'll have to think about if you're building a lib for all of them. Atleast i think that's the only thing that differs them, i don't remember. But i'm pretty sure.