z: update to compile on Linux
This commit is contained in:
parent
8e32466246
commit
ee6dd84d9f
|
@ -6,14 +6,21 @@ EMPTY_DISK = ../../empty_disk/empty.dsk
|
|||
|
||||
all: z.dsk z
|
||||
|
||||
z.dsk: HELLO
|
||||
z.dsk: HELLO ARCS.BAS
|
||||
cp $(EMPTY_DISK) z.dsk
|
||||
$(DOS33) -y z.dsk SAVE A HELLO
|
||||
$(DOS33) -y z.dsk SAVE A ARCS.BAS
|
||||
|
||||
####
|
||||
|
||||
HELLO: hello.bas
|
||||
$(TOKENIZE) < hello.bas > HELLO
|
||||
|
||||
####
|
||||
|
||||
ARCS.BAS: arcs.bas
|
||||
$(TOKENIZE) < arcs.bas > ARCS.BAS
|
||||
|
||||
####
|
||||
|
||||
z: z.o
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
0CALL2225"\Q29QQVX6/:.T?PVQ_*bN2\.23*G.3*b6MOWGbM-
|
||||
1"),G;aE`6]N4`U0b5$38aU/b5_&&W`U/)(`6.QJ(W`U/)(`V?`6`F,;_6`V`%`V?$8`%)a5a%#8a%C7[$?CX/b&b7\#?DW/b%b8[#@U%_^A9&7\#?c5bW\O4"******GRASCDEFPOP!i\DEL0GRRETURN}i\F0jjjjjjjF0jFORLOGASCsONERR0::=VALpRNDlo
|
21
basic/z/z.c
21
basic/z/z.c
|
@ -1,17 +1,25 @@
|
|||
/* by qkumba */
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
//#include <io.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#ifndef O_BINARY
|
||||
#define O_BINARY 0
|
||||
#define O_TEXT 0
|
||||
#endif
|
||||
|
||||
static unsigned char decoder[] = "\"******GRASCDEFPOP!i\\DEL0GRRETURN}i\\F0jjjjjjjF0jFORLOGASCsONERR0::=VALpRNDlo";
|
||||
|
||||
void main(int argc, char *argv[])
|
||||
{
|
||||
int main(int argc, char **argv) {
|
||||
|
||||
int i, l, j, b2, b6;
|
||||
unsigned char b[150];
|
||||
unsigned char bb2[150];
|
||||
unsigned char bb6[150];
|
||||
unsigned char call[10];
|
||||
char call[32];
|
||||
|
||||
memset(b, 0, sizeof(b));
|
||||
i = open(argv[1], O_RDONLY | O_BINARY);
|
||||
|
@ -43,11 +51,14 @@ void main(int argc, char *argv[])
|
|||
while (++j < l);
|
||||
|
||||
sprintf(call, "0CALL%d\"", 2049+10+b2+6+(int)sizeof(bb6)-b6+1);
|
||||
i = open("out", O_WRONLY | O_BINARY | O_CREAT | O_TRUNC, 0x80);
|
||||
i = open("out", O_WRONLY | O_BINARY | O_CREAT | O_TRUNC, 0666);
|
||||
write(i, call, strlen(call));
|
||||
write(i, bb2, b2);
|
||||
write(i, "\r\n1\"", sizeof("\r\n1\"")-1);
|
||||
write(i, bb6 + b6, sizeof(bb6) - b6);
|
||||
write(i, decoder, sizeof(decoder)-1);
|
||||
write(i,"\n",1);
|
||||
close(i);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
MEMORY {
|
||||
ZP: start = $00, size = $1A, type = rw;
|
||||
RAM: start = $9500, size = $3000, file = %O;
|
||||
}
|
||||
|
||||
SEGMENTS {
|
||||
CODE: load = RAM, type = ro, align=$100;
|
||||
RODATA: load = RAM, type = ro;
|
||||
DATA: load = RAM, type = rw;
|
||||
BSS: load = RAM, type = bss, define = yes;
|
||||
ZEROPAGE: load = ZP, type = zp;
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
MEMORY {
|
||||
ZP: start = $00, size = $1A, type = rw;
|
||||
RAM: start = $9600, size = $3000, file = %O;
|
||||
}
|
||||
|
||||
SEGMENTS {
|
||||
CODE: load = RAM, type = ro, align=$100;
|
||||
RODATA: load = RAM, type = ro;
|
||||
DATA: load = RAM, type = rw;
|
||||
BSS: load = RAM, type = bss, define = yes;
|
||||
ZEROPAGE: load = ZP, type = zp;
|
||||
}
|
Loading…
Reference in New Issue