EASy68K  
It is currently Thu Jun 22, 2017 12:16 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Fri Nov 14, 2014 5:33 am 
Offline

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..

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,......................................


Top
 Profile  
 
PostPosted: Sat Nov 15, 2014 2:59 am 
Offline
User avatar

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

_________________
Prof. Kelly


Top
 Profile  
 
PostPosted: Sat Nov 15, 2014 6:30 am 
Offline

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:
    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


Top
 Profile  
 
PostPosted: Sat Nov 15, 2014 10:49 pm 
Offline

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
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group