Subject: file management in assembly...

From: "Marc H" <[email-masked]>
Date: Tue, 11 May 2010 19:44:58 -0000

I am trying to wrap my pea brain around accessing files/devices in assembly and am struggling.  Is there a commented source code available from someone or some place that I could use to get over the hump?

Thanks in advance....

Marc

---

From: "Stuart" <[email-masked]>
Date: Tue, 11 May 2010 20:21:25 -0000

I found Molesworth's intro to assembly language book to have a good description (apart from one typo which may throw you ...). There's a copy at Texin Treasures.

<http://texintreasures.com/shop/product_info.php?products_id=254>

Stuart.

---

From: Marc Hull <[email-masked]>
Date: Tue, 11 May 2010 14:19:49 -0700 (PDT)

Thanks Stuart, I happen to have that book just never thought to look.  Are you gonna let the cat out of the bag about the typo ?

--- On Tue, 5/11/10, Stuart <[email-masked]> wrote:

From: Stuart <[email-masked]>
Subject: [TI994A] Re: file management in assembly...
To: [email-masked]
Date: Tuesday, May 11, 2010, 3:21 PM

  

<http://texintreasur es.com/shop/ product_info. php?products_ id=254>

Stuart.

--- In TI994A@yahoogroups. com, "Marc H" <marc.hull@. ..> wrote:

---

From: "Stuart" <[email-masked]>
Date: Tue, 11 May 2010 21:35:34 -0000

Well if you already have the book and have a pen handy ...

First a clarification: go to page 82 and find the first big paragraph of text. Second line from the bottom of this has the sentence "The pointer needed ... of the file descriptor byte." Insert the word "length" such that it reads "... file descriptor length byte."

There are then two lines of code directly beneath that para. The first line reads "LI R6,PAB+9". Change this to "LI R6,PABADR+9" (it is the address of the PAB in VDP RAM).

Enjoy! When I had my first TI back in my youth I never got the file handling to work in assembly, so it was a joy to see if working a year or two ago with the help of Mr Molesworth!

S.

--- In [email-masked], Marc Hull <marc.hull@...> wrote:
>
> Thanks Stuart, I happen to have that book just never thought to look.Â  Are you gonna let the cat out of the bag about the typo ?
> 
> --- On Tue, 5/11/10, Stuart <ti99@...> wrote:
> 
> From: Stuart <ti99@...>
> Â 
> --- In TI994A@yahoogroups. com, "Marc H" <marc.hull@ ..> wrote:
> 
> >
>

---

From: Marc Hull <[email-masked]>
Date: Tue, 11 May 2010 16:23:02 -0700 (PDT)

before I get too deep and drown I have one more question and caveat that I should probably share...... 

Caveat first...
My application only involves reading the directory of a device and opening/reading/closing 1 type of file 

My questions are....

Can I safely assume that the file descriptor can contain ANY valid storage device (other than cassette which I am not using)  and a path ? ie DSK, SCSI etc.....

Do all the varied disk controllers expect the same PAB or are there variations?

--- On Tue, 5/11/10, Marc Hull <[email-masked]> wrote:

From: Marc Hull <[email-masked]>
Subject: Re: [TI994A] Re: file management in assembly...
To: [email-masked]
Date: Tuesday, May 11, 2010, 4:19 PM

  

--- On Tue, 5/11/10, Stuart <ti99@stuartconner. me.uk> wrote:

From: Stuart <ti99@stuartconner. me.uk>
Subject: [TI994A] Re: file management in assembly...
To: TI994A@yahoogroups. com
Date: Tuesday, May 11, 2010, 3:21 PM

    

Stuart.

--- In TI994A@yahoogroups. com, "Marc H" <marc.hull@. ..> wrote:

---

From: mark wills <[email-masked]>
Date: Wed, 12 May 2010 07:55:16 +0000 (GMT)

INCOMING!!!!!!!!!

Check attachments. Attached is an EA5 loader written in assembly by yours truly. Tursi later turbo charged it, but you don't need that part to understand the file IO. Hopefully you should find this easy to follow. If not, please post questions (SWPB is a better forum for hardcore assembly ;-)

Personally, I find file IO in assembly a royal pain in the a$$. It's 'messy', mainly because of the use of VDP which I don't like.

Mark

----- Original Message ----
> From: Marc H <[email-masked]>
> Sent: Tue, 11 May, 2010 20:44:58
> Subject: [TI994A] file management in assembly...
> 
> I am trying to wrap my pea brain around accessing files/devices in assembly and 
> am struggling.  Is there a commented source code available from someone or 
> some place that I could use to get over the hump?

Thanks in 
> advance....

Marc

------------------------------------

Yahoo! 
> Groups Links

>   
> >http://groups.yahoo.com/group/TI994A/

> href="http://groups.yahoo.com/group/TI994A/join" target=_blank 
> >http://groups.yahoo.com/group/TI994A/join
    (Yahoo! ID 
> required)

> href="mailto:[email-masked]">[email-masked] 
> 
    
> href="mailto:[email-masked]">[email-masked]

> ymailto="mailto:[email-masked]" 
> href="mailto:[email-masked]">[email-masked]

> href="http://docs.yahoo.com/info/terms/" target=_blank 
> >http://docs.yahoo.com/info/terms/

---

From: tursi <[email-masked]>
Date: Wed, 12 May 2010 01:00:43 -0700 (PDT)

> Do all the varied disk controllers expect the same PAB or are there variations?

You're asking a couple of different things here.

Files are trivial. It's a little more work to actually DO the file access, 
but the steps are exactly the same as in BASIC. The 'more work' is just 
building the PAB and finding the device (which is done for you if you use 
DSRLNK).

Of course, parsing the data you read can be tricky. ASCII text is easy, 
but numbers are of course binary.

Every device uses the same PAB, yes. That's the whole point of it, is all 
devices are the same. The fewer assumptions you make about the device you 
are talking to, the better your software will work (and maybe the less we 
can step expecting every new freaking device to emulate a 90k floppy 
drive... ;) )

I can give you a piece of sample code on Sunday if you want one, drop me a 
private note if that's what you want, something to open a file and read a 
record.

Now, you also asked about reading the directory of a device. Well, THAT 
doesn't really have any standards. Since the only official device from TI 
that needed to was the floppy controller, most people copy that, which of 
course limits to 10 characters, etc. Anyway, there are two ways to do it.

Most people just read the File Descriptor Blocks from sector 2 onward on 
the floppy disk, each sector describes one file. For this, they use the 
low level SBRLNK functions to read a sector at a time.

A less used (but probably more official) approach is to open a special 
device that represents the directory, that is "DSK1." (where 'DSK1' is the 
disk device). This must be opened as IF38.

// Record 0 contains:
// - Diskname (an ascii string of upto 10 chars).
// - The number zero.
// - The number of sectors on disk.
// - The number of free sectors on disk.

The rest contain:

// - Filename (an ascii string of upto 10 chars)
// - Filetype: 1=D/F, 2=D/V, 3=I/F, 4=I/V, 5=Prog, 0=end of directory.
//   If the file is protected, this number is negative (-1=D/F, etc).
// - File size in sectors (including the FDR itself).
// - File record length (0 for programs).

---

From: "Beery" <[email-masked]>
Date: Thu, 13 May 2010 17:50:21 -0000

I don't recall, but you might consider looking at Paul Charlton's FastTerm.  I think it had some comments.

Another resource might be one of the TI-Writer or clones.  I am pretty sure the My-Word source is out there, and while it will only run on a Geneve, it's commenting was pretty good as I recall.

Beery

---

From: "Beery" <[email-masked]>
Date: Thu, 13 May 2010 18:03:41 -0000

That's why I do stuff in MDOS for the Geneve.  No VDP to deal with, and it's just configure the pab for whatever you want to do, make the call, and voila, data appears in the buffer area according to your criteria.

Beery

--- In [email-masked], mark wills <markrobertwills@...> wrote:
> > From: Marc H <marc.hull@...>

---

From: fdos <[email-masked]>
Date: Thu, 13 May 2010 11:17:58 -0700

I prefer MDOS also, but there just aren't many of us around anymore.  I 
would much prefer to continue developing Forth+ 2.0 than X4th99, but who 
would use it besides myself?  I'm not even sure there will be many 
takers once I do get X4th99 out as most potential users will have gotten 
use to TurboForth which is Forth83 with some ANS compliance while X4th99 
is Fig Forth that includes a Forth83 binary code library (some Forth83 
compliance).

I suspect thee will be a few who will need the extra memory provided by 
the minimal X4th99 requirement of 256K of AMS/SAMS (1MB highly 
desirable).  We will see.

Bill S

Beery wrote:
>  
> 
> That's why I do stuff in MDOS for the Geneve. No VDP to deal with, and 
> it's just configure the pab for whatever you want to do, make the call, 
> and voila, data appears in the buffer area according to your criteria.
> 
> Beery
> 
> --- In [email-masked] <mailto:TI994A%40yahoogroups.com>, mark 
> wills <markrobertwills@...> wrote:
>  >
>  > INCOMING!!!!!!!!!
>  >
>  > Check attachments. Attached is an EA5 loader written in assembly by 
> yours truly. Tursi later turbo charged it, but you don't need that part 
> to understand the file IO. Hopefully you should find this easy to 
> follow. If not, please post questions (SWPB is a better forum for 
> hardcore assembly ;-)
>  >
>  > Personally, I find file IO in assembly a royal pain in the a$$. It's 
> 'messy', mainly because of the use of VDP which I don't like.
>  >
>  > Mark
>  >
>  >
>  >
>  > > To: [email-masked] <mailto:TI994A%40yahoogroups.com>
> <http://groups.yahoo.com/group/TI994A/>
>  >
>  >
>  > > href="http://groups.yahoo.com/group/TI994A/join 
> <http://groups.yahoo.com/group/TI994A/join>" target=_blank
> <http://groups.yahoo.com/group/TI994A/join>
>  > (Yahoo! ID
>  > > required)
>  >
>  > > href="mailto:[email-masked] 
> <mailto:TI994A-digest%40yahoogroups.com>">[email-masked] 
> <mailto:TI994A-digest%40yahoogroups.com>
>  > >
>  >
>  > > href="mailto:[email-masked] 
> <mailto:TI994A-fullfeatured%40yahoogroups.com>">[email-masked] 
> <mailto:TI994A-fullfeatured%40yahoogroups.com>
>  >
>  > > ymailto="mailto:[email-masked] 
> <mailto:TI994A-unsubscribe%40yahoogroups.com>"
>  > > href="mailto:[email-masked] 
> <mailto:TI994A-unsubscribe%40yahoogroups.com>">[email-masked] 
> <mailto:TI994A-unsubscribe%40yahoogroups.com>
>  >
>  > > href="http://docs.yahoo.com/info/terms/ 
> <http://docs.yahoo.com/info/terms/>" target=_blank
>  > > >http://docs.yahoo.com/info/terms/ <http://docs.yahoo.com/info/terms/>
>  >
> 
>