RAND Command...

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.

RAND Command...

Post by XavSnap »

rand.jpg
"Your Computer" March 83
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
User avatar
1024MAK
Posts: 5103
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: RAND Command...

Post by 1024MAK »

The XZ81 sounds like an interesting machine. Does anyone have one of these extra r@re machines?

Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Buffer Amp

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer later in the year.
User avatar
XavSnap
Posts: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: RAND Command...

Post by XavSnap »

HI,

The XZ-81 is a Timex-Sinclair computer like… with 1K RAM and a destroyed keyboard !

https://www.youtube.com/watch?v=KmdAQl2lSgA

:lol:
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
User avatar
XavSnap
Posts: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: RAND Command...

Post by XavSnap »

In case of RAND USR *** , the BC return value is store in 16434/16435...

We can retrieve this value using a RAND USR ***ROM*** to get this value ? as BC value in a LET command…
LD BC,(16434) ; $4030
RET
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
User avatar
XavSnap
Posts: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: RAND Command...

Post by XavSnap »

Code: Select all

1 REM xxxxxxx
2 FOR A=0 TO 5
3 POKE 16514+A,PEEK (3379+A)
4 NEXT A
5 POKE 16514,33
6 POKE 16515,61
7 POKE 16520,201
8 RAND 12345
9 POKE 16445,PEEK 16434
10 POKE 16446,PEEK 16435
11 PRINT USR 16514

Code: Select all

;------- TASM ASM mnemonics. -------
; Compile this file using:
; Set TASMOPTS = -b
; tasm -80 ThisCode.tas MyBinary.BIN
;-----------------------------------
; Zx81 Program name: VB81 XuR [RAND.bas] :
; REM   line   name: 1 REM:     7 Bytes@4082-4088

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

;------------------------------------
;-Basic sub-routine entry.          -
;+----------------------------------+
; Lb4082  ;  <- USR Basic Enty.
;+----------------------------------+

ORG $4082 ; [@16514/@h4082]
Lb4082: ; <- USR Basic Enty.
	LD HL,$403D 
	LD C,(HL) 
	INC HL 
	LD B,(HL) 
	RET ; ==========================
.end



We had to move the 16434/45…
this address is used in LET/USR function.
RAND.P
(1.15 KiB) Downloaded 149 times
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
Post Reply