EASy68K  
It is currently Thu Apr 09, 2020 6:55 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: make buttons
PostPosted: Mon Dec 30, 2013 7:13 pm 
Offline

Joined: Tue Dec 17, 2013 6:19 pm
Posts: 3
hi all.
i'm working on a program that simulates stack data structure.
is that true to make 2 buttons for pop and push graphicaly?
or there is instruction to make button?
i graphically did that.
now i cant mange them.
any can help me?
here is my code:
Code:
   ORG    $1000
START:                  ; first instruction of program
   
    MOVE.L #$00FF0000 , D1
    MOVE #81 , D0
    TRAP #15            ; fill color with blue
   
    MOVE #0 , D1
    MOVE #0 , D2
    move #89 ,d0
    trap #15            ; background color with blue
    ;..............................................
    MOVE.L #$00FF0000 , D1
    MOVE #81 , D0
    TRAP #15            ; set pen color to ...
   
    MOVE #0 , D1       
    MOVE #30 , D2
    MOVE #640 , D3
    MOVE #30 , D4
    MOVE #87 , D0
    TRAP #15            ; rectangle
   
    MOVE.L #$00000000  , D1
    MOVE #80 , D0
    TRAP #15            ; set pen color  black.
   
    MOVE #250 , D1
    MOVE #10 , D2
    LEA ata , A1
    MOVE #95 , D0
    TRAP #15            ; writ'Ata' on rectangle
    ;...............................................
    MOVE.L #$000000FF , D1
    MOVE #81 , D0
    TRAP #15            ; set pen color to red
   
    MOVE #20 , D1       
    MOVE #50 , D2
    MOVE #100 , D3
    MOVE #100 , D4
    MOVE #87 , D0
    TRAP #15            ; rectangle
   
    MOVE.L #$00000000  , D1
    MOVE #80 , D0
    TRAP #15            ; set pen color  black.
   
    MOVE #43 , D1
    MOVE #70 , D2
    LEA push , A1
    MOVE #95 , D0
    TRAP #15            ; write 'push' on rectangle
   
   
   
    MOVE.L #$00008000 , D1
    MOVE #81 , D0
    TRAP #15            ; set pen color to green
   
    MOVE #120 , D1
    MOVE #50 , D2
    MOVE #200 , D3
    MOVE #100 , D4
    MOVE #87 , D0
    TRAP #15            ; rectangle

    MOVE.L #$00000000  , D1
    MOVE #80 , D0
    TRAP #15            ; set pen color  black.
   
    MOVE #143 , D1
    MOVE #70 , D2
    LEA pop , A1
    MOVE #95 , D0
    TRAP #15            ; write 'pop' on rectangle
   
    ;[[[[[[[[[[[[[[[[[mouse]]]]]]]]]]]]]]]]]
   
   
    MOVE.L #mouseDownIRQ , $64
    ANDI.W #$00 , SR
   
    MOVE.B #60 , D0
    MOVE #$0101 , D1
    TRAP #15
     
mouseDownIRQ
    MOVEM.L D0-D1 , -(A7)
    MOVE.B #61 , D0
    MOVE.B #2 , D1
    TRAP #15
    BSR action
    MOVEM.L (A7)+ , D0-D1
    RTE
   
action
    MOVEM.L D0-D4/A1 , -(A7)
    MOVE.L D0 , D4
    MOVE D1 , D3
    AND.L #$0000FFFF , D1
    MOVE.L D1 , D6
   
    MOVE.L D3 , D1
    SWAP D1
    AND.L #$0000FFFF , D1
    MOVE.L D1 , D7
    IF.L D6 <GE> #20 THEN.S
     IF.L D6 <LE>  #100 THEN.S
      IF.L D7 <GE> #50 THEN.S
       IF.L D7 <LE>  #100 THEN.S
                BSR pushAction
       ENDI
      ENDI       
     ENDI           
    ENDI
    ;.............................
    IF.L D6 <GE> #120 THEN.S
     IF.L D6 <LE>  #200 THEN.S
      IF.L D7 <GE> #50 THEN.S
       IF.L D7 <LE>  #100 THEN.S
                BSR popAction
       ENDI
      ENDI       
     ENDI           
    ENDI
    RTS
pushAction
    MOVE.L #$00FF0000 , D1
    MOVE #81 , D0
    TRAP #15            ; fill color with blue
   
    MOVE #0 , D1
    MOVE #0 , D2
    move #89 ,d0
    trap #15 
   
    MOVE #14 , D0
    LEA entermsg , A1
    TRAP #15
    RTS
popAction
    LEA entermsg , A1
    MOVE #14  ,D0
    TRAP #15
    RTS
* Put program code here

    SIMHALT             ; halt simulator

* Put variables and constants here
push DC.B 'Push' , 0
pop DC.B 'Pop' , 0
ata DC.B 'Ata Stack Simuator' , 0
entermsg DC.B 'Enter your Number : ' , 0
    END    START        ; last line of source




Top
 Profile  
 
 Post subject: Re: make buttons
PostPosted: Thu Jan 02, 2014 8:17 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1118
Conway's Life, and several of the other example programs contain code that creates buttons.

_________________
Prof. Kelly


Top
 Profile  
 
 Post subject: Re: make buttons
PostPosted: Sun Jan 05, 2014 11:55 am 
Offline

Joined: Tue Dec 17, 2013 6:19 pm
Posts: 3
Thank for reply , can you give me another simple example ?


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 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