--------------- FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC Ref: F5I00011 Date: 05/10/98 From: SCOTT VETTER Time: 08:29am \/To: ALL (Read 1 times) Subj: Re: PB to C? From: Scott Vetter Subject: Re: PB to C? Brian McLaughlin wrote: > > Scott Vetter writes: > |> Since PB doesn't have native OS/2 support, is there a program which > |> will take PB (or any old basic) and create "C" program source? > > There is a shareware product, called OmniBasic, that takes > BASIC source and outputs ANSI C code that can be compiled > using a GNU-licensed C compiler that was ported to OS/2 > from the UNIX world (I forget the name right now of the > ported compiler). Since it's ANSI C, I presume that any > commercial C compiler for OS/2 would accept the code, too. > > The "catch" is that OmniBasic accepts a very restricted > set of BASIC syntax compared to PB, so your PB code might > require a LOT of tweaking, and probably some major work-arounds > to make it OmniBasic compliant. Then again, if it's simple > code, maybe not. > > Liberty BASIC also has an OS/2 version of its compiler. > It is a beta version, and can be d/l from the Liberty > BASIC home page. It doesn't produce C code, though. > Thanks for the info. I'll check them out. If the Basic to C translater output or the input needs some work, I'll do it. I'm tired of waitting years for Power Basic to come out with an OS/2 version... Scott *** 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: F5I00012 Date: 05/10/98 From: REINIER ZWITSERLOOT Time: 02:11pm \/To: ALL (Read 1 times) Subj: Re: 3D game engine for PB From: Reinier Zwitserloot Subject: Re: 3D game engine for PB? That's very simple. If you want to insert fairly small amounts of assembly verbatim in PB, you either use the inline assembler, or if that's not sufficient you use NASM. Generate a straight binary (Don't think TASM or MASM can do that), and convert it to !db statements which you then include. (You do that using INLN2ASM). Bit of hassle? Yes, and I thought it could be made a bit easier. http://www.geocities.com/siliconvalley/lab/1990/ download PBPLUS and make sure you have a copy of NASM.EXE in your pb directory. Just put $PTNASM in your code, type your assembly (Any assembly at all) and end with $PTPBAS. Make sure you run your code through PBPLUS and it'll do the work for you. On the debate: It's technically speaking possible to emulate MASM syntax using macros in NASM. Excepting a few red-tapers like .radix and a couple of others, rarely used. It's just that no one has done this yet for (to me) obvious reasons. The NASM syntax is based on the MASM syntax, but has removed a couple of ideosyncracies and has a different macro processor. NB: I agree a copy of MASM is on more drivers/shelves than either TASM or NASM. I'm talking about hours of use though. Guy Macon wrote: > > In article <355512e6.4693228@news.meol.net>, gturgeon@meol.mass.edu (Gregoire Turgeon) wrote: > > > >On 8 May 1998 15:32:28 GMT, guymacon@deltanet.com (Guy Macon) wrote: > > > >> > >>My situation is that I do everything in PBasic (for the Basic Stamp) or > >>PowerBasic (for the PC) with an ocasional dive into a short loop using > >>inline assembler when PB doesn't do exactly what I want. All of this > >>is professional (programming robotics and CD/DVD palyers) with no limit > >>on money spent on hardware or software. Would you still recomend TASM > >>for my situation? > > > >If you're a professional programmer, you appreciate certain qualities > >that obviously have limited appeal in some circles. One of these > >qualities involves working within accepted standards. I've used TASM > >for 386-specific code under PowerBASIC, all the way back to the 3.0a > >release. The TASM/PB interface, although not seamless, has always > >been manageable for my purposes (mainly VGA programming, encryption, > >and compression). Sample code also exists. > > > >Debate over assemblers often becomes rather amusing. Paying your > >bills never is. I've experimented with the freeware NASM and am > >delighted that it exists. It offers several interesting innovations. > >Its syntax, etc. also deviate widely from the standard created by, and > >still set by, MASM. Like it or not, if you're writing for an > >increasingly Windows world, Microsoft tools set the standards. Other > >tool makers conform, willingly or unwillingly, or they remain minor > >players. > > > >Of course, if Microsoft operating systems mean little to your income > >as a programmer, then many things are possible. And sometimes lots > >more fun, too. > > > >MASM is available not only retail but also through the (big dollar) > >Microsoft Developer Network professional subscription. That of course > >doesn't necessarily mean that all subscribers actually prefer it or > >even use it, but if they look for an alternative to MASM, such people > >rarely rely on impressions and anecdotal evidence when weighing > >possibilities. > > I have a subscription to the Developer Network, but the C programmers > in my dept. use it a lot more than I do. I am a hardware expert, and > I do simple coding only (moving a robot arm, testing a CD for flatness, > that sort of thing). I find PB to be just about perfect for this > sort of work. My question is what to do when I need to put a little > bit of assembly language code in a PB program. Is my best choice to > just ignore all assemblers and do it in inline code from the PB > environment? That's what I do now, despite access to any assembler > I want to use. Would I be better off using a "real" assembler? > Remember, we are talking about very small and tight Assembly Language > loops embedded in a PowerBasic program. -- - 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: F5I00013 Date: 05/10/98 From: KROGG Time: 06:10pm \/To: ALL (Read 1 times) Subj: bwsb<--Does anyone use th From: Krogg Subject: bwsb<--Does anyone use this?Need help. Does anyone use BWSB120 with powerbasic and can show me how to use it. Any pointers to help or postings welcome.It looks easy to use but i dont know where to start. -- ___________ 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: F5I00014 Date: 05/11/98 From: GREGOIRE TURGEON Time: 07:18am \/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 10 May 1998 06:05:35 GMT, guymacon@deltanet.com (Guy Macon) wrote: >I have a subscription to the Developer Network, but the C programmers >in my dept. use it a lot more than I do. I am a hardware expert, and >I do simple coding only (moving a robot arm, testing a CD for flatness, >that sort of thing). I find PB to be just about perfect for this >sort of work. My question is what to do when I need to put a little >bit of assembly language code in a PB program. Is my best choice to >just ignore all assemblers and do it in inline code from the PB >environment? That's what I do now, despite access to any assembler >I want to use. Would I be better off using a "real" assembler? >Remember, we are talking about very small and tight Assembly Language >loops embedded in a PowerBasic program. I've found only two compelling reasons for bringing in $LINKed assembler code. First, if a substantial sequence of 32-bit instructions is required, then linking an OBJ is worth the overhead of the call to the routine. PB also places OBJ code in a separate code segment, which adds to overhead. In some cases, though, access to 32-bit registers is well worth the additional complexity. If only a few 386+ instructions are required, the inline assembler works just fine. In such cases, I write the ASM for TASM, assemble to generate a listing file, then just plug the listing file's opcode entries into the PB inline assembler code. This is a larger-scale example of the same thing that Bob Zale suggested. The other case when using a separate assembler has proven valuable involves the macro capability of a full-feature assembler. Converting code from C or Pascal or BASIC to assembler often is easier if you can "add total, next sum" instead of adding ax to dx and trying to keep straight the contents of each. PowerBASIC's inline assembler can do much that's not always apparent. To cite only one example, a near routine is easy to specify simply by using "! call near Target" and using "! retn" to return from Target. 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. -- 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: F5I00015 Date: 05/11/98 From: WIEBE ZOON Time: 01:09pm \/To: ALL (Read 1 times) Subj: Re: Com OR Ps2 Mouse From: Wiebe Zoon Subject: Re: Com OR Ps2 Mouse 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. *** 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: F5I00016 Date: 05/13/98 From: FRANK MASINGILL Time: 05:33pm \/To: REINIER ZWITSERLOOT (Read 1 times) Subj: pb/dll RZ> Powerbasic is NOT shareware, and NOT freeware. There's a demo, though. RZ> http://www.powerbasic.com/, demos section, or ftp.powerbasic.com, look RZ> for TRYPB3.ZIP It's one of the sorriest demos I've ever seen. I've seen MANY that were MUCH better in other languages. The TRYPB3 IDE will not even allow the loading of a file written in another editor. The thing also has NO real tutorial that would encourage a novice to want to learn it. If you're already an expert programmer and want to waste the time to copy your code into the thing I guess one would go for it. I was sorry I wasted time downloading it. Sincerely, Frank --- PPoint 2.05 * Origin: FMasingill@aol.com or frankmas@juno.com (1:396/45.12) --------------- FIDO MESSAGE AREA==> TOPIC: 214 POWER BASIC Ref: FA100000 Date: 05/11/98 From: BRIANSTER Time: 02:17pm \/To: ALL (Read 1 times) Subj: Re: 3D game engine for PB From: brianster@aol.com (Brianster) Subject: Re: 3D game engine for PB? 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 orks.) But I'm really confused about what instruction PB's inline can handle. On ne 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 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 orrectly, 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... Brian *** 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: FA100001 Date: 05/11/98 From: REINIER ZWITSERLOOT Time: 04:29pm \/To: ALL (Read 1 times) Subj: Re: 3D game engine for PB From: Reinier Zwitserloot Subject: Re: 3D game engine for PB? Take an assembler that doesn't require the hassle of linking just to produce straight binary output (stuff that'll directly run) and compile this: CLC ;Use NASM, -fbin, easiest. and inspect the file. CLC (Clear Carry flag) translates directly to: CHR$(0F8h). In other words, the file will be 1 byte long, containing the byte 0F8h, which is what CLC really is. Every single opcode can be translated like this, though some are a bit longer, up to a max of 7 bytes (that's only for some newer MMX or pentium instructions, 80486 and lower is up to 5, max.) dB is not a real opcode but causes the assembler to insert a byte value straight in. so, 1. CLC 2. dB 0F8h (in PB: !dB &hF8) statements 1 and 2 are *exactly* the same. However, looking up all those codes gets rather annoying. So, what you could do, is write a program that takes the assembly statements, saves them to a temporary file, gets an assembler to compile the code straight binary, read the generated binary file, and insert all that back into the PB program as !db statements, and send THAT on to PBC which will compile it just fine. That's just what PBPLUS does. so, while you can't actually use !LEAVE (a 286 opcode) in the PB/inline system, you CAN do !db &hC9 which is the same thing as the LEAVE opcode. PBPLUS takes care of the translating LEAVE to !db &hC9, and uses NASM to accomplish this. 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 -- - 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)