EASy68K  
It is currently Sun Nov 17, 2019 5:58 am

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: switches and leds
PostPosted: Sun Apr 05, 2009 3:54 pm 
Offline

Joined: Sun Apr 05, 2009 3:45 pm
Posts: 1
Location: greece
hello everyone
i just need some help with the program
i have this simple switch read and led out programm and i need to see this work on the easy68k
is there the 8 switches that can give '1' or '0' and to take the result on leds?
im using the 68230 pi/t and i dont know if this program is only for the 68000.
this is the programm:
Code:
        ORG $400400
LEDS_1  MOVEA.L #$800001,A0
        MOVE.B #$80,$C(A0)
        MOVE.B #$0,$4(A0)
        MOVE.B #$80,$E(A0)
        MOVE.B #$FF,$6(A0)
        MOVE.B #0,$12(A0)
READ    MOVE.B $10(A0),D0 //reads the switches
        MOVE.B D0,$12(A0) //opens the leds
        BRA READ
        END 400400

is there any other command i need to enter to the program to make it work on the 68k and to give me the led output?
thanks


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 05, 2009 7:47 pm 
Offline

Joined: Mon Dec 27, 2004 11:40 pm
Posts: 318
The LEDs and switches in EASy68K are far easier to use then the 68230. You don't need all the register setup that the PI/T requires but there is still some setup.

Code:
      ORG   $1000

start
      MOVEQ       #0,d1             * open the hardware window
      MOVEQ       #32,d0            * simulator hardware command
      TRAP        #15

      MOVEQ       #2,d1             * get the LEDs address
      MOVEQ       #32,d0            * simulator hardware command
      TRAP        #15

      MOVEA.l     d1,a0             * copy the LEDs address to a0

      MOVEQ       #3,d1             * get the switches address
      MOVEQ       #32,d0            * simulator hardware command
      TRAP        #15

      MOVEA.l     d1,a1             * copy the switches address to a1
read
      MOVE.b      (a1),(a0)         * copy the switch byte to the LEDs
      BRA.s       read              * loop forever

      END   start

If you open the hardware window and set the addresses of the LEDs and switches by hand before you run the code the whole program can be reduced to ..

Code:
      ORG   $1000

start
      LEA         #00E00010,a0      * save the LEDs address to a0
      LEA         #00E00012,a1      * save the switches address to a1
read
      MOVE.b      (a1),(a0)         * copy the switch byte to the LEDs
      BRA.s       read              * loop forever

      END   start

Lee.


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