Subject: Where to start ?

From: "benjaminmaggi" <benjaminmaggi@...>
Date: Sat, 11 Mar 2006 22:11:52 -0000

I've brought MailStation model DET1 with the hope to start puting my
own programs in it, but i dont know where to start, what cable
conections i need to transfer the programs and data, how to show
hidden menues, or what programs do i need to send and compile my
programs for the mcu.

---

From: "Cyrano Jones" <cyranojones_lalp@...>
Date: Sun, 12 Mar 2006 11:29:30 -0000

--- "benjaminmaggi" <benjaminmaggi@...> wrote:

> own programs in it, but i dont know where to start, 

Mailbug is a program I wrote that will let you load & run
your own code, in either the mailstation flash or ram.

http://groups.yahoo.com/group/mailstation/files/Mailbug/mailbug_0.0.3/

> what cable conections i need to transfer the programs and data, 

A parallel-laplink cable.

> how to show hidden menues, 

On the older DET1 models, you power up while holding
down <fn><sh><t> until you see the test mode menu.

You don't need this menu to install and use mailbug
version 0.0.3.  

Installing sboot.rom (required with mailbug 0.0.3) will 
wipe out most of the original firmware in your mailstation.
If you would like to keep your original firmware intact,
you might want to wait for version 0.0.4 (hopefully
ready in just a few more days).

> or what programs do i need to send and compile my
> programs for the mcu.

There is no compiler yet.  Can you program in z80 assembler?  

A free cross-assembler (as80) is in the file area, under mailbug
directory.  There is also a "hello world" example.

--CJ

---

From: "John R. Hogerhuis" <jhoger@...>
Date: Sun, 12 Mar 2006 09:33:04 -0800

> directory.  There is also a "hello world" example.

Well there are lots of C and Pascal compilers for Z80. Most of them need
to run under a CP/M emulator and target a CP/M environment, but whether
generated code is dependent on the environment is usually a function of
the nature of the code itself, not the compiler.

There's also sdcc which comes with full source code.
http://sdcc.sourceforge.net/

To my knowledge no one has used these with Mailstation yet. If you want
to generate short swaths of code I think you wouldn't have to do
anything special. If you want to use the standard library they provide,
you'll need to modify them so that they use the built in I/O routines or
you need to write your own i/o routines.

-- John.

---

From: "benjaminmaggi" <benjaminmaggi@...>
Date: Sun, 12 Mar 2006 18:52:58 -0000

--- In [email-masked], "Cyrano Jones"
<cyranojones_lalp@...> wrote:
>
> --- "benjaminmaggi" <benjaminmaggi@> wrote:
> 

Thanks ! 
I've used parallax 8051 assembler to make my pic programs in the past
so im going to see if AS80 works for me, im not shure about the C or
pascal compilers.
So i hook up my laplink cable, then load mbug (in msdos) and then i
power on my DTE1, im i right thats the procedure ?

---

From: "Cyrano Jones" <cyranojones_lalp@...>
Date: Mon, 31 Jul 2006 23:06:25 -0000

> you need to write your own i/o routines.

What you said finally sunk in to my brain today.  I don't think we would
need the putchar or getchar routines at all, as long as we are not writing
an old-fashioned-user-interface style program.  (O-FUI????)  <lmao>

If you are writing an event-driven GUI style app, you don't ever 
do any input yourself.  The OS receives the input, and packages up the 
keystrokes from the keyboard (and input from other devices) and
passes them to your program as *parameters* in calls to your apps
event-handler.  You would never call getchar.

This is the format for the mailstations event records:
     (who, signal, this, that)

"who" is the app number that the event is for.
"signal" is the event type (such as keydown, keyup, etc).
"this" and "that" are the data payload that go with the particular event.
In the case of key events, "this" is scancode, and "that" is ascii.

A mailstation app is basically an event handler.  The mailstation
OS passes these parameters to your apps event handler:
     handleevent(who, state, signal, this, that);

"state" is a single byte state variable that the OS keeps track of
for your app, between calls to handleevent.  (handleevent returns
this "state" on exit as the function result.)  
The other four parameters are the event.

--CJ

---

From: "John R." <jhoger@...>
Date: Mon, 31 Jul 2006 22:34:05 -0700

On 7/31/06, Cyrano Jones <cyranojones_lalp@...>
> an old-fashioned-user-interface style program.  (O-FUI????)  <lmao>

CLI (command line interface)

> event-handler.  You would never call getchar.

True.

> A mailstation app is basically an event handler.

Come to think of it, what program isn't? ;-)

> this "state" on exit as the function result.)

I typically call this state a "cookie" or "(execution) context." The
server/kernel/OS lets you register it with the system and it just
returns it to the client application as-is. I would guess it is fairly
easy to trade the cookie for a memory pointer which holds the rest of
the application's state (object oriented types would call this memory
"Self" or "This").

-- John.

---

From: Gary Clouse <niklaus37217@...>
Date: Tue, 1 Aug 2006 14:58:29 -0700 (PDT)

There are a few cross-compiler versions of small-C
that run under dos and output target code for various
8 bit cpus. Have to look around for one.

--- Cyrano Jones <cyranojones_lalp@...> wrote:

> The mailstation

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com

---

From: "John R." <jhoger@...>
Date: Wed, 2 Aug 2006 23:22:02 -0700

> 8 bit cpus. Have to look around for one.

SDCC, a C compiler, : http://sdcc.sourceforge.net/

It already targets Z80.

-- John.