;Maus-Demo by Marcus Roming. Siehe readme.txt.
.MODEL TINY
.CODE
.486
INCLUDE Window.inc
ButtonPos EQU (16 *160 )+(11 *2 ) ;2582 ;Def.:2582 [(Line*160)+(Col*2)]
Button2Pos EQU (16 *160 )+(55 *2 )
InBoxPos EQU (10 *160 )+(30 *2 )
ORG 100 h
Start:
jmp weiter
Text DB "Beenden mit OK...$"
Text2 DB "OK$"
Text3 DB "Pingen!$"
InText DB "Input:$"
Puffer STRUC ;Stuktur definieren
Max DB 20 ;Maximale Anzahl Zeichen
Anz DB ? ;Fkt gibt hier die Anz. der eingegebenen Zeichen rein Txt DB 53 DUP ($) ;Hier der eigentliche Text
Puffer ENDS
BufStrc Puffer <> ;Speicherplatz fuer Puffer!
Weiter:
InitGraph
DrawBackground
DrawMainWindow
PrintText 3 ,2 ,Text
SetCursor 0 ,0
StartMouse
Nichts: DrawButtonShdw 3 ,10 ,ButtonPos,Text2,14 ;Breite,Höhe,Position,Text,TextXPos.
;DrawButtonShdw 4,11,Button2Pos ;Ohne Text
DrawButtonShdw 3 ,11 ,Button2Pos,Text3,56
MouseLoop: mov ax,03 h
int 33 h
cmp bx,00 h ;wenn nicht gedrückt: 0!
je LoeschenLoop ;Buttonpos: X: 11,
cmp cx,10 *8 ;X Mausclick auf Button? (11-1) |
jl LoeschenLoop ;Nein! |
cmp dx,15 *8 ;Y (16-1) |
jl LoeschenLoop ;Nein! | Button Ok
cmp cx,((10 +10 )*8 )-1 ;X ((11-1 + 10)*8)-1 |
jg LoeschenLoop ;Nein! |
cmp dx,17 *8 ;Y (16-1 + 3)*8 |
jg LoeschenLoop ;Nein! |
jmp OkPressed
LoeschenLoop: mov ax,03 h ;Nächsten Knopf Testen!
int 33 h
cmp bx,00 h ;wenn nicht gedrückt: 0!
je MouseLoop ;Buttonpos: X: 11,
cmp cx,54 *8 ;X Mausclick auf Button? (11-1) |
jl MouseLoop ;Nein! |
cmp dx,15 *8 ;Y (16-1) |
jl MouseLoop ;Nein! | Button Pingen
cmp cx,((54 +11 )*8 )-1 ;X ((11-1 + 10)*8)-1 |
jg MouseLoop ;Nein! |
cmp dx,17 *8 ;Y (16-1 + 3)*8 |
jg MouseLoop ;Nein! |
;Ja: Taste wird gedrückt --> Effekt
;DrawButtonPress 4,11,Window2Pos
DelPressed: DrawButtonPress 3 ,11 ,Button2Pos,Text3,56
DelLoop: mov ax,03 h
int 33 h
cmp bx,00 h
jne DelLoop ;Warten bis taste losgelassen wird...
mov ax,03 h ;Ist Maus noch über dem Button ?
int 33 h
cmp cx,54 *8 ;X |
jl Nichts ;Nein! |
cmp dx,15 *8 ;Y |
jl Nichts ;Nein! | Button Pingen
cmp cx,((54 +11 )*8 )-1 ;X |
jg Nichts ;Nein! |
cmp dx,17 *8 ;Y |
jg Nichts ;Nein! |
mov ax,0 E07h ;Funktion 0E Zeichen "bel" | CODE
int 10 h ;Einmal piepen bitte... | CODE
InputBox BufStrc,InBoxPos,30 ,InText,31 ;EXPERIMENTAL
SetCursor 3 ,3
mov bx,OFFSET BufStrc
add bx,02 h
add bl,BufStrc.Anz ;Ans Ende des Textes!
mov byte ptr cs :[bx],"$" ;$ fuer Fkt. 09h anhaengen
lea dx,BufStrc.Txt ;dx auf den Text
mov ah,09 h
int 21 h ;Text ausgeben
;;TEXT AUSGEBEN!!
jmp Weiter2
OkPressed: DrawButtonPress 3 ,10 ,ButtonPos,Text2,14
Weiter2:
;Ende: Effekt
MouseLoop2: mov ax,03 h
int 33 h
cmp bx,00 h
jne MouseLoop2 ;Warten bis taste losgelassen wird...
mov ax,03 h ;Ist Maus noch über dem Button ?
int 33 h
cmp cx,10 *8 ;X |
jl Nichts ;Nein! |
cmp dx,15 *8 ;Y |
jl Nichts ;Nein! | Button Ok
cmp cx,((10 +10 )*8 )-1 ;X |
jg Nichts ;Nein! |
cmp dx,17 *8 ;Y |
jg Nichts ;Nein! |
;Ja!
StopMouse
ExitAll
END Start
Messung V0.5 in Prozent C=52 H=44 G=47
¤ Dauer der Verarbeitung: 0.7 Sekunden
(vorverarbeitet am 2026-06-05)
¤
*© Formatika GbR, Deutschland