--------------- FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC Ref: FA100002 Date: 05/11/98 From: REINIER ZWITSERLOOT Time: 04:22pm \/To: ALL (Read 1 times) Subj: Re: 3D game engine for PB From: Reinier Zwitserloot Subject: Re: 3D game engine for PB? Gregoire Turgeon wrote: >As always, simpler is better. One tool is better than two, as long as >the tool does what's required, and quickly enough. And if the choice >of tools isn't limited by cost--what luxury. I don't agree with that. If you have two tools and a third that makes em talk very nicely to each other that tends to be easier. Especially if you write the translating program yourself :-). You are going through heaps of trouble to insert your 386 stuff. Get NASM and PBPLUS and both (PBPLUS being the translator) make it as easy as PB/inline asm. example: $PTNASM MOV EAX, 10 %macro ;This macro only valid in this session of NASM, though. %endmacro SALC ;undocumented CPUID ;pentium and the likes PAND ;MMX FADD ;NPX $PTPBAS the above is exported by PBPLUS into a temporary file, then NASM is called to translate to direct binary, then that (temporary) binary file is read and translated to !db statements, which are inserted in the temporary BAS file. At the end of PBPLUS processing PBC.EXE is called and optionally the resultant EXE is automatically run. The idea is to write your code in some external editor. If I wanted to do this with TASM or MASM i'd be writing half a linker! They don't output plain binary which is exactly what you'd want for backend/insert use. Use local (stack) addressing or alternatively use a base index: CALL $+3 POP DI and reference all your (assembly) variables adding DI. http://www.geocities.com/SiliconValley/Lab/1990 NOTE: When I finish my linker project I might just write PBPLUS v2.00 with much better macro capabilities and a slightly faster parser, but that highly depends on the interest in such a new version, so do please send E-mail if you are using PBPLUS. -- - Ray Zwitserloot. R.Zwitserloot@antispam.BTInternet.com Change the E-mail address to reply! ---------------------------------------------------- *** QwkNews (tm) v2.1 * [TN71] alt.lang.powerbasic <-> POWER_BAS Gateway --- GEcho 1.20/Pro * Origin: Toast House Remote (1:100/560.2) --------------- FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC Ref: FA100003 Date: 05/11/98 From: KROGG Time: 06:12pm \/To: ALL (Read 1 times) Subj: Re: 3D game engine for PB From: Krogg Subject: Re: 3D game engine for PB? Brianster wrote: > > Ok, now I'm pretty confused here. I'm not a professioanl programmer on the > level you guys are and no very little about assembler. (I usually learn > something about it only when I see some code and I want to know how it works.) > But I'm really confused about what instruction PB's inline can handle. On one > had, if you're doing stright inline assembly programming, you have to conform > to the 8086 instruction set, right? If you want to use 32-bit nstructions, > you need to link .obj files compiled in a seperate assembler compiler Masm, > Tasm, Nasm...the debate rages on :)...) But, if I'm following this correctly, > everyone is saying that I can write 386 assembly code, put it in PB but ust > put a !db in front of it and it will work? Somehow this seems a little to easy > to me and I think I'm missing something here... > Brian Brian, Powerbasic uses only 8086 instructions and It just converts the asm statements to machine code for the exe.The asm statement db just tells the compiler to NOT translate anything,JUST add the next byte right into the exe just as "dw" would add the next word to the exe.You can put any thing you want after the db as long as its a byte,but if you are doing it in the middle of your code then you might want the byte to be a machine code for some instruction. Dont quote me but i think pusha and popa are 186 opcodes and are not supported by powerbasic's inline asm support.but you can use them in your program just like anyother asm code because the machine code for pusha=&h60 and popa=&h61 (this is from memory,hope its right) and by using this line !db &h60 I can push all general registers and by doing this !db &h61 I can pop all general registers and as you can see its not just as simple as adding a db infront of a non 8086 instruction,you must also have the machine code for the op code you want to use. I hope this helps you to understand and isnt confusing. -- ___________ THE ___________ / _________ \ <\PRINCE /> / _________ \ / / __ \/ \\ // \/ __ \ \ / / / \ \\ // / \ \ \ / / / /\/ /""""""\ \/\ \ \ \ \ \ / / SEE HIS ( / \ \ SEE HIS \ \ / / \ \ \ \ FACE \/<> <>\/ SMILE / / / / \ \ \ \ / W \ / / / / / / \ \ /\_|||||_/\ / / \ \ / / / \ // ||| \\ / \ \ \ / / / /\ \ // ' \\ / /\ \ \ \ / / / / / / \ \ \ \ \ \ / / / \/ \_______________________/ \/ \ \ \ \ \ / /\_________________________________/\ \ / / \ \/ / krogg.no.to.spam@inspace.net \ \/ / \__/ Remove no.to.spam to reply \__/ http://www.inspace.net/~carcher/krogg/aani.htm Gory javascript animations for your enjoyment *** QwkNews (tm) v2.1 * [TN71] alt.lang.powerbasic <-> POWER_BAS Gateway --- GEcho 1.20/Pro * Origin: Toast House Remote (1:100/560.2) --------------- FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC Ref: FA100004 Date: 05/12/98 From: BRIAN MCLAUGHLIN Time: 12:09am \/To: ALL (Read 1 times) Subj: Stand-alone assemblers From: brianm@ims.com (Brian McLaughlin) Subject: Stand-alone assemblers dave@powerbasic.com (Dave Navarro) writes: |> Link Bob said, and I've told you *many* times, NASM is the assembler at fault |> for using "an outdated" method for fixups. Way back in 1989 all of the major |> assemblers (MASM, TASM, IBM Assembler, Intel Assembler {INASM} and OPTASM) all |> moved to using 32-bit fixups which is "what Intel recommends". |> |> NASM needs to get with the program and use the *STANDARD*. I would also like to point out that (at least in the USA), it is possible to get ahold of TASM rather inexpensively. I just recently purchased a book + CD-ROM package from Sams Publishing, called "Learn C in 21 Days", that comes with Borland C++ 3.1. As it happens, Borland C++ was the "professional level" compiler of a few years ago, and it came with both TASM and Turbo Debugger, as well as both DOS and Windows-hosted IDEs, and both C and C++ compilers. The price for all this at CompUSA? US$40, including the book. Indirectly, I suppose we have Win95 to thank for this bounty. -- Brian McLaughlin, Technical Writer |"Thanks to the Internet, misinformation Integrated Measurement Systems, Inc.| now travels faster than ever before!" Beaverton, OR, USA | ---- Standard disclaimer applies ---- *** QwkNews (tm) v2.1 * [TN71] alt.lang.powerbasic <-> POWER_BAS Gateway --- GEcho 1.20/Pro * Origin: Toast House Remote (1:100/560.2) --------------- FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC Ref: FA100005 Date: 05/12/98 From: GREGOIRE TURGEON Time: 05:06am \/To: ALL (Read 1 times) Subj: Re: 3D game engine for PB From: gturgeon@meol.mass.edu (Gregoire Turgeon) Subject: Re: 3D game engine for PB? On 11 May 1998 14:17:37 GMT, brianster@aol.com (Brianster) wrote: >Ok, now I'm pretty confused here. I'm not a professioanl programmer on the >level you guys are and no very little about assembler. (I usually learn >something about it only when I see some code and I want to know how it works.) >But I'm really confused about what instruction PB's inline can handle. On one >had, if you're doing stright inline assembly programming, you have to onform >to the 8086 instruction set, right? If you want to use 32-bit instructions, >you need to link .obj files compiled in a seperate assembler compiler (Masm, >Tasm, Nasm...the debate rages on :)...) But, if I'm following this correctly, >everyone is saying that I can write 386 assembly code, put it in PB but just >put a !db in front of it and it will work? Somehow this seems a little to easy >to me and I think I'm missing something here... A rough example, obviously plucked from something longer but illustrating the technique: ! (prep ds:si /es:di) ! push cx ! mov cx, %BLOCKSIZE ! DB &h0F3 ; rep movsd ! DB &h66 ! DB &h0A5 ! pop cx -- Greg Turgeon *** QwkNews (tm) v2.1 * [TN71] alt.lang.powerbasic <-> POWER_BAS Gateway --- GEcho 1.20/Pro * Origin: Toast House Remote (1:100/560.2) --------------- FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC Ref: FA100006 Date: 05/12/98 From: PETER.WALLER Time: 04:48pm \/To: ALL (Read 1 times) Subj: Re: Com OR Ps2 Mouse From: "Peter.waller" Subject: Re: Com OR Ps2 Mouse Wiebe Zoon wrote in article <3556DC76.9BF2F3A1@student.tn.tudelft.nl>... > Peter.waller wrote: > > > > How Can I write a Program That Will read The Com (or ps2) Mouse and use it > > without it crashing? > > > > Please Help > > Did you try the mouse-routines Bob gave you ??? They are in the > EXAMPLE-subdirectory. ????? Who Is Bob And what is this example dir.?? Pete > *** QwkNews (tm) v2.1 * [TN71] alt.lang.powerbasic <-> POWER_BAS Gateway --- GEcho 1.20/Pro * Origin: Toast House Remote (1:100/560.2) --------------- FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC Ref: FA100007 Date: 05/12/98 From: PETER.WALLER Time: 04:50pm \/To: ALL (Read 1 times) Subj: Re: Com OR Ps2 Mouse From: "Peter.waller" Subject: Re: Com OR Ps2 Mouse Wiebe Zoon wrote in article <3556DC76.9BF2F3A1@student.tn.tudelft.nl>... > Peter.waller wrote: > > > > How Can I write a Program That Will read The Com (or ps2) Mouse and use it > > without it crashing? > > > > Please Help > > Did you try the mouse-routines Bob gave you ??? They are in the > EXAMPLE-subdirectory. ????????? What Is the Example subdirectoruy and who is bob? > *** QwkNews (tm) v2.1 * [TN71] alt.lang.powerbasic <-> POWER_BAS Gateway --- GEcho 1.20/Pro * Origin: Toast House Remote (1:100/560.2) --------------- FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC Ref: FA100008 Date: 05/12/98 From: REINIER ZWITSERLOOT Time: 07:24pm \/To: ALL (Read 1 times) Subj: Re: Com OR Ps2 Mouse From: Reinier Zwitserloot Subject: Re: Com OR Ps2 Mouse 'Bob' is Bob Zale, author of much of PB and founder of Powerbasic. The example directory should have been created when you install PB. It contains... (drums!)... examples! Quite nice ones and very useful. Peter.waller wrote: > > Wiebe Zoon wrote in article > <3556DC76.9BF2F3A1@student.tn.tudelft.nl>... > > Peter.waller wrote: > > > > > > How Can I write a Program That Will read The Com (or ps2) Mouse and use > it > > > without it crashing? > > > > > > Please Help > > > > Did you try the mouse-routines Bob gave you ??? They are in the > > EXAMPLE-subdirectory. > ????????? > What Is the Example subdirectoruy and who is bob? > > -- - Ray Zwitserloot. R.Zwitserloot@antispam.BTInternet.com Change the E-mail address to reply! ---------------------------------------------------- *** QwkNews (tm) v2.1 * [TN71] alt.lang.powerbasic <-> POWER_BAS Gateway --- GEcho 1.20/Pro * Origin: Toast House Remote (1:100/560.2) --------------- FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC Ref: FA100009 Date: 05/13/98 From: REINIER ZWITSERLOOT Time: 12:14am \/To: ALL (Read 1 times) Subj: Re: 3D game engine for PB From: Reinier Zwitserloot Subject: Re: 3D game engine for PB? Dave Navarro wrote: > I'd need more proof than that. Microsoft sales of MASM reached 3 million > copies about 5 years ago. And its reputed that twice that number of people > have pirated TASM. Hee! Using pirated copy counts as indicator of users, tasm would probably win :-P. > > I just went to my favorite computer book store (over 8,000 titles in the > store) and couldn't find a single book on NASM. I found 31 different books on > the shelf for MASM and 9 for TASM. Agreed! One of the problems with NASM is lack of documentation. Fortunately NASM and MASM syntax are very much alike, and it's quite rare to see books cover the MASM 'tricks' early on (such as the red-tape that can't easily be macroed in NASM. ie: .radix, and the macro capabilities which are very different from those of NASM). A small section in the nasm help file does point out the main differences. The main disadvantage is that one of the best books (available online, believe it or not) written as study for assembly, Art of Assembly by Randall Hyde, uses a set of routines that are heavily macro-dependent and very large, and I doubt people would ever convert all that to NASM. NASM is quite new though, and unfortunately new assembler books rarely come out. The last new tutorial (a very small one) did include documents and footnotes on conversion to both MASM and NASM (It assumed use of TASM.) > > I realize that you *really* like NASM and it does seem to me like a pretty > good product, but claiming that it's more popular than MASM and TASM is > stretching things in my opinion. I don't see as to whether it matters, me stretching NASM above the popularity of MASM and TASM, simply because NASM is free it's impossible to measure correctly. However, I would think you agree with me that the user base of NASM is sufficient enough to address the compatibility problem. For a fact (Since i'm programming my own linker at this point) I know it's a very easy change to support both formats. (To outline: If the fixup thread is a 16-bit offset instead of a 32-bit offset, check if the next fixup is a 16-bit segment exactly 2 bytes from the first. If so, eliminate this second fixup thread and assume the first one is a 32-bit offset (the usual). 'cheating' or cause for incompatibility? No, as 16-bit offset with a 16-bit segment 2 bytes down is the same. Similarly it should be easy for NASM to add this capability but according to the author's they'd rather keep it the way it is for some VMS compilers (gee, very old, but okay) which don't support the 32-bit form, *AND* it would require 'red-tape', something that NASM tries to avoid, whereas the linker does not require a user directive to support both forms. (Not to mention I paid $150 for PB and downloaded nASM for free :-P) Thanks for the attention! -- - Ray Zwitserloot. R.Zwitserloot@antispam.BTInternet.com Change the E-mail address to reply!