Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Eleven

Pages: [1]
1
ASM / Compile Time error, what is wrong?
« on: June 08, 2011, 03:02:35 pm »
hi all, i am new to assambly, was messing around with a little prime-number finder (checks for all numbers 2-->255 if they're prime, and saves them to calculate the next)

spasm keeps giving mee these errors, and i can't find the problem (i use both Hot-Dog's tutorial as the "learn ASM in 28 days"-guide as references, but am still stuck)

the errors:
Code: [Select]
Template.asm:18: error: SUB doesn't take these arguments
Pass two...
Template.asm:12: error: 'primelist' isn't a macro or label
Done
the code
Code: [Select]
#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->0
outerloop
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,e
findrestloop
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 innerloop
prime                                       ;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 bc
noprime
ld a,e
cpl                                    ; recall b = cpl e
ld b,a
djnz outerloop                         ; find next prime
ret
primelist                                  ; the list with the primes, starts
.db 2                                      ; with 1 known value: 2

what is wrong?
oh yeah and i know this probably won't be the best solution to the problem, but i just want to experiment a bit with the code.

2
ASM / Macosx Spasm n00b question
« on: June 05, 2011, 04:45:21 pm »
ok so i am new(b) to assembly (ti84+)

i read Hot_Dog's tutorial and understood most of it. now wanted to try his programs myself.
i am currently working in macosx, although i can swap to windows (7) if really necessary (prefer not though).
i am not familiar with the Command prompt (windows nor macosx), so detailed instructions are maybe needed

so basically i got program1.asm in directory MacOSX/Users/Eleven/Desktop/Assembly
in this same directory i got both include files, and spasm and WabbitEmu
what steps do i need to take to assemble the program and run it in the Emulator (WabbitEmu)?

thx

3
Introduce Yourself! / Hello
« on: June 04, 2011, 08:10:51 am »
Hi everybody.

I've been programming TiBasic quite some time now, and feel there are few challenges left there.

so I decided to start learning assembly (yeey)
I started with "hotdog's tutorial" (which brought me here btw) a week ago, and continued today with the "28-day-guide".
for now everything is pretty clear, but I'm sure when things get harder, I will spend much time on the forum asking questions or searching for more info...

I'm from Belgium, so i speak Dutch and English fluently and understand French also.
I noticed a Dutch copy of the terms of agreement, is there a Dutch community here? If not no worries, English suits me fine.

thats it for a short introduction i guess,...

Pages: [1]