Amiga.org

Amiga computer related discussion => General chat about Amiga topics => Topic started by: the777 on January 04, 2025, 12:08:17 AM

Title: can you load a file into memory in amigabasic or in amigados?
Post by: the777 on January 04, 2025, 12:08:17 AM
so you can look at the ascii of the file... . so not actually run the file but put it somewhere in memory so i can take a look at the ascii, hex, decimal, disassembly, etc...
Title: Re: can you load a file into memory in amigabasic or in amigados?
Post by: TribbleSmasher on January 04, 2025, 01:06:32 AM
Why not use a hex editor instead, or Directory Opus?

why does it need to be Amiga Basic or "amigados"?
Title: Re: can you load a file into memory in amigabasic or in amigados?
Post by: the777 on January 04, 2025, 01:41:51 AM
deleted
Title: Re: can you load a file into memory in amigabasic or in amigados?
Post by: the777 on January 04, 2025, 01:43:33 AM
because i want to see if the amiga could do it out of the box
Title: Re: can you load a file into memory in amigabasic or in amigados?
Post by: AmigaPete on January 04, 2025, 01:54:29 AM
Copy the file to RAM: then open with Ed?
Title: Re: can you load a file into memory in amigabasic or in amigados?
Post by: the777 on January 04, 2025, 10:48:10 AM
Copy the file to RAM: then open with Ed?

the idea is to use basic at some point to turn the decimal into colored dots to represent whats on the disk or file
Title: Re: can you load a file into memory in amigabasic or in amigados?
Post by: polyp2000 on January 04, 2025, 12:36:41 PM
"can you load a file into memory in amigabasic or in amigados?"

both of those things would be without purpose if they were unable to perform that function.
What a ridiculous question.
Title: Re: can you load a file into memory in amigabasic or in amigados?
Post by: the777 on January 05, 2025, 10:53:00 AM
deleted
Title: Re: can you load a file into memory in amigabasic or in amigados?
Post by: the777 on January 05, 2025, 10:54:16 AM
"can you load a file into memory in amigabasic or in amigados?"

both of those things would be without purpose if they were unable to perform that function.
What a ridiculous question.

the idea it to put the code into ram, so it can be read in ascii, hex, decimal, etc. not loaded into basic as a program, etc.
Title: Re: can you load a file into memory in amigabasic or in amigados?
Post by: ZXDunny on January 05, 2025, 02:29:20 PM
The answer is yes. Yes you can.
Title: Re: can you load a file into memory in amigabasic or in amigados?
Post by: Boing-ball on January 05, 2025, 03:23:58 PM
So the poster has asked a valid question. Yet it appears the Sheldon’s have appeared to take the p!
Come on guys if you know the answer to the question at least properly answer it…
I don’t know the answer, so enlighten us….

Also this poster has just joined. What a welcome! 🙄
Title: Re: can you load a file into memory in amigabasic or in amigados?
Post by: nbache on January 05, 2025, 06:02:30 PM
One problem is the lack of information given by the OP.

There's no such thing as "a file" - at least not in any useful manner.

He needs to specify which kind of file it is and what sort of content he expects to be able to look for in the file. Then maybe more useful information could be given.

Best regards,

Niels
Title: Re: can you load a file into memory in amigabasic or in amigados?
Post by: the777 on January 06, 2025, 12:35:46 PM
One problem is the lack of information given by the OP.

There's no such thing as "a file" - at least not in any useful manner.

He needs to specify which kind of file it is and what sort of content he expects to be able to look for in the file. Then maybe more useful information could be given.

Best regards,

Niels

i need it to read the sectors of a disk. i want to see what is in each sector and represent it as decimal numbers. im not looking for anything particular in the code. that information could be used to draw a map of the disk in color or monochrome

ive used amos to read the data inside a file and draw a color map of it but now i want to read the sectors directly

i know there is a trackdisk extension for amos but the instructions arent very good after translating from french

and i know there is an undocumented trackdisk command for blitz basic but cant find any instructions for it
Title: Re: can you load a file into memory in amigabasic or in amigados?
Post by: Boing-ball on January 06, 2025, 01:11:00 PM
Good description from the Op.

Welcome to Amiga.org 👍🏻

Title: Re: can you load a file into memory in amigabasic or in amigados?
Post by: nbache on January 06, 2025, 01:42:27 PM
Yes, much better explanation, thanks.

So when you read the disk tracks directly, it's not really a file either, but of course those data that you read can be written into a file, and from there on it looks like you know what to do.

I'm not at all familiar with things like Amos or Blitz, but hopefully someone else can help more there.

Just be aware that when you read the raw data from the disk, you may often end up with chunks of data belonging to separate files, as they will often have been written to the disk interleaved with each other.

But if your aim is more or less to produce some "art" out of the data, that shouldn't be important to you, I guess.

Best regards,

Niels
Title: Re: can you load a file into memory in amigabasic or in amigados?
Post by: kolla on January 07, 2025, 06:57:53 AM
https://aminet.net/package/util/sys/Dev-Handler
Title: Re: can you load a file into memory in amigabasic or in amigados?
Post by: the777 on January 07, 2025, 11:55:05 AM
https://aminet.net/package/util/sys/Dev-Handler

whats that? does it work with any basic interpreter?
Title: Re: can you load a file into memory in amigabasic or in amigados?
Post by: kolla on January 09, 2025, 11:05:52 AM
whats that? does it work with any basic interpreter?

It's what it says in the readme...
"The DEV-Handler allows easy access to raw sectors of an exec type device under the dos.library environment."

It means you can access block devices, such as floppy drives, hard drives and partitions, as if they are files, straight from DOS.

Can your basic interpreter read files? If yes, then it can also read disks and partitions.

For example, you can load a raw image of a floppy disk into your basic interpreter simply by reading in the file DEV:DF0 (or if you prefer, DEV:trackdisk.device/0)
Title: Re: can you load a file into memory in amigabasic or in amigados?
Post by: nbache on January 09, 2025, 11:49:53 AM
@the777

All once the Dev-handler has been installed and is active, or course (just trying to help avoid any misunderstandings).

The Dev-handler, when active, is what does the magic to create a "DEV:" pseudo-device, under which your disktracks appear as files.

At least thats' the main gist of it. But do read the readme and other docs.

(Never tried it myself, but looks useful and simple if you need it).

Best regards,

Niels