cc65 users: printtok.c updated!

11 posts / 0 new
Last post
Offline
Last seen: 2 months 3 weeks ago
Joined: Nov 12 2022 - 16:50
Posts: 201
cc65 users: printtok.c updated!

Hi!  I just updated my printtok.c cc65 C module online.  It is now much smaller in object size and adds an option to use zeropage to store two of its variables.  I also bettered its extended memory support but still didn't test this support.  :(   The compression techniques didn't change, though.  You can find it at c65 additions - Manage /ui at SourceForge.net.  Try it out!

Offline
Last seen: 2 months 3 weeks ago
Joined: Nov 12 2022 - 16:50
Posts: 201
I just updated it again by

I just updated it again by adding 32 more single-byte tokens and better extended memory support: now, it can read both from main memory and extended memory in the same program.  It is at the same location as the previous versions.

Offline
Last seen: 2 months 3 weeks ago
Joined: Nov 12 2022 - 16:50
Posts: 201
I am working on a better

I am working on a better version of printtok that can compress literals to 7 bits or 5 bits with extra bits for tokens and to increase support for more available characters.  This version will also compress strings automatically.  If you have ways to better either or both the current version or the new version, please reply.

Offline
Last seen: 2 months 3 weeks ago
Joined: Nov 12 2022 - 16:50
Posts: 201
Currently, the Win32

Currently, the Win32 executable won't run at all on a Win11/64 laptop and displays an error on the second line of an input on a Win7/64 laptop.  :(  Should I post the main module here so others can figure out what's wrong?

Offline
Last seen: 2 months 3 weeks ago
Joined: Jul 5 2018 - 09:44
Posts: 2587
I can't help you with that

I can't help you with that because I don't have Windows at all.

 

Offline
Last seen: 2 months 3 weeks ago
Joined: Nov 12 2022 - 16:50
Posts: 201
At least you resonded.  :) 

At least you resonded.  :)  The program works better on a Win7/64 laptop, though, and I get the same issue using Open Watcom.

mmphosis's picture
Offline
Last seen: 1 week 10 hours ago
Joined: Aug 18 2005 - 16:26
Posts: 437
printtok-004.c

I am running Linux but here's some output ...

$ make clean all

rm -fr io.c include io.o printtok.c printtok

mkdir -p include

printf "#include <stdio.h>\n#define __fastcall__\n" > include/conio.h

#printf "#define char unsigned char\n#define printc putchar\n#define getkey()\n" >> include/conio.h

printf "#include <stdio.h>\nvoid printc(char c){putchar(c);}\nvoid prints (char * s){printf(\"%s\", s);}\n" "%s" > io.c

cc    -c -o io.o io.c

sed -e /getkey/d printtok-004.c >printtok.c

cc -Iinclude io.o printtok.c -o printtok

./printtok

Going to Mars?

Microsoft sucks.   Harry Potter is cool!

%<Illegal function call.>

    -Numbers!

I'm hungry!!

 

 

Offline
Last seen: 2 months 3 weeks ago
Joined: Nov 12 2022 - 16:50
Posts: 201
Cool!  Thank you!  :)  So, is

Cool!  Thank you!  :)  So, is it useful?  Do you have a purpose for it?

mmphosis's picture
Offline
Last seen: 1 week 10 hours ago
Joined: Aug 18 2005 - 16:26
Posts: 437
Harry Potter wrote:Cool! 
Harry Potter wrote:

Cool!  Thank you!  :)  So, is it useful?  Do you have a purpose for it?

I don't have a purpose for it because I don't usually need much string space. I like the concept—someone writing a text adventure might need lots of string space!

I find the most useful programs are the ones that I use on a regular basis. I like small programs. Thanks for sharing.

Offline
Last seen: 8 months 2 weeks ago
Joined: Nov 2 2023 - 22:15
Posts: 1
what about win 10?

what about win 10? my laptop is very slow, I don't know if I can install it or not. Do you know any version lighter?

 

 

Offline
Last seen: 2 months 3 weeks ago
Joined: Nov 12 2022 - 16:50
Posts: 201
Provided you have the latest

Provided you have the latest version of printtok, it is pretty efficient and, in fact, if you disable most control characters, such as Clear Acreen and Pause, more efficient than previous versions.  Unfortunately, you need to compress the strings yourself.  :(  Does this help?

Log in or register to post comments