Skip to content

Instantly share code, notes, and snippets.

@nurpax
Last active April 27, 2018 12:48
Show Gist options
  • Save nurpax/d0fee60a74633ae3027d41a7d1d02c19 to your computer and use it in GitHub Desktop.
Save nurpax/d0fee60a74633ae3027d41a7d1d02c19 to your computer and use it in GitHub Desktop.

Generate

prng: .byte 0,0,0,0 rngtest: lda #<prng ldx #>prng jsr rnd_seed ldy #$80 sty $61 lp1: ldx #$00 stx $60 lp2: inc $d021

lda #<prng
ldx #>prng
jsr rnd

tax
inc histo,x

inc $60
bne lp2
inc $61
bne lp1
jmp *
  • = $2500 histo: .fill 256, 0

Number histogram

This is the output histogram. I'd expect more slots to have a non-zero value.

>C:2500  14 00 00 00  00 00 07 00  00 00 00 00  06 00 00 00   ................
>C:2510  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 07   ................
>C:2520  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
>C:2530  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
>C:2540  06 00 00 00  00 00 00 00  00 00 00 00  00 00 06 00   ................
>C:2550  00 00 00 00  00 00 00 00  00 00 00 00  07 00 00 00   ................
>C:2560  00 00 06 00  00 00 00 00  06 00 07 00  00 07 00 00   ................
>C:2570  00 00 00 00  00 00 00 00  00 06 00 00  00 00 0c 00   ................
>C:2580  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
>C:2590  00 00 00 06  00 00 00 00  07 00 00 00  00 00 06 00   ................
>C:25a0  00 00 00 00  00 00 00 00  00 00 0c 00  07 00 00 00   ................
>C:25b0  00 00 00 00  00 00 07 00  00 00 00 00  07 00 00 00   ................
>C:25c0  00 00 00 00  00 00 00 07  00 07 06 00  00 00 00 00   ................
>C:25d0  00 00 00 07  00 00 00 00  00 00 00 00  00 00 00 00   ................
>C:25e0  00 00 07 00  07 00 00 00  06 06 00 00  00 00 00 00   ................
>C:25f0  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   ................
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment