Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- random:
- ;note: all arithmetic should be unsigned
- ;a, b, c, and d are the input variables
- ;a', b', c', d' are the outputs
- ;e = a - 8bit_rotate_left(b)
- lda RndB
- asl a
- adc #$80
- eor #$FF
- sec
- adc RndA
- tay
- ;a' = b eor nibble_swap(c)
- lda RndC
- asl a
- adc #$80
- rol a
- asl a
- adc #$80
- rol a
- eor RndB
- sta RndA
- ;b' = c + d
- lda RndC
- clc
- adc RndD
- sta RndB
- ;c' = d + e
- tya
- clc
- adc RndD
- sta RndC
- ;d' = a' + e
- ;(also this is the result)
- tya
- clc
- adc RndA
- sta RndD
- rts
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement