2014-03-07 07:44:46 +01:00
|
|
|
|
;-------------------------------------------------------------------------------
|
2011-01-30 16:54:21 +01:00
|
|
|
|
;
|
|
|
|
|
; PROTECTION TEST
|
|
|
|
|
;
|
2014-03-07 07:44:46 +01:00
|
|
|
|
;-------------------------------------------------------------------------------
|
|
|
|
|
; last update: 07/03/2014
|
|
|
|
|
; changed by: Marat Zakiyanov aka Mario79, aka Mario
|
|
|
|
|
; changes: Optimisations and code refactoring.
|
|
|
|
|
; Reducing the consumption of RAM, 4 KB instead of 64 KB.
|
|
|
|
|
; Translation into Russian.
|
|
|
|
|
;---------------------------------------------------------------------
|
2011-01-30 16:54:21 +01:00
|
|
|
|
use32
|
2020-05-05 14:09:37 +02:00
|
|
|
|
org 0x0
|
2014-03-07 07:44:46 +01:00
|
|
|
|
|
2020-05-05 14:09:37 +02:00
|
|
|
|
db 'MENUET01' ; 8 byte id
|
|
|
|
|
dd 0x01 ; header version
|
|
|
|
|
dd START ; start of code
|
|
|
|
|
dd I_END ; size of image
|
|
|
|
|
dd IM_END ; memory for app
|
|
|
|
|
dd stack_top ; esp
|
|
|
|
|
dd 0x0 ; I_Param
|
|
|
|
|
dd 0x0 ; I_Icon
|
2014-03-07 07:44:46 +01:00
|
|
|
|
;-------------------------------------------------------------------------------
|
2011-02-01 14:10:42 +01:00
|
|
|
|
include '../../../macros.inc'
|
2013-06-11 15:30:05 +02:00
|
|
|
|
include 'lang.inc'
|
2014-03-07 07:44:46 +01:00
|
|
|
|
;-------------------------------------------------------------------------------
|
2020-05-05 14:09:37 +02:00
|
|
|
|
START: ; start of execution
|
|
|
|
|
red: ; redraw
|
|
|
|
|
call draw_window ; at first, draw the window
|
2014-03-07 07:44:46 +01:00
|
|
|
|
;-------------------------------------------------------------------------------
|
2011-01-30 16:54:21 +01:00
|
|
|
|
still:
|
2020-05-05 14:09:37 +02:00
|
|
|
|
mcall 10 ; wait here for event
|
|
|
|
|
cmp eax,1 ; redraw request ?
|
|
|
|
|
jz red
|
2014-03-07 07:44:46 +01:00
|
|
|
|
|
2020-05-05 14:09:37 +02:00
|
|
|
|
cmp eax,3 ; button in buffer ?
|
|
|
|
|
jz button
|
|
|
|
|
|
|
|
|
|
cmp eax,2 ; key in buffer ?
|
|
|
|
|
jnz still
|
2014-03-07 07:44:46 +01:00
|
|
|
|
;-------------------------------------------------------------------------------
|
|
|
|
|
key:
|
2020-05-05 14:09:37 +02:00
|
|
|
|
mcall 2 ; just read it and ignore
|
|
|
|
|
jmp still
|
2014-03-07 07:44:46 +01:00
|
|
|
|
;-------------------------------------------------------------------------------
|
|
|
|
|
button:
|
2020-05-05 14:09:37 +02:00
|
|
|
|
mcall 17
|
|
|
|
|
cmp ah,1 ; button id=1 ?
|
|
|
|
|
jnz noclose
|
2014-03-07 07:44:46 +01:00
|
|
|
|
|
2020-05-05 14:09:37 +02:00
|
|
|
|
mcall -1 ; close this program
|
2014-03-07 07:44:46 +01:00
|
|
|
|
;-------------------------------------------------------------------------------
|
|
|
|
|
noclose:
|
2020-05-05 14:09:37 +02:00
|
|
|
|
cmp ah,2
|
|
|
|
|
jnz notest2
|
|
|
|
|
cli
|
2014-03-07 07:44:46 +01:00
|
|
|
|
;-------------------------------------------------------------------------------
|
|
|
|
|
notest2:
|
2020-05-05 14:09:37 +02:00
|
|
|
|
cmp ah,3
|
|
|
|
|
jnz notest3
|
|
|
|
|
sti
|
2014-03-07 07:44:46 +01:00
|
|
|
|
;-------------------------------------------------------------------------------
|
|
|
|
|
notest3:
|
2020-05-05 14:09:37 +02:00
|
|
|
|
cmp ah,4
|
|
|
|
|
jnz notest4
|
|
|
|
|
mov [0x10000],byte 1
|
|
|
|
|
;-------------------------------------------------------------------------------
|
2014-03-07 07:44:46 +01:00
|
|
|
|
notest4:
|
2020-05-05 14:09:37 +02:00
|
|
|
|
cmp ah,5
|
|
|
|
|
jnz notest5
|
|
|
|
|
jmp dword 0x10000
|
2014-03-07 07:44:46 +01:00
|
|
|
|
;-------------------------------------------------------------------------------
|
|
|
|
|
notest5:
|
2020-05-05 14:09:37 +02:00
|
|
|
|
cmp ah,6
|
|
|
|
|
jnz notest6
|
|
|
|
|
mov esp,0
|
|
|
|
|
push eax
|
2014-03-07 07:44:46 +01:00
|
|
|
|
;-------------------------------------------------------------------------------
|
|
|
|
|
notest6:
|
2020-05-05 14:09:37 +02:00
|
|
|
|
cmp ah,7
|
|
|
|
|
jnz notest7
|
|
|
|
|
in al,0x60
|
2014-03-07 07:44:46 +01:00
|
|
|
|
;-------------------------------------------------------------------------------
|
|
|
|
|
notest7:
|
2020-05-05 14:09:37 +02:00
|
|
|
|
cmp ah,8
|
|
|
|
|
jnz still
|
|
|
|
|
out 0x60,al
|
|
|
|
|
jmp still
|
2014-03-07 07:44:46 +01:00
|
|
|
|
;-------------------------------------------------------------------------------
|
2011-01-30 16:54:21 +01:00
|
|
|
|
; *********************************************
|
|
|
|
|
; ******* WINDOW DEFINITIONS AND DRAW ********
|
|
|
|
|
; *********************************************
|
2014-03-07 07:44:46 +01:00
|
|
|
|
;-------------------------------------------------------------------------------
|
2011-01-30 16:54:21 +01:00
|
|
|
|
draw_window:
|
2020-05-05 14:09:37 +02:00
|
|
|
|
;mcall 48,3,sys_colors,40
|
|
|
|
|
mcall 12,1
|
|
|
|
|
mcall 0,<200,370>,<200,295>,0x14FFFFFF,,tlabel
|
|
|
|
|
mcall 8, <36,15>, <88,15>, 2, 0x6888B8
|
2014-03-07 07:44:46 +01:00
|
|
|
|
.newb:
|
2020-05-05 14:09:37 +02:00
|
|
|
|
mcall
|
|
|
|
|
add ecx,26*65536
|
|
|
|
|
inc edx
|
|
|
|
|
cmp edx,9
|
|
|
|
|
jb .newb
|
2014-03-07 07:44:46 +01:00
|
|
|
|
|
2020-05-05 14:09:37 +02:00
|
|
|
|
cld
|
|
|
|
|
mov ebx,26*65536+37 ; draw info text with function 4
|
|
|
|
|
mov ecx,0x10000000
|
|
|
|
|
mov edx,text
|
|
|
|
|
mov esi,40
|
|
|
|
|
|
|
|
|
|
mov eax,4
|
2014-03-07 07:44:46 +01:00
|
|
|
|
.newline:
|
2020-05-05 14:09:37 +02:00
|
|
|
|
mcall
|
|
|
|
|
add ebx,13
|
|
|
|
|
add edx,40
|
|
|
|
|
cmp [edx],byte 'x'
|
|
|
|
|
jnz .newline
|
2014-03-07 07:44:46 +01:00
|
|
|
|
|
2020-05-05 14:09:37 +02:00
|
|
|
|
mcall 12,2 ; function 12:tell os about windowdraw
|
|
|
|
|
ret
|
2014-03-07 07:44:46 +01:00
|
|
|
|
;-------------------------------------------------------------------------------
|
2011-01-30 16:54:21 +01:00
|
|
|
|
; DATA AREA
|
2014-03-07 07:44:46 +01:00
|
|
|
|
;-------------------------------------------------------------------------------
|
2013-06-11 15:30:05 +02:00
|
|
|
|
if lang eq it
|
2014-03-07 07:44:46 +01:00
|
|
|
|
text:
|
2020-05-05 14:09:37 +02:00
|
|
|
|
db 'Il programma usa 0x1000 byte di memoria '
|
|
|
|
|
db ' '
|
|
|
|
|
db 'Open debug board for rezult information '
|
|
|
|
|
db ' '
|
|
|
|
|
db ' CLI '
|
|
|
|
|
db ' '
|
|
|
|
|
db ' STI '
|
|
|
|
|
db ' '
|
|
|
|
|
db ' MOV [0x10000],BYTE 1 '
|
|
|
|
|
db ' '
|
|
|
|
|
db ' JMP DWORD 0x10000 '
|
|
|
|
|
db ' '
|
|
|
|
|
db ' MOV ESP,0 & PUSH EAX '
|
|
|
|
|
db ' '
|
|
|
|
|
db ' IN Al,0x60 '
|
|
|
|
|
db ' '
|
|
|
|
|
db ' OUT 0x60,AL '
|
|
|
|
|
db 'x'
|
2014-03-07 07:44:46 +01:00
|
|
|
|
else if lang eq ru
|
|
|
|
|
text:
|
2020-05-05 14:09:37 +02:00
|
|
|
|
db '<27>ਫ<EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0x1000 <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
|
|
|
|
db ' '
|
|
|
|
|
db '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> BOARD <20><><EFBFBD> <20><><EFBFBD>ᬮ<EFBFBD><E1ACAE><EFBFBD> १<><E0A5A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> '
|
|
|
|
|
db ' '
|
|
|
|
|
db ' CLI '
|
|
|
|
|
db ' '
|
|
|
|
|
db ' STI '
|
|
|
|
|
db ' '
|
|
|
|
|
db ' MOV [0x10000],BYTE 1 '
|
|
|
|
|
db ' '
|
|
|
|
|
db ' JMP DWORD 0x10000 '
|
|
|
|
|
db ' '
|
|
|
|
|
db ' MOV ESP,0 & PUSH EAX '
|
|
|
|
|
db ' '
|
|
|
|
|
db ' IN Al,0x60 '
|
|
|
|
|
db ' '
|
|
|
|
|
db ' OUT 0x60,AL '
|
|
|
|
|
db 'x'
|
2013-06-11 15:30:05 +02:00
|
|
|
|
else
|
2014-03-07 07:44:46 +01:00
|
|
|
|
text:
|
2020-05-05 14:09:37 +02:00
|
|
|
|
db 'Application uses 0x1000 bytes of memory '
|
|
|
|
|
db ' '
|
|
|
|
|
db 'Open debug board for result information '
|
|
|
|
|
db ' '
|
|
|
|
|
db ' CLI '
|
|
|
|
|
db ' '
|
|
|
|
|
db ' STI '
|
|
|
|
|
db ' '
|
|
|
|
|
db ' MOV [0x10000],BYTE 1 '
|
|
|
|
|
db ' '
|
|
|
|
|
db ' JMP DWORD 0x10000 '
|
|
|
|
|
db ' '
|
|
|
|
|
db ' MOV ESP,0 & PUSH EAX '
|
|
|
|
|
db ' '
|
|
|
|
|
db ' IN Al,0x60 '
|
|
|
|
|
db ' '
|
|
|
|
|
db ' OUT 0x60,AL '
|
|
|
|
|
db 'x'
|
2013-06-11 15:30:05 +02:00
|
|
|
|
end if
|
2014-03-07 07:44:46 +01:00
|
|
|
|
;-------------------------------------------------------------------------------
|
|
|
|
|
if lang eq it
|
2011-01-30 16:54:21 +01:00
|
|
|
|
tlabel:
|
2020-05-05 14:09:37 +02:00
|
|
|
|
db 'Kolibri prova di protezione',0
|
|
|
|
|
else if lang eq ru
|
2014-03-07 07:44:46 +01:00
|
|
|
|
tlabel:
|
2020-05-05 14:09:37 +02:00
|
|
|
|
db 'Kolibri <20><EFBFBD>ઠ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>',0
|
2014-03-07 07:44:46 +01:00
|
|
|
|
else
|
|
|
|
|
tlabel:
|
2020-05-05 14:09:37 +02:00
|
|
|
|
db 'Kolibri protection test',0
|
2014-03-07 07:44:46 +01:00
|
|
|
|
end if
|
|
|
|
|
;-------------------------------------------------------------------------------
|
2011-01-30 16:54:21 +01:00
|
|
|
|
I_END:
|
2014-03-07 07:44:46 +01:00
|
|
|
|
;-------------------------------------------------------------------------------
|
|
|
|
|
align 4
|
2020-05-05 14:09:37 +02:00
|
|
|
|
rb 256
|
2014-03-07 07:44:46 +01:00
|
|
|
|
stack_top:
|
|
|
|
|
;-------------------------------------------------------------------------------
|
|
|
|
|
IM_END:
|
|
|
|
|
;-------------------------------------------------------------------------------
|