It is currently Mon Dec 16, 2019 1:08 am

 All times are UTC

 Page 1 of 1 [ 4 posts ]
 Print view Previous topic | Next topic
Author Message
 Post subject: is there any other loop..??Posted: Fri Nov 14, 2014 5:33 am

Joined: Fri Nov 14, 2014 5:22 am
Posts: 2
Greetings,

attached below is an example of code which used "if..then.." loop in making a decision..

my question now is... is there any other way wic can help me do the same looping..

Code:
help1
move.b #32,d0
move.b #0,d1
trap #15
move.l d1,a0

move.b #1,d1
trap #15
move.l d1,a1

move.b #2,d1
trap #15
move.l d1,a2

move.b #3,d1
trap #15
move.l d1,a3

move.b  (a3),d2
move.b  d2,(a2)
move.b #\$00,\$e00000
move.b #\$00,\$e00002
if.b d2 <eq> #\$00 then.s
move.b  #\$3f,\$e0000e
endi
if.b d2 <eq> #\$01 then.s
move.b  #\$06,\$e0000e
endi
if.b d2 <eq> #\$02 then.s
move.b  #\$5b,\$e0000e
endi
if.b d2 <eq> #\$03 then.s
move.b  #\$4f,......................................

Top

 Post subject: Re: is there any other loop..??Posted: Sat Nov 15, 2014 2:59 am

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1110
I'm not sure I understand the question.

_________________
Prof. Kelly

Top

 Post subject: Re: is there any other loop..??Posted: Sat Nov 15, 2014 6:30 am

Joined: Fri Nov 14, 2014 5:22 am
Posts: 2
thank you for the reply... i managed to get answer for my question...

but now i'm having a doubt on what exactly these codes are doing... could you explain me each line.. I've explained some.. but not sure if its correct..

Code:
START:                  ; first instruction of program

move.b #32,d0       ; put 32 in low byte of data register D1
move.b #0,d1        ; put 0 in low byte of data register D2
trap #15            ; trap #15 activates input /output task
move.l d1,a0        ;

move.b #1,d1        ; put 1 in low byte of data register D1
trap #15            ;
move.l d1,a1

move.b #2,d1
trap #15
move.l d1,a2

move.b #3,d1
trap #15
move.l d1,a3

move.b  (a3),d2
move.b  d2,(a2)
move.b #\$00,\$e00000
move.b #\$00,\$e00002
move.b #\$00,\$e00004
move.b #\$00,\$e00006
move.b #\$00,\$e00008
move.b #\$00,\$e0000a
move.b #\$00,\$e0000c

Top

 Post subject: Re: is there any other loop..??Posted: Sat Nov 15, 2014 10:49 pm

Joined: Fri May 30, 2014 8:48 pm
Posts: 4
If I understand what you're wanting correctly, then I think you could do it with a lookup table like so:

Code:
move.b  (a3),d2
move.b  d2,(a2)
move.b #\$00,\$e00000
move.b #\$00,\$e00002

lea table,a4
move.b (a4,d2),\$e0000e

table:
dc.b \$3f, \$06, \$5b, ...

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 1 of 1 [ 4 posts ]

 All times are UTC

#### Who is online

Users browsing this forum: No registered users and 3 guests

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ EASy68K Forum    FAQ    Latest Features    EASy68K Questions    68000 Programming Questions    Wish List    Wishes Granted    Undocumented Features    Documented Features    General Discussion    EASy68K Projects