[Tuto-ASM] Save memory with an ASM code...

Anything Sinclair ZX Basic related; history, development, tips - differences between BASIC on the ZX80 and ZX81
Post Reply
User avatar
XavSnap
Posts: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

[Tuto-ASM] Save memory with an ASM code...

Post by XavSnap »

Hi,

You had to print a full line of a zx81 character:
Cap0000.jpg

Code: Select all

10 LET X$="¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸"
20 LET Y$="®®®®®®®®®®®®®®®®®®®®®®®®®®®®®®®®"
30 LET Z$="’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’’"
40 PRINT X$;TAB 10;"HELLO WORLD",Y$
50 PRINT AT 6,0;Z$;AT 21,0;Z$
Basic+Vars = 2 * 32 characters per string.

RST 10h code:
;------- TASM ASM mnemonics. -------
; Compile this file using:
; Set TASMOPTS = -b
; tasm -80 ThisCode.tas MyBinary.BIN
;-----------------------------------
; Zx81 Program name: VB81 XuR [line3.txt] :
; REM line name: 1 REM: 21 Bytes@4082-4096

#define ORG .org ; TASM cross-assembler definitions
#define equ .equ
;-----------------------------------

;------- ROM and RAM Symbols -------
RAM_DF_CC equ $400E


ORG $4082 ; [@16514/@h4082]
LD HL,(RAM_DF_CC) ; GET DF-CC
DEC HL
LD A,(HL)
LD BC,$0000
Lb408A:
INC HL
PUSH AF
LD A,(HL)
CP $76 ; [118]
JR Z, Lb4095 ; [$4095:16533]
POP AF
RST 10H ; Display= A reg.
JR Lb408A ; [$408A:16522]
Lb4095:
POP AF
RET ; ==========================
.end

Code: Select all

1 REM [HEX:\
2A,0E,40,2B,7E,01,00,00,23,F5,7E,FE,76,28,04,F1,\
D7,18,F5,F1,C9]
10 LET FL=16514
20 PRINT "¸";" " AND USR FL)
30 PRINT TAB 10;"HELLO WORLD"
40 PRINT "®";" " AND USR FL
50 PRINT AT 6,0;"’";" " AND USR FL
60 PRINT AT 21,0;"’";" " AND USR FL
LDIR code:
;------- TASM ASM mnemonics. -------
; Compile this file using:
; Set TASMOPTS = -b
; tasm -80 ThisCode.tas MyBinary.BIN
;-----------------------------------
; Zx81 Program name: VB81 XuR [line1.txt] :
; REM line name: 1 REM: 12 Bytes@4082-408D

#define ORG .org ; TASM cross-assembler definitions
#define equ .equ
;-----------------------------------

;------- ROM and RAM Symbols -------
RAM_DF_CC equ $400E


ORG $4082 ; [@16514/@h4082]
LD HL,(RAM_DF_CC) ; GET DF-CC
LD D,H
LD E,L
DEC HL
LD BC,$001F
LDIR
RET ; ==========================
.end

Code: Select all

1 REM [HEX:2A,0E,40,54,5D,2B,01,1F,00,ED,B0,C9]
10 LET FL=16514
20 PRINT "¸";" " AND USR FL
30 PRINT TAB 10;"HELLO WORLD"
40 PRINT "®";" " AND USR FL
50 PRINT AT 6,0;"’";" " AND USR FL
60 PRINT AT 21,0;"’";" " AND USR FL
Have fun !
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
Post Reply