EASy68K  
It is currently Sat Apr 04, 2020 8:32 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: A loop of some sort?
PostPosted: Mon Mar 13, 2006 10:19 pm 
Offline

Joined: Mon Mar 13, 2006 10:17 pm
Posts: 2
I am trying to get a loop of some sort to work in easy 68k and it isn't coming to me easily (like most things I suppose :p)
The kind of loop I mean is that it keeps looping around and asking for user input until the user enters a accepted character (it must be a lower case letter, so some way of doing a range of all the ascii codes that cover lower case letters?)

Does anyone know of where I would start here?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 14, 2006 1:06 am 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1118
Something like this is what you want. I realize I'm probably helping you with your homework but you caught me in a good mood :)

Code:
   
START   ORG   $1000

   move.b   #14,d0   Display 'Enter choice' prompt
   lea   promptMsg,a1
   trap   #15

   move.b   #5,d0   get character input in D1.B
   trap   #15

   cmp   #'a',d1   if < 'a'
   blt   start
   cmp   #'z',d1   if > 'z'
   bgt   start

* rest of code goes here

   STOP   #$2000

CR   EQU   $0D
LF   EQU   $0A
promptMsg   dc.b   CR,LF,'Enter choice: ',0
   END   START

_________________
Prof. Kelly


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 15, 2006 9:45 pm 
Offline

Joined: Mon Mar 13, 2006 10:17 pm
Posts: 2
eep thats not helping with it thats doing it for me :p

Thanks.

It doesn't work for me though, what I'm after really is pointers in the right direction.
What is the command for comparing?
How would you do if (whatever) > a for example?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 16, 2006 1:13 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1118
Go to the EASy68K Help and look at the help for the CMP instruction in:
    Jimmy Mardell's 68000 Reference Guide
    .....Instruction Summary
    ..........Integer Arithmetic

_________________
Prof. Kelly


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: Majestic-12 [Bot] and 7 guests


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