10DEFFNS="AssRnd" :REM Program name
20MODE0
30?&90=RND(255)
40?&91=RND(255)
50?&92=RND(255)
60FORL%=0TO2 STEP2 :REM Assembler op
tion
70P%=&900 :REM Memory locat
ion routine will start at
80[ ½ Start of assemble
r
90OPTL% ½ Listing option
100LDX#&60 ½ Offset for Sheila
. &FE60
110LDY#0 ½ Value to poke she
ila with
120LDA#&97 ½ OSBYTE call numbe
r (poke sheila)
130JSR&FFF4 ½ OSBYTE call
135.E%
140LDX#&62 ½ Offset for Sheila
. &FE62
150JSR random ½ Get some random n
umbers
160LDA&91
170TAY ½ Put it in Y
180LDA#&97 ½ OSBYTE call numbe
r (poke sheila)
190JSR&FFF4 ½ OSBYTE call
200RTS ½ Back to basic (or
to main routine)
210.random ½ Get a random numb
er in &91 and &92
220LDA&90
230AND#&48
240ADC#&38
250ASLA:ASLA
260ROL&92
270ROL&91
280ROL&90
290LDA&90
300CLC
310SBC&AF
320BCS random
330LDA&91
340CLC
350SBC&DF
360BCS random
370RTS
380]
390NEXT
395CALL&900
400*K.0CALLE%|MP.÷?&FE62|M
410*K.1CALLE%|MP.÷?&91:P.÷?&92|M
420PRINT"Press F0 to get random number
(into the user port)"
430PRINT"Press F1 to get 2 random numb
ers"