EASy68K http://www.easy68k.com/EASy68Kforum/ |
|
is there any other loop..?? http://www.easy68k.com/EASy68Kforum/viewtopic.php?f=5&t=1353 |
Page 1 of 1 |
Author: | LekhAsh [ Fri Nov 14, 2014 5:33 am ] |
Post subject: | is there any other loop..?? |
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.. your helpis much appreciated thanking you in advance... ![]() 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,...................................... |
Author: | profkelly [ Sat Nov 15, 2014 2:59 am ] |
Post subject: | Re: is there any other loop..?? |
I'm not sure I understand the question. |
Author: | LekhAsh [ Sat Nov 15, 2014 6:30 am ] |
Post subject: | Re: is there any other loop..?? |
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: ORG $1000 ; the program will load into address $1000
START: ; first instruction of program task1 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 |
Author: | Measter [ Sat Nov 15, 2014 10:49 pm ] |
Post subject: | Re: is there any other loop..?? |
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, ... |
Page 1 of 1 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |