/programs/develop/examples/optionbox/trunk/optbox.inc |
---|
File deleted |
\ No newline at end of file |
/programs/develop/examples/optionbox/trunk/optxampl.asm |
---|
File deleted |
/programs/develop/examples/optionbox/trunk/build.bat |
---|
File deleted |
\ No newline at end of file |
/programs/develop/examples/optionbox/trunk/macros.inc |
---|
File deleted |
\ No newline at end of file |
/programs/develop/examples/checkbox/trunk/check.inc |
---|
36,7 → 36,7 |
macro use_check_box |
{ |
ch_text_margin=4 ;à ááâ®ï¨¥ ®â ¯àאַ㣮«ì¨ª 祪 ¡®ªá ¤® ¤¯¨á¨ |
ch_size=12 ;à §¬¥à ª¢ ¤à â 祪 ¡®ªá |
ch_size=11 ;à §¬¥à ª¢ ¤à â 祪 ¡®ªá |
check_box: |
.draw: |
pusha ;á®åà ¨¬ ¢á¥ ॣ¨áâàë |
66,7 → 66,7 |
add ebx,(ch_size+ch_text_margin) ;¤®¡ ¢¨âì à §¬¥à áâ®à®ë ¨ à ááâ®ï¨¥ ª®â®à®¬ ç¥âáï ¢ë¢®¤ ⥪áâ |
shl ebx,16 ;ᤢ¨¥¬ 16 à §à冷¢ ¢ «¥¢® (㬮¦¨¬ 65536) |
mov bx,ch_top ;§ £à㧨¬ § 票¥ ¯® y |
add ebx,(ch_size-9+2) ;¤®¡ ¢¨¬ § 票¥ ¤«¨ë áâ®à®ë -9+2 |
add ebx,(ch_size-9+1) ;¤®¡ ¢¨¬ § 票¥ ¤«¨ë áâ®à®ë -9+1 |
mov ecx,ch_text_color ;§ £à㧨¬ 梥⠤¯¨á¨ |
mov edx,ch_text_ptr ;㪠¦¥¬ ¤à¥á ®â ªã¤ 㦮 ¢ë¢®¤¨âì áâபã |
85,7 → 85,7 |
mov edx,ch_border_color ;§ £à㧨âì 梥â |
@@: |
movzx ebx,word ch_left ;§ £à㧨âì ª®®à¤¨ âã ¯® å |
add ebx,(ch_size/4) ;¤®¡ ¢¨âì (áâ®à® ¯àאַ㣮«ì¨ª /3) |
add ebx,(ch_size/3) ;¤®¡ ¢¨âì (áâ®à® ¯àאַ㣮«ì¨ª /3) |
shl ebx,16 ;ᤢ¨¥¬ 16 à §à冷¢ ¢ «¥¢® (㬮¦¨¬ 65536) |
mov bx,(ch_size/2) ;§ £à㧨âì (áâ®à® ¯àאַ㣮«ì¨ª /2) |
mov bp,bx ;á®åà ¨¬ ॣ¨áâà bx ¢ ॣ¨áâॠ㪠§ â¥«ï ¡ §ë |
92,7 → 92,7 |
;push bx |
movzx ecx,word ch_top ;§ £à㧨âì ª®®à¤¨ âã ¯® ã |
mov eax,13 ;¢ eax - § 票ï äãªæ¨¨ ¤«ï ¢ë¢®¤ ¯®«®áë â.¥. ¯® áã⨠¯àאַ㣮«ì¨ª , ª®â®àë© ®â®¡à ¦ ¥â ¢ª«îç¥ë© ª®¬¯®¥â 祪 ¡®ªá |
add ecx,(ch_size/4) ;¤®¡ ¢¨âì (áâ®à® ¯àאַ㣮«ì¨ª /3) |
add ecx,(ch_size/3) ;¤®¡ ¢¨âì (áâ®à® ¯àאַ㣮«ì¨ª /3) |
shl ecx,16 ;ᤢ¨¥¬ 16 à §à冷¢ ¢ «¥¢® (㬮¦¨¬ 65536) |
mov cx,bp ;§ £à㧨¬ § 票ï ॣ¨áâà 㪠§ â¥«ï ¡ §ë ¢ cx |
;pop cx |
/programs/develop/examples/radiobutton/trunk/optionbox.asm |
---|
74,6 → 74,7 |
or edx,0xb3000000 |
mov edi,hed |
int 0x40 ; à¨á®¢ âì ®ª® ¯à¨«®¦¥¨ï |
draw_option_boxes option_boxes,option_boxes_end ;à¨á®¢ ¨¥ 祪¡®ªá®¢ |
mov eax,12 ;ãªæ¨ï 12 - ç âì/§ ª®ç¨âì ¯¥à¥à¨á®¢ªã ®ª . |
/programs/develop/examples/radiobutton/trunk/optionbox.bat |
---|
1,3 → 1,4 |
@fasm.exe optionbox.asm optionbox |
@kpack.exe optionbox |
REM @klbrinwin.exe optionbox |
REM @klbrinwin.exe optionbox |
@pause |
/programs/develop/examples/radiobutton/trunk/optionbox.inc |
---|
39,7 → 39,7 |
.draw: |
pusha ;á®åà ¨¬ ¢á¥ ॣ¨áâàë |
op_text_margin=4 ;à ááâ®ï¨¥ ®â ¯àאַ㣮«ì¨ª 祪 ¡®ªá ¤® ¤¯¨á¨ |
op_size=12 ;à §¬¥à ª¢ ¤à â 祪 ¡®ªá |
op_size=11 ;à §¬¥à ª¢ ¤à â 祪 ¡®ªá |
mov eax,13 |
mov ebx,op_left |
shl ebx,16 |
67,7 → 67,7 |
add ebx,(op_size+op_text_margin) ;¤®¡ ¢¨âì à §¬¥à áâ®à®ë ¨ à ááâ®ï¨¥ ª®â®à®¬ ç¥âáï ¢ë¢®¤ ⥪áâ |
shl ebx,16 ;ᤢ¨¥¬ 16 à §à冷¢ ¢ «¥¢® (㬮¦¨¬ 65536) |
mov bx,op_top ;§ £à㧨¬ § 票¥ ¯® y |
add ebx,(op_size-9+2) ;¤®¡ ¢¨¬ § 票¥ ¤«¨ë áâ®à®ë -9+2 |
add ebx,(op_size-9+1) ;¤®¡ ¢¨¬ § 票¥ ¤«¨ë áâ®à®ë -9+1 |
mov ecx,op_text_color ;§ £à㧨¬ 梥⠤¯¨á¨ |
mov edx,op_text_ptr ;㪠¦¥¬ ¤à¥á ®â ªã¤ 㦮 ¢ë¢®¤¨âì áâபã |
87,7 → 87,7 |
mov edx,op_border_color ;§ £à㧨âì 梥â |
@@: |
movzx ebx,word op_left ;§ £à㧨âì ª®®à¤¨ âã ¯® å |
add ebx,(op_size/4) ;¤®¡ ¢¨âì (áâ®à® ¯àאַ㣮«ì¨ª /3) |
add ebx,(op_size/3) ;¤®¡ ¢¨âì (áâ®à® ¯àאַ㣮«ì¨ª /3) |
shl ebx,16 ;ᤢ¨¥¬ 16 à §à冷¢ ¢ «¥¢® (㬮¦¨¬ 65536) |
mov bx,(op_size/2) ;§ £à㧨âì (áâ®à® ¯àאַ㣮«ì¨ª /2) |
mov bp,bx ;á®åà ¨¬ ॣ¨áâà bx ¢ ॣ¨áâॠ㪠§ â¥«ï ¡ §ë |
94,7 → 94,7 |
;push bx |
movzx ecx,word op_top ;§ £à㧨âì ª®®à¤¨ âã ¯® ã |
mov eax,13 ;¢ eax - § 票ï äãªæ¨¨ ¤«ï ¢ë¢®¤ ¯®«®áë â.¥. ¯® áã⨠¯àאַ㣮«ì¨ª , ª®â®àë© ®â®¡à ¦ ¥â ¢ª«îç¥ë© ª®¬¯®¥â 祪 ¡®ªá |
add ecx,(op_size/4) ;¤®¡ ¢¨âì (áâ®à® ¯àאַ㣮«ì¨ª /3) |
add ecx,(op_size/3) ;¤®¡ ¢¨âì (áâ®à® ¯àאַ㣮«ì¨ª /3) |
shl ecx,16 ;ᤢ¨¥¬ 16 à §à冷¢ ¢ «¥¢® (㬮¦¨¬ 65536) |
mov cx,bp ;§ £à㧨¬ § 票ï ॣ¨áâà 㪠§ â¥«ï ¡ §ë ¢ cx |
int 0x40 ;¢ë¢®¤ |
/programs/develop/examples/template/trunk/build_en.bat |
---|
1,4 → 1,5 |
@erase lang.inc |
@echo lang fix en >lang.inc |
@fasm template.asm template |
@erase lang.inc |
@pause |
/programs/develop/examples/template/trunk/build_fr.bat |
---|
0,0 → 1,5 |
@erase lang.inc |
@echo lang fix fr >lang.inc |
@fasm template.asm template |
@erase lang.inc |
@pause |
/programs/develop/examples/template/trunk/build_ru.bat |
---|
1,4 → 1,5 |
@erase lang.inc |
@echo lang fix ru >lang.inc |
@fasm template.asm template |
@erase lang.inc |
@pause |
/programs/develop/examples/template/trunk/macros.inc |
---|
123,8 → 123,10 |
end if |
} |
macro __mov reg,a { ; mike.dld |
if ~a eq |
macro __mov reg,a,b { ; mike.dld |
if (~a eq)&(~b eq) |
mpack reg,a,b |
else if (~a eq)&(b eq) |
mov reg,a |
end if |
} |
141,11 → 143,6 |
; language for programs |
lang fix ru ; ru en fr ge fi |
; optimize the code for size |
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp> |
177,7 → 174,7 |
macro mov arg1,arg2 |
{ |
if (arg1 in __regs) & (arg2 eqtype 0) |
if (arg1 in __regs) & ((arg2 eqtype 0) | (arg2 eqtype '0')) |
if (arg2) = 0 |
xor arg1,arg1 |
else if (arg2) = 1 |
221,7 → 218,13 |
.x_size dd ? ; +42 |
.y_size dd ? ; +46 |
.slot_state dw ? ; +50 |
rb (1024-52) |
dw ? ; +52 - reserved |
.client_left dd ? ; +54 |
.client_top dd ? ; +58 |
.client_width dd ? ; +62 |
.client_height dd ? ; +66 |
.wnd_state db ? ; +70 |
rb (1024-71) |
} |
struct process_information |
/programs/develop/examples/template/trunk/template.asm |
---|
1,12 → 1,12 |
; <--- description ---> |
; compiler: FASM 1.50 |
; name: Basic window example for MenuetOS |
; version: 1.01 |
; last update: 25/08/2004 |
; compiler: FASM 1.67 |
; name: Basic window example for KolibriOS |
; version: 1.02 |
; last update: 1/03/2007 |
; written by: Ivan Poddubny |
; e-mail: ivan-yar@bk.ru |
;modified by: Heavyiron |
; <--- include all MeOS stuff ---> |
include "lang.inc" |
include "macros.inc" |
18,36 → 18,28 |
; <--- start of code ---> |
CODE |
call draw_window ; at first create and draw the window |
wait_event: ; main cycle |
mov eax, 10 |
mov eax,48 ; get system colors |
mov ebx,3 |
mov ecx,sc |
mov edx,sizeof.system_colors |
int 0x40 |
cmp eax, 1 ; if event == 1 |
je redraw ; jump to redraw handler |
cmp eax, 2 ; else if event == 2 |
je key ; jump to key handler |
cmp eax, 3 ; else if event == 3 |
je button ; jump to button handler |
jmp wait_event ; else return to the start of main cycle |
redraw: ; redraw event handler |
call draw_window |
jmp wait_event |
call draw_window ; at first create and draw the window |
key: ; key event handler |
mov eax, 2 ; get key code |
wait_event: ; main cycle |
mov eax, 10 |
int 0x40 |
jmp wait_event |
dec eax ; if event = 1 |
jz redraw ; jump to redraw handler |
dec eax ; else if event = 2 |
jz key ; jump to key handler |
button: ; button event handler |
mov eax, 17 ; get button identifier |
mov al, 17 ; get button identifier |
int 0x40 |
cmp ah, 1 |
56,27 → 48,25 |
or eax, -1 ; exit application |
int 0x40 |
key: ; key event handler |
mov al, 2 ; get key code |
int 0x40 |
jmp wait_event |
draw_window: |
mov eax, 12 ; start drawing |
mov ebx, 1 |
int 0x40 |
mov eax, 0 ; create and draw the window |
mov ebx, 100*65536+300 ; (window_cx)*65536+(window_sx) |
mov ecx, 100*65536+200 ; (window_cy)*65536+(window_sy) |
mov edx, 0x03ffffff ; work area color & window type 3 |
; mov esi, 0 ; grab color (not used) |
; mov edi, 0 ; frame color (not used) |
xor eax, eax ; create and draw the window |
mov ebx, 100*65536+200 ; (window_cx)*65536+(window_sx) |
mov ecx, 100*65536+100 ; (window_cy)*65536+(window_sy) |
mov edx, [sc.work] ; work area color |
or edx, 0x33000000 ; & window type 3 |
mov edi, header ; window header |
int 0x40 |
mov eax, 4 ; window header |
mov ebx, 8*65536+8 ; coordinates |
mov ecx, 0x10ffffff ; color & font N1 |
mov edx, header ; address of text |
mov esi, header.size ; length of text |
int 0x40 |
mov eax, 12 ; finish drawing |
mov ebx, 2 |
int 0x40 |
83,20 → 73,20 |
ret |
; <--- initialised data ---> |
DATA |
lsz header,\ |
ru, " ¡«® ¯à®£à ¬¬ë",\ |
en, "Template program",\ |
fr, "La programme poncive" |
if lang eq ru |
header db ' ¡«® ¯à®£à ¬¬ë',0 |
else if lang eq fr |
header db 'La programme poncive',0 |
else |
header db 'Template program',0 |
end if |
; <--- uninitialised data ---> |
UDATA |
sc system_colors |
MEOS_APP_END |
; <--- end of MenuetOS application ---> |