12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- FracToken:
- ld h,b \ ld l,c
- call PrimeTest
- ld b,0
- ld (ThetaPrimeVar),bc
- ld b,h \ ld c,l
- ret
- PrimeTest:
- bit 0,l
- jr nz,+_
- ld bc,2
- srl h \ rr l
- ret
- _:
- ld de,PrimeNumbers
- ld bc,3501h
- PrimeTestLoop:
- push bc
- push hl
- ld a,(de)
- ld c,a
- call HL_Div_C
- pop hl
- or a
- jr nz,+_
- pop de
- ret
- _:
- pop bc
- inc de
- djnz PrimeTestLoop
- scf
- ;6 bytes, 24cc
- ld a,h
- ld h,b
- ld b,l
- ld l,c
- ld c,b
- ld b,a
- ;3 bytes, 40cc
- ; push bc
- ; ex (sp),hl
- ; pop bc
- ret
- PrimeNumbers:
- .db 3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97
- .db 101,103,107,109,113,127,131,137,139,149,151,157,163
- .db 167,173,179,181
- .db 191,193,197,199,211,223,227,229,233,239,241,251
|