0 Members and 1 Guest are viewing this topic.
Template.asm:18: error: SUB doesn't take these argumentsPass two... Template.asm:12: error: 'primelist' isn't a macro or labelDone
#include "ti83plus.inc" ; a program that finds all .org $9D93 ; prime numbers up to 255.db t2ByteTok, tAsmCmp B_CALL _ClrLCDFull ld c,1 ; c = # known primes ld b,$FD ; b counts from 253->0outerloop ld a,b cpl ; e counts from 2-->255 ld a,e ; and preserves b's cpl ld b,c ld hl,primelist innerloop ; we loop through known primes ld a,(hl) ld d,a ; d = a known prime ld a,efindrestloop sub a,d ; finds rest of e/d , ugly but jr nc findrestloop add a,d or a ; a = rest: rest =0 -> e != prime jr z notprime inc hl ; next known prime adress djnz innerloopprime ;only for reference ld a,e ld (hl),a inc c ld hl,0 ; e is prime, added in next adress ld l,a push bc push de ; save bc and de for later b_call(_dispHL) ; disp found prime pop de ; de and bc will be needed pop bcnoprime ld a,e cpl ; recall b = cpl e ld b,a djnz outerloop ; find next prime retprimelist ; the list with the primes, starts.db 2 ; with 1 known value: 2