Shop OBEX P1 Docs P2 Docs Learn Events
How to put old binary data file from DOS in spin? — Parallax Forums

How to put old binary data file from DOS in spin?

VIRANDVIRAND Posts: 656
edited 2009-09-11 15:29 in Propeller 1
Good question for the 8-bit CPU emulator programmers:

I tried something like this, wondering if my biggest problem would be finding the data.
(as in, would "stuff" have the value of the address of the first byte?)

OBJ
stuff = "stuff.bin"

But I got an "unknown character error in stuff.bin" message.

Nothing else is obvious as a potential "INCLUDE".

It would seem silly to write a QBASIC program that generates a DAT section with a lookup table of longs from it,
and cut and paste that into my program like that.
How do you guys do it "the EASY way" especially if you don't have a DOS machine?

How do I get the binary data from the file into the hubram or eeprom and find the first byte of it with my spin program?

Comments

  • heaterheater Posts: 3,370
    edited 2009-09-11 08:33
    Put it into a "file" statement in a DAT section.

    This is how I get a Z80 boot ROM image from a file:

    DAT
        rom_z80       file "ZIBOOT.COM"
    
    



    The you can read the bytes in Spin

        firstbyte := BYTE[noparse][[/noparse]@rom_z80]
    
        otherbyte := BYTE[noparse][[/noparse]@rom_z80 + someoffset]
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.

    Post Edited (heater) : 9/11/2009 8:40:11 AM GMT
  • VIRANDVIRAND Posts: 656
    edited 2009-09-11 12:02
    OH! Ok thanks. I would never have thought of DAT ... label file "filename"
    Never saw it before and probably wouldn't unless I read all your source code.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-09-11 13:19
    I'd love to hear more about this project your working on, based on what you are doing it sounds interesting..

    BTW, What OS are you using to run QBASIC? Being a 16bit application it always has the tendency
    to push the CPU speed to a solid 100% making it unusable under XP. Did you find a way around
    this issue?

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Visit the: The Propeller Pages @ Warranty Void.
  • Agent420Agent420 Posts: 439
    edited 2009-09-11 13:27
    > Did you find a way around this issue?

    Fwiw, we have several legacy apps with similar issues (including Quick Basic), and they run fine·in a Win98 MS virtual pc envirnment.· Vpc is free from MS, but you will need a license for installing 98.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • heaterheater Posts: 3,370
    edited 2009-09-11 13:30
    What happens if you run some version of Windows in a virtual machine under XP and run QBASIC and such there?

    From time to time I use VirtualBox from Sun. Its free. Very easy to set up and use.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • RevAaronRevAaron Posts: 30
    edited 2009-09-11 15:29
    While running an emulated 95/98 is fine, I prefer an easier and more lightweight approach- running apps like that in DOSBox when on another x86 machine, or within a real DOS image in an emulator like qemu.
Sign In or Register to comment.