Do you mean one should generate tables elsewhere
And then just incbin that binary, of course, not generate a wall of asm .byte statements.
Well, while these may all be good ideas in theory, I actually don't know how to "incbin" into CSDb forums for posting a quick and dirty code snippet ;-)
Nobody said anything like that. And code-golf or general prototyping is a good reason for loop macros. =)
Yes to generate tables elsewhere most of the time (though for a case as simple as this I'd probably inline a loop plus expression too), but if you mean "do you generate the table once then copy and paste a huge list of .byte statements into your source code" then definitely not!
This one takes 13.18 seconds (as compared to just doing print:return in the printing routine, which takes 8.91 - the binary conversion+print is hence around 4.27). So yeah, ws is correct. It's dominated by screen scroll time. Those times are if you run after loading from reset - if you start at bottom of the screen everything is slower, because yous start scrolling immediately. 0 gosub9:ti$="000000":goto2 1 printd$(i/16)d$(iand15):return 2 fori=0to255:gosub1:next 3 print"time:"ti/60:end 7 data"0000","0001","0010","0011","0100","0101","0110","0111" 8 data"1000","1001","1010","1011","1100","1101","1110","1111" 9 dimd$(16):fori=0to15:readd$(i):next:return
0 gosub9:ti$="000000":goto2 1 printd$(i/16)d$(iand15):return 2 fori=0to255:gosub1:next 3 print"time:"ti/60:end 7 data"0000","0001","0010","0011","0100","0101","0110","0111" 8 data"1000","1001","1010","1011","1100","1101","1110","1111" 9 dimd$(16):fori=0to15:readd$(i):next:return
10 TI$="000000":E=15:DIMB$(E):SYS58692:FORA=.TOE:READB$(A):NEXT:D=1/A 20 FORA=.TO255:PRINTB$(A*D)B$(AANDE):NEXT:PRINTTI/60:DATA0000,0001,0010 30 DATA0011,0100,0101,0110,0111,1000,1001,1010,1011,1100,1101,1110,1111
1 TI$="000000":SYS49152,2:PRINTTI/60:END 2 CLR:PRINT"{CLR}";:C=48:B=49:G=128:H=64:I=32:J=16:K=8:L=4:M=2:N=1:F=256:O=65490 3 A=C:D=VANDG:IFD=GTHENA=B 4 SYSO:A=C:D=VANDH:IFD=HTHENA=B 5 SYSO:A=C:D=VANDI:IFD=ITHENA=B 6 SYSO:A=C:D=VANDJ:IFD=JTHENA=B 7 SYSO:A=C:D=VANDK:IFD=KTHENA=B 8 SYSO:A=C:D=VANDL:IFD=LTHENA=B 9 SYSO:A=C:D=VANDM:IFD=MTHENA=B 10 SYSO:A=C:D=VANDN:IFD=NTHENA=B 11 PRINTCHR$(A) 12 V=V+1:IFV<>FTHENGOTO3 13 END
1 TI$="000000":SYS49152,2:PRINTTI/60:END 2 CLR:PRINT"{CLR}";:B=16:F=256:E=15 3 A=V/B:A=A+B:GOSUBA:A=VANDE:A=A+B:GOSUBA:PRINT:V=V+1:IFV<>FTHENGOTO3 4 END 16 PRINT"0000";:RETURN 17 PRINT"0001";:RETURN 18 PRINT"0010";:RETURN 19 PRINT"0011";:RETURN 20 PRINT"0100";:RETURN 21 PRINT"0101";:RETURN 22 PRINT"0110";:RETURN 23 PRINT"0111";:RETURN 24 PRINT"1000";:RETURN 25 PRINT"1001";:RETURN 26 PRINT"1010";:RETURN 27 PRINT"1011";:RETURN 28 PRINT"1100";:RETURN 29 PRINT"1101";:RETURN 30 PRINT"1110";:RETURN 31 PRINT"1111";:RETURN
10 TI$="000000":E=15:DIMB$(E):SYS58692:FORA=.TOE:READB$(A):NEXT:D=1/A 20 FORA=.TO255:PRINTB$(A*D)B$(AANDE):NEXT:PRINTTI/60:DATA0000,0001,0010 30 DATA0011,0100,0101,0110,0111,1000,1001,1010,1011,1100,1101,1110,1111 -> 11.8166667 sec. Multiply by 1/16 is a bit faster than division. Constants in variables is a bit faster. I didn't see any gains from using a subroutine.