EASy68K  
It is currently Fri Jun 05, 2020 7:15 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: task #19
PostPosted: Tue Jan 25, 2011 8:51 pm 
Offline

Joined: Sun Jan 23, 2011 1:17 pm
Posts: 1
Hi sir.
I want to use task #19 of trap #15 for writing Tetris game. I have a problem in reading the state of Arrow keys from keyboard. I use an infinite loop as below:

Code:
repeat
move.l   #$25262728,D1
move.w   #19,D0
trap     #15
lsr.l          #8,D1
if.b D1 <ne> #0 then.s   *if Right arrow pressed
*code for moving right
endi
until.l D1 <ne> #0 do


but it executes the code for moving right infinitely, by pressing the key just one time. would you please tell me where the problem is?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 26, 2011 2:45 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1122
Your code works as expected when I run it. It loops until I press the right arrow key.

_________________
Prof. Kelly


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 10 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:  
Powered by phpBB® Forum Software © phpBB Group