EASy68K
http://www.easy68k.com/EASy68Kforum/

make buttons
http://www.easy68k.com/EASy68Kforum/viewtopic.php?f=6&t=1277
Page 1 of 1

Author:  AtaFatahi [ Mon Dec 30, 2013 7:13 pm ]
Post subject:  make buttons

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



Author:  profkelly [ Thu Jan 02, 2014 8:17 pm ]
Post subject:  Re: make buttons

Conway's Life, and several of the other example programs contain code that creates buttons.

Author:  AtaFatahi [ Sun Jan 05, 2014 11:55 am ]
Post subject:  Re: make buttons

Thank for reply , can you give me another simple example ?

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/