I agree!XavSnap wrote:Step One ... the Basic.
Step Tow ... The ASM.
Step Tree ... Save the World !

I agree!XavSnap wrote:Step One ... the Basic.
Step Tow ... The ASM.
Step Tree ... Save the World !
Code: Select all
# DISPLAY EXEMPLE
# ><AVSNAP
# ®®®®®®®®®®®®®®®®®
# FOUND IN ORDI-5 n2
# PAGE 29
# AUTHOR :
# ERIC WEINSTEIN.
# ®®®®®®®®®®®®®®®®®
1 REM [HEX:\
0E,21,3E,06,C6,02,47,CD,\
18,09,CD,9B,09,12,FD,34,\
3A,2A,0C,40,23,16,06,ED,\
B1,15,20,FB,54,5D,ED,B1,\
C3,5D,0A ]
7 POKE 16536,6
8 POKE 16517,6
10 LET I=1
50 DIM N$(50,16)
55 FOR A=1 TO 50
60 LET N$(A)=VAL A + "HELLO"+ VAL A
70 NEXT A
90 FOR I=1 TO 50
96 RAND USR 16514
98 PRINT N$(I);"(";I;")"
100 NEXT I
8999 STOP
9000 SAVE "AUTO-SCROLL"
Code: Select all
#define ORG .org ; TASM cross-assembler definitions
ORG $4082
LD C,$21
LD A,$06
ADD A,$02
LD B,A
CALL $0918 ; [LOC-ADDR]
CALL $099B ; [ONE-SPACE]
LD (DE),A
INC (IY+58)
LD HL,($400C) ; GET D-FILE
INC HL
LD D,$06
Lb4099:
CPIR
DEC D
JR NZ, Lb4099 ; [$4099:16537]
LD D,H
LD E,L
CPIR
JP $0A5D ; [RECLAIM-1]
.end
Code: Select all
10 CLS: FOR I=0 TO 10
...
20 NEXT I
Code: Select all
10 FOR I= USR VAL "2602" TO 10
...
20 NEXT I
On a ZX Spectrum you don't really need to save memory in BASIC. You have at least 16K where on a ZX81 you would have 1K.stefano wrote:On Spectrum I used sometimes also expressions like PI*PI, PI+PI, etc.
Considering that numbers occupy the visualization bytes plus 5 hidden bytes for the internal number encoding (mantissa etc..), it can save lots of memory, even if many of such combinations slow down the code.
Sometimes the "INT" rounding can be omitted.
One more idea:
USR VAL "3893" (pause) will act also as keyboard scanner reporting different codes depending on the 5-key group being pressed.