Page 1 of 1

RAND Command...

Posted: Sat Dec 05, 2020 3:20 am
by XavSnap
rand.jpg
"Your Computer" March 83

Re: RAND Command...

Posted: Sat Dec 05, 2020 8:02 am
by 1024MAK
The XZ81 sounds like an interesting machine. Does anyone have one of these extra r@re machines?

Mark

Re: RAND Command...

Posted: Sat Dec 05, 2020 9:11 am
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:

Re: RAND Command...

Posted: Sat Dec 05, 2020 9:19 am
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

Re: RAND Command...

Posted: Sat Dec 05, 2020 10:38 am
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 152 times