Announcement

Collapse
No announcement yet.

ROM BASIC, yes you can !

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Steve Hutchesson
    started a topic ROM BASIC, yes you can !

    ROM BASIC, yes you can !

    Flexibility was always the key with BASIC as a language, for any who are old enough, the way the world was in 1980.
    Code:
    000: FUNCTION PBMAIN AS LONG
    001: ? "HOW TO WRITE ROM-BASIC USING POWERBASIC"
    002: INPUT "ENTER A LOOP COUNT NUMBER > ",A$
    003: X& = VAL(A$)
    004: L& = 1
    005: ? STR$(L&)+" ";
    006: L& = L& + 1
    007: IF L& <= X& THEN GOTO 005
    008: ? "PRESS ANY KEY TO EXIT ...."
    009: WAITKEY$
    010: END FUNCTION
    I confess I have not written this stuff since about 1990 when a lady I knew had a twin floppy IBM PC to use MultiMate. If you have not written this style for a long time, its more work than you think but it makes the point that PowerBASIC supports a very wide range of programming styles.

  • Steve Hutchesson
    replied
    Some thing keep returning back into fashion, back in the middle 90s everything was going to turn into a UI and ultra high level languages were going to take over the world but the result was a big slow sloppy pile of trash that did not do the job. Ever faster hardware covered up the junk for a while but eventually the push for visual garbage started to run out of puff. As the internet era started to kick in we started to see geeks using a Unix console as there was little point to using a UI for just about pure technical data. Even in the movie industry you saw stuff like the Matrix where all the smart stuff was bashed away at a console.(bashed was a pun on the born again shell) Various television series that have a resident geek in the cast also show console use so if you really want to look hip and up to date you make the geeky stuff for the console.

    Now given that the vast majority of PC users are Windows Icon Mouse Pointers, UI application will have their place as the majority form of consumer software but when it comes to technical tasks, there are so many things that are done far better using a console. With Win 10 64 bit, the console actually improved a lot and not only will it run properly at full screen but it seems to be a fair bit faster than even the version in Win7 64. You can actually shut down explorer and use the console as the interface and from memory there are Windows server version where you can do just that.

    Being able to stream sequences of console apps together with a batch file gives you the capacity to do very complicated things and while you must know what you are doing with the binaries and the batch file, you can make very complex tasks available by calling one batch file.




    Leave a comment:


  • Stuart McLachlan
    replied
    Batch file? OK, the current buzz word is "script file", but us "old timers" still call then batch files, even though we are likely to use an extension other than ".bat".

    So: me too!

    And there are a lot of us. I guess that's why MS have just recently issued the PDF linked in another thread here.

    "Use this PDF to find the documentation resources and other technical information that you need to learn about the
    command shell, and to automate command-line tasks by using scripts or scripting tools."


    https://forum.powerbasic.com/forum/u...-documentation

    Leave a comment:


  • Brice Manuel
    replied
    After all, who writes 'batch/command' file applications ever since the calendar rolled over to the twenty-first century?
    Literally anybody doing network/system administration. What is that like 95% of the programming jobs today? It is why Windows 10 now has native support for Linux built in. Admins no longer need to buy Macbooks or Linux laptops for normal sysadmin work and run Windows virtualized. Now Windows 10 can actually be used for and serve most purposes needed.

    Leave a comment:


  • Brice Manuel
    replied
    I do.
    I do, too. And will always call them batch files, just as I always use "directories" and not the Apple name "folders" which MS introduced when they hired away Apple's programmers to design Windows 95 and not only implemented an Apple clone down to the icons used, but also the terminology used.

    Leave a comment:


  • Kerry Farmer
    replied
    Originally posted by Michael Mattias View Post


    After all, who writes 'batch/command' file applications ever since the calendar rolled over to the twenty-first century?

    MCM
    Me - I do.

    Careful Michael. Do not judge the usefulness of modern batch files (command files, wizards) using the old standards and terminology and techniques. PBCC is ideally placed to develop quite useful techniques. And I am doing that as we speak.

    Leave a comment:


  • Steve Hutchesson
    replied


    > After all, who writes 'batch/command' file applications ever since the calendar rolled over to the twenty-first century?

    I do. I build PB, 32 and 64 bit MASM all from the command line using batch files. You know that funny looking old thing that some people actually know how to use, the console. Actually it achieves full isolation from the GPL software via the batch file and is itself a 64 bit dialog interface written in MASM. The GPL app it runs is "ffmpeg" and if you have some grasp of the range of options in "ffmpeg" you will understand why it bloated out to just under 20k complete with an icon, manifest and version control block.

    Leave a comment:


  • Michael Mattias
    replied
    Recently I wrote an nterface ...... my interface writes and runs a batch file ..
    I'd be real careful about admitting you recently wrote an application which relies on a batch (now called 'command' ) file.

    Some of us might start thinking you wrote this twenty years ago or more and/or have an 'enhanced' sense of "recent."

    After all, who writes 'batch/command' file applications ever since the calendar rolled over to the twenty-first century?

    MCM

    Leave a comment:


  • Brice Manuel
    replied
    Steve Hutchesson

    Many years back, I used QB64 in the classroom for teaching BASIC. It wasn't the best, but also not the worst. At that time, the author had put together a raycasting engine which was actually more advanced than what Wallenstein 3D used and it provided playable speeds which is probably the most taxing thing written in it at that time, as that was all software rendered.

    If you miss the old QB45 editor, Ken Silverman wrote a windows editor that is very similar to DOS Edit and QB's editor:

    http://www.advsys.net/ken/util/kc.exe
    http://www.advsys.net/ken/util/kc_guide.txt


    I agree with you about FASM. There are reasons so many indie languages use it.


    Leave a comment:


  • Steve Hutchesson
    replied
    Brice,

    It had to be something like that, I noticed that the package contained mingw binaries but I am surprised by how poor the actual performance is. Recently I wrote an interface for a GPL app that I use with video but my interface writes and runs a batch file that runs the GPL software so there is no way that GPL can access or control my interface. What I did find funny was still being familiar with how the old QB45 editor worked. I think the last time I used it was back in the early 1990s and while it was not as sophisticated as the PWB (Programmers Work Bench) that came with MASM, PDS7 Basic or C, it was well thought out at the time.

    Its a shame that the authors did not go another route and use Tomas Grystar's FASM as the asm back end as they would have been free of GPL and made a better package.

    Leave a comment:


  • Michael Mattias
    replied
    Someday I'll understand and master sub- and super-classing controls.
    It's pretty straightforward if you think of it as "I want a control which acts just like a <insert type of control> EXCEPT FOR. <some behavior>."

    subclassing = Modify standard behavior of an individual control after it is created.
    superclass = create registered Window class as copy of "just like' base control with desired modifications BEFORE controls are created.

    You'd usually create a superclass if you have multiple controls to create with the modified behavior., although you can accomplish the same thing using subclassing simply by sharing the subclass procedure.

    MCM
    .

    Leave a comment:


  • Brice Manuel
    replied
    Originally posted by Steve Hutchesson View Post
    Build was as slow as a wet week and it built at 1,460,736 bytes and ran as slow as a wet week. I will probably stick to using PBCC.
    QB64 used to be a halfway-decent product, but several years back it ran afoul of the Open Source Gestapo and some radical changes (not for the better) had to be made to comply with the draconian closed nature of open source.

    Leave a comment:


  • Steve Hutchesson
    replied
    Hi Stuart,

    > a. "clear maintainable source code"

    Problem is its just a statement of "somebodies" politically correct. If you are a GOTO line numbered person you have an entirely different view on the former statement. Now it is the notion of range of capacity that we differ on, I have no problem with PB instrinsics and use many of them but I would hate to have to be restricted to that range when you can do so much more. Pirate your way through the MSVCRT functions and while they are nothing exciting, you get them for nothing. Then there is the ever expanding Windows API that is the base for the entire interaction with the OS as there is no other way.

    When you have a basic compiler written by an expert in assembler programming, you have capacities that appear to be the method by which a future PB will be written in and this includes an Intel notation inline assembler, then you have the FASTPROC procedures that have no overhead at all which you write your own code in then there is the block escapes for asm "PREFIX "!" which makes it even easier to directly port inline VC, asm dumps and of course MASM code directly into PB.

    I am not willing to give up that range for "political correctness" and would not advocate anyone else doing it either. The "if it works, do it" approach is one tuned back into the eye of the beholder, write it, let her rip and if it does the job, who cares what the "politically correct" think.

    Michael,

    > "It's not the paintbrush, it's the artist,"

    I have never had any problem with this view, even though its not exactly how I approach the subject. I am very much out at the forge making an even harder axe and when you have it up and going you master how to sharpen it. To the programmer it translates to write the correct algorithm, make sure its robust and economical then kick the guts out of it to make it faster. On a one off level its often a waste of time but for re-usable code its the "one true way" as it may get use between billions to trillions of times.

    Its a theory of cost based on usage. If it only gets used a few times, write it in a visual garbage generator, if it gets use a few thousand times, write it with the normal intrinsics you have available, if it gets used some millions of times, start to look for highly efficient code but if it gets battered billions of times, the unit cost gets so low that you can afford to spend some extra time to extract those extra few pico seconds out of it.

    Leave a comment:


  • Stuart McLachlan
    replied
    Agreed, there is no "politically correct" technique.

    However, there is both
    a. "clear maintainable source code" and
    b. "obscure, complex, convoluted, difficult to maintain source code".

    Writing the former has nothing to do with political correctness.

    PB provides many features including a broad range of intrinsic functions and statements, built in equates etc,etc to achieve the former and it is a good idea to learn and use as many of them as possible.
    Eschewing whole categories of them in favour of more complex constructs is seldom the optimal solution to a programming problem.


    (Using those capabilities also does not have any connection to an old kids' TV program that a certain poster seems obsessed with.)

    Leave a comment:


  • Bud Durland
    replied
    Originally posted by Kerry Farmer View Post
    I confess that I am still changing from a basic Basic programmer to a real PB programmer after 15 years!
    +1 for that. Someday I'll understand and master sub- and super-classing controls.

    Leave a comment:


  • Michael Mattias
    replied
    !!!!
    The topic addresses a simple problem for many older BASIC programmers, there is no "politically correct" technique to write PB, you can produce the binary any way you like if you can get it to work and if it does the job you want.
    {gasp} You don't mean, ahem, "It's not the paintbrush, it's the artist," do you? I'm flattered!

    MCM

    Leave a comment:


  • Steve Hutchesson
    replied
    This is purely for those with a sense of humour. I downloaded QB64 and built a simple program with it.
    Code:
    PRINT "Arrrrgh, G'day !"
    var& = 1
    DO
        PRINT STR$(var&) + " ";
        var& = var& + 1
    LOOP WHILE var& <= 100
    PRINT "Thats all folks"
    Build was as slow as a wet week and it built at 1,460,736 bytes and ran as slow as a wet week. I will probably stick to using PBCC.

    Leave a comment:


  • Steve Hutchesson
    replied
    As the three examples are written in PowerBASIC's PBCC, the punch line is "emulation". If you wanted the real thing[tm] you would warm up your 1980 IBM PC or your MS-DOS 5.0 box to run the earlier forms of BASIC. There was madness in the method, the three examples do much the same thing, build at much the same size yet are 3 entirely different styles of writing BASIC code.

    The topic addresses a simple problem for many older BASIC programmers, there is no "politically correct" technique to write PB, you can produce the binary any way you like if you can get it to work and if it does the job you want. None of the example may be your style or mine but free form programming is one of the hallmarks of PowerBASIC and there is no "One True Way", there are many ways to write code, these have just been a few simple older ones.

    Leave a comment:


  • Michael Mattias
    replied
    but what styles you can write in the latest PBCC version
    Hmm, if your code is intended to be PB/CC code... there are no "mysteries" and WAITKEY$ is perfectly valid.

    (Although your post did manage to confuse me!)

    Otherwise.... another issue might be the use of a variable with a "&" type suffix. IIRC LONG integers were never supported by ROM or other Interpreted 16-bit BASICs; you had your choice of integer (%), single precision (!) and string ($)... and no more.

    MCM

    Leave a comment:


  • Stuart McLachlan
    replied
    Originally posted by Michael Mattias View Post
    In post #1, line 9 your code is
    Code:
    009: WAITKEY$
    I am not aware of any ROM-based or other interpreted BASIC (e.g., GW-Basic, QBasic) which supported a 'WAITKEY$' statement... especially with the variable type specifier '$' suffixed.

    MCM
    Yep, it was a long time before there was anything other than INPUT or an INKEY$ loop to pause a program.

    Leave a comment:

Working...
X