NewsProductsSprinterSupportDownloadSprinter ForumAbout usLinksSite map Russian site

English
   >> Software programming for the computer Sprinter
Thread views: 1158 View all threadsNext thread*Threaded Mode

Pages in this thread: 1 | 2 | 3 | 4 | 5 | (show all)
Shaos
(enthusiast)
2002/11/10 09:08
Re: C compiler new [re: liftarn]Reply to this post

> it should be either +pps or +ppsansi depending if you want ANSI or not.

Hmmm... It isn't working...
Errors CLOSE and FOPEN printed by compile procedure


Alexander Shabarshin (shaos@mail.ru)
NedoPC Project

liftarn
(stranger )
2002/11/11 17:39
Re: C compiler new [re: Marcelo]Reply to this post

In reply to:

Is there any Z88DK Windoze-ready pack anywhere with Sprinter support that one can just download and start coding instead of having to compile/upgrade/massage it?




Not as such. Have you tried http://sugarcube.suborbital.org.uk/~dom/z88dk/ and http://www.algonet.se/~dennisgr/z88dk.htm Together they should be able to use under Windows.



liftarn
(stranger )
2002/11/11 17:41
Re: C compiler new [re: Shaos]Reply to this post

Can you post the source here so we can have a look at it.

I haven't tried doing any Sprinter stuff myself so perhaps dom can answer your questions better.



Shaos
(enthusiast)
2002/11/12 12:24
Re: C compiler new [re: liftarn]Reply to this post

I download latest version 20021105
+pps is not working
+ppsansi works!!!
ADV_A.EXE and ANSITEST.EXE are in attached archive
MY1.EXE is this program:

#include <stdio.h>
int main()
{
int k;
FILE *f;
char str[256];
printf("Hello, World!\n");
f = fopen("my1.c","r");
if(f==NULL) return 0;
k = fread(str,256,1,f);
printf("%d read\n",k);
str[255] = 0;
fclose(f);
printf("%s",str);
k = getk();
printf("Key %d\n",k);
return 1;
}

it's print:

Hello, World!
0 read
...
Key 166

Why 0 and 166???
When you will add command line arguments?


Alexander Shabarshin (shaos@mail.ru)
NedoPC Project

Shaos
(enthusiast)
2002/11/12 12:26
Attachment
Re: C compiler new [re: liftarn]Reply to this post

EXAMPLES.ZIP with ADV_A.EXE, ANSITEST.EXE and MY1.EXE binaries for Sprinter


Alexander Shabarshin (shaos@mail.ru)
NedoPC Project

dom
(stranger )
2002/11/14 15:39
Re: C compiler new [re: Shaos]Reply to this post

>Why 0 and 166???

I'll look into this, could be a simple case of me mis-reading the docs and thinking the return from the Estex read() is the number of read bytes and not the number of unread bytes (or vice versa)

As for 166 - what key did you press? getk() just returns whatever is in the keyboard buffer at the time of the SCANKEY call

>When you will add command line arguments?

Point me in the direction of the docs and I'll try to add it in this weekend

BTW. Are compiled programs now running correctly on a real sprinter?





dom
(stranger )
2002/11/14 15:52
Re: C compiler new [re: Shaos]Reply to this post

> Why 0 and 166???

Hmmm, I've just tried this in the emulator, the read returns 1 (which is correct) and getk() returns 0.

I'm guessing that this due to the emulation of Estex using native system calls and there might be a slight disparity between what they return and what the real hardware returns.

As for the +pps problem - rather stupidly the makefile forgets to build it. This returns the same results as above.



Denis ParinovVIP
(Sprinter Team)
2002/11/15 06:41
Re: C compiler new [re: dom]Reply to this post

>> When you will add command line arguments?

> Point me in the direction of the docs and I'll try to add it in this
weekend

Unfortunately, It's not covered by english documentation.
I'll try to quick translate this chapter. And if you will need more
information about any DSS features, feel free to ask us here or by email.


Start applications:

The programs stored on the disk in binary executable files.
One of main task for operating system, it's start the programs.
The command line for program has following format:

[device:][\path\]name [parameters]

The device and path specified location on the disk. If they are missed.
Then program searching in current directory.
EXE files contain, special prefix and program code.

EXE-file prefix:

+00 2 dw 5845h ; EXE signature
+02 1 db 45h ; Reserved (exe type)
+03 1 db 00h ; Version of EXE-format
+04 4 dd 00000200h ; Begin of program code (bytes offset)
+08 2 dw 0000h ; Size of primary loader or 0
+10 4 dd 00000000h ; Reserved
+14 2 dw 0000h ; Reserved
+16 2 dw ???? ; Load address
+18 2 dw ???? ; Start addres (register PC)
+20 2 dw ???? ; Stack addess (register SP)
+22 490 ds 0 ; Reserved

+512 ; Code of program


40h (64) EXEC (Execute EXE-file)

input:

HL - file specification
B = 0 - load and execute program
C - 40h

output:

A - exit code, if CF=0
error, if CF=1

The following steps used for start a program:

1) Opens exe-file for read;
2) Reads exe-prefix to working buffer;
3) Allocates memory required for loading this file or primary loader,
if size of primary loader != 0;
4) Save STACK
5) Pages allocated memory;
6) Builds Program start prefix and point IX to it;
7) Reading file to the address that specified in field 16 (Load address);
8) Closes exe-file, if it not a primary loader;
9) Sets STACK at value specified in field 20 (Stack address);
10) Jump to program code that specified in field 18 (Start address);

Program start prefix:

-03 1 db ? ; File handle, if exe-file has primary loader
-02 1 db ? ; Memory handle for this exe-file
-01 1 db ? ; Level of current program
+00 1 db ? ; Length of command line parameters
+01 127 ds ? ; Parameters of command line with null-terminated

Example:
LD HL,NAME ;HL point to ASCIIZ string with filename
LD C,40h ;Exec fn.
LD B,00h ;Subfn. load and execute
RST 10h ;Call DSS
RET C ;Return if Error
LD (ENDCODE),A ;Save exit code

NAME DB "\PROG\UTILITY\prog.exe",0
ENDCODE DB 00h





Shaos
(enthusiast)
2002/11/15 10:35
Re: C compiler new [re: dom]Reply to this post

> As for 166 - what key did you press?
Nothing
>Point me in the direction of the docs and I'll try to add it in this weekend
It's simple. After start EXE-program you may read prefix by IX and analize arguments inside command line (see old EXEPREFX example).
>BTW. Are compiled programs now running correctly on a real sprinter?
Yes :)

What about very useful function fseek???

Alexander Shabarshin (shaos@mail.ru)
NedoPC Project

dom
(stranger )
2002/11/15 15:42
Re: C compiler new [re: Shaos]Reply to this post

>>BTW. Are compiled programs now running correctly on a real sprinter?
> Yes :)

Fantastic, must've been that dodgy out I had at one point.

> What about very useful function fseek???

Hmmm, good point. Checks. Ah, not included in the lib and a broken lseek() Fixed, new snapshot available up on sugarcube.





Pages in this thread: 1 | 2 | 3 | 4 | 5 | (show all)
View all threadsNext thread*Threaded Mode
Jump to