Ho provato a commentare il disassemblato della RND(). Ci sono un paio di punti "misteriosi" dove fa i calcoli perche' alcune JSR vanno a meta' di alcune funzioni di calcolo e non dall'inizio...
;---------------------------
; float numbers for RND
;---------------------------
E08D .BY $98,$35,$44,$7A,$00
E092 .BY $68,$28,$B1,$46,$00
;---------------------------
; RND function
;---------------------------
E097 20 2B BC JSR $BC2B ; get sign of float accu in A
E09A 30 37 BMI $E0D3 ; negative ?
E09C D0 20 BNE $E0BE ; positive ?
;---------------------------
; if zero get timer as seed
;---------------------------
E09E 20 F3 FF JSR $FFF3 ; now YX = $DC00
E0A1 86 22 STX $22
E0A3 84 23 STY $23
E0A5 A0 04 LDY #$04
E0A7 B1 22 LDA ($22),Y; ($22)+y points to $DC04
E0A9 85 62 STA $62 ; Timer A: Low-Byte
E0AB C8 INY
E0AC B1 22 LDA ($22),Y; $DC05 Timer A: High-Byte
E0AE 85 64 STA $64
E0B0 A0 08 LDY #$08
E0B2 B1 22 LDA ($22),Y; $DC08 Time-of-Day Clock:
E0B4 85 63 STA $63 ; 1/10 Seconds
E0B6 C8 INY
E0B7 B1 22 LDA ($22),Y; $DC09 Time-of-Day Clock:
E0B9 85 65 STA $65 ; Seconds
E0BB 4C E3 E0 JMP $E0E3
;---------------------------
;if positive starts here
;---------------------------
E0BE A9 8B LDA #$8B ; lots of pseudo operations here
E0C0 A0 00 LDY #$00 ; first, get last rnd seed number
; from $008B
E0C2 20 A2 BB JSR $BBA2 ; divide?
E0C5 A9 8D LDA #$8D ; constant float #1, ptr @ $E08D
E0C7 A0 E0 LDY #$E0
E0C9 20 28 BA JSR $BA28 ; minus/times?
E0CC A9 92 LDA #$92 ; constant float #2, ptr @ $E092
E0CE A0 E0 LDY #$E0
E0D0 20 67 B8 JSR $B867 ; add float indexed by AY
;--------------------------- ; to float accu
;if negative starts here
;---------------------------
E0D3 A6 65 LDX $65 ; 0061-0066 : FAC
E0D5 A5 62 LDA $62 ; (Main Floating point Accu)
E0D7 85 65 STA $65 ; here swaps mantissa bytes
E0D9 86 62 STX $62
E0DB A6 63 LDX $63
E0DD A5 64 LDA $64
E0DF 85 63 STA $63
E0E1 86 64 STX $64
;---------------------------
E0E3 A9 00 LDA #$00
E0E5 85 66 STA $66 ; 0=no sign
E0E7 A5 61 LDA $61 ; exponent
E0E9 85 70 STA $70
E0EB A9 80 LDA #$80 ; negative exponent?
E0ED 85 61 STA $61
E0EF 20 D7 B8 JSR $B8D7 ; round?
E0F2 A2 8B LDX #$8B
E0F4 A0 00 LDY #$00
E0F6 4C D4 BB JMP $BBD4; store float accu in XY ($008B)