4,6 → 4,7 |
;; Copyright (c) 1999-2006, Tomasz Grysztar ;; |
;; All rights reserved. ;; |
;; ;; |
;; KolibriOS port by KolibriOS Team ;; |
;; Menuet port by VT ;; |
;; ;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
19,9 → 20,8 |
;; Menuet header |
|
appname equ "flat assembler " |
|
;--------------------------------------------------------------------- |
use32 |
|
org 0x0 |
db 'MENUET01' ; 8 byte id |
dd 0x01 ; header version |
30,7 → 30,7 |
dd stacktop ; required amount of memory |
dd stacktop ; stack |
dd params,cur_dir_path ; parameters,icon |
|
;--------------------------------------------------------------------- |
include 'lang.inc' |
include '../../../macros.inc' |
purge add,sub ; macros.inc does incorrect substitution |
40,10 → 40,8 |
include '../../../develop/libraries/box_lib/load_lib.mac' |
@use_library |
|
|
|
center fix true |
|
;--------------------------------------------------------------------- |
START: ; Start of execution |
mov edi, fileinfos |
mov ecx, (fileinfos_end-fileinfos)/4 |
90,10 → 88,9 |
jne @f |
mov [_run_outfile],1 |
@@: |
|
mov [_mode],CONSOLE_MODE |
jmp start |
|
;--------------------------------------------------------------------- |
start_1: |
;sys_ |
load_libraries l_libs_start,load_lib_end |
103,15 → 100,15 |
mcall -1 ;exit if not open box_lib.obj |
@@: |
mcall 40,0x27 ;¬ ᪠á¨á⥬ëå ᮡë⨩ |
|
;--------------------------------------------------------------------- |
get_sys_colors 1,0 |
edit_boxes_set_sys_color edit1,editboxes_end,sc |
check_boxes_set_sys_color ch1_dbg,ch1_dbg+ch_struc_size,sc |
|
;--------------------------------------------------------------------- |
; OpenDialog initialisation |
push dword OpenDialog_data |
call dword [OpenDialog_Init] |
|
;--------------------------------------------------------------------- |
red: ; Redraw |
call draw_window |
|
125,7 → 122,6 |
je red ; Redraw request |
dec eax |
jne button ; Button in buffer |
|
key: ; Key |
mov al,2 ; Read it and ignore |
mcall |
136,15 → 132,13 |
call [edit_box_key] |
push dword edit3 |
call [edit_box_key] |
|
jmp still |
|
;--------------------------------------------------------------------- |
call_mouse: |
call mouse |
jmp still |
|
;--------------------------------------------------------------------- |
button: ; Button in Window |
|
mov al,17 |
mcall |
|
152,7 → 146,7 |
jne noclose |
or eax,-1 |
mcall |
|
;--------------------------------------------------------------------- |
noclose: |
cmp ah,5 ;press button for OpenDialog |
jne @f |
168,6 → 162,7 |
mcall 70,file_info_start |
; xor ecx,ecx |
jmp still |
;--------------------------------------------------------------------- |
norunout: |
cmp ah,4 |
jnz norundebug |
176,12 → 171,10 |
call make_fullpaths |
mcall 70,file_info_debug |
jmp still |
|
;--------------------------------------------------------------------- |
norundebug: |
|
jmp still |
|
|
;--------------------------------------------------------------------- |
mouse: |
push dword edit1 |
call [edit_box_mouse] |
192,14 → 185,11 |
push dword ch1_dbg |
call [check_box_mouse] |
ret |
|
;--------------------------------------------------------------------- |
draw_window: |
pusha |
|
mcall 12,1 ; Start of draw |
|
;get_sys_colors 1,0 |
|
xor eax,eax |
mov ebx,100*65536+280 |
mov ecx,90*65536+260 |
210,15 → 200,17 |
|
mcall 9,PROCESSINFO,-1 |
|
mov eax,[PROCESSINFO+70] ;status of window |
test eax,100b |
jne .end |
|
cmp dword[pinfo.box.width],230 ; ïðîâåðÿåì øèðèíó îêíà |
jge @f |
mov dword[pinfo.box.width],230 ; åñëè îêíî î÷åíü óçêîå, óâåëè÷èâàåì øèðèíó äëÿ èçáåæàíèÿ ãëþêîâ |
@@: |
|
mpack ecx,1,1 |
mov ebx,[pinfo.box.width] |
sub ebx,10 |
|
mov eax,8 |
mov edx,0x4000000B |
mpack ebx,[pinfo.box.width],MAGIC1 |
230,7 → 222,6 |
mcall ,,,0x00000003 |
madd ecx, (14*3+16)/3+1,0 |
mcall ,,,4 |
|
;button for OpenDialog [..] |
mov ebx, 5*65536+47 |
mov ecx, 33*65536+14 |
242,11 → 233,12 |
mov edx,text |
mov esi,text.line_size |
mov eax,4 |
mcall ;InFile |
|
mcall ;InFile |
add ebx, 16 ;14 |
add edx,text.line_size |
mcall ;OutFile |
|
mov ecx,[sc.work_button_text] |
add ebx, 16 ;14 |
add edx,text.line_size |
272,7 → 264,8 |
cmp al,MAX_PATH |
jbe @f |
mov al,MAX_PATH |
@@: movzx esi,al |
@@: |
movzx esi,al |
|
call draw_messages |
|
290,12 → 283,11 |
call [edit_box_draw] |
push dword ch1_dbg |
call [check_box_draw] |
|
.end: |
mcall 12,2 ; End of Draw |
|
popa |
ret |
|
;--------------------------------------------------------------------- |
bottom_right dd ? |
|
align 4 |
313,11 → 305,11 |
jne @f |
mov byte[edi-2],0 ;¥á«¨ ¢ ª®æ¥ ¯ã⨠¥áâì á«¥è, â® ¯ãâì 㪮à 稢 ¥¬ 1 ᨬ¢®« |
@@: |
|
push dword OpenDialog_data |
call dword [OpenDialog_Start] |
cmp [OpenDialog_data.status],2 |
je @f |
|
xor al,al |
mov edi,dword[edit3.text] |
mov ebx,edi ;copy text pointer |
326,6 → 318,7 |
repne scasb |
cmp byte[edi-2],'/' |
jne .no_slash |
|
dec edi ;¥á«¨ ¢ ª®æ¥ ¯ã⨠¥áâì á«¥è, â® ¯ãâì 㪮à 稢 ¥¬ 1 ᨬ¢®« |
.no_slash: |
mov byte[edi-1],'/' ;áâ ¢¨¬ ¢ ª®æ¥ ¯ã⨠᫥è |
349,14 → 342,16 |
lodsb |
test eax,eax |
jnz .cycle |
|
sub esi,4 |
cmp esi,[edit2.text] |
jle .short_fn |
|
mov byte[esi],0 |
sub dword [edit2.size],4 |
sub dword [edit2.pos],4 |
|
.short_fn: |
|
push dword edit1 |
call dword [edit_box_draw] |
push dword edit2 |
366,7 → 361,7 |
@@: |
popad |
ret |
|
;--------------------------------------------------------------------- |
draw_messages: |
mov eax,13 ; clear work area |
mpack ebx,7-2,[pinfo.box.width] |
409,10 → 404,9 |
mcall |
pop ecx ebx |
ret |
|
|
;--------------------------------------------------------------------- |
; DATA |
|
;--------------------------------------------------------------------- |
if lang eq ru |
text: |
db ' å ©«:' |
461,8 → 455,7 |
|
system_dir1 db '/sys/lib/' |
lib1_name db 'proc_lib.obj',0 |
|
|
;--------------------------------------------------------------------- |
align 4 |
import_box_lib: |
edit_box_draw dd aEdit_box_draw |
486,7 → 479,7 |
aCheck_box_draw db 'check_box_draw',0 |
aCheck_box_mouse db 'check_box_mouse',0 |
;aVersion_ch db 'version_ch',0 |
|
;--------------------------------------------------------------------- |
align 4 |
import_proc_lib: |
OpenDialog_Init dd aOpenDialog_Init |
494,7 → 487,7 |
dd 0,0 |
aOpenDialog_Init db 'OpenDialog_init',0 |
aOpenDialog_Start db 'OpenDialog_start',0 |
|
;--------------------------------------------------------------------- |
;library structures |
l_libs_start: |
lib0 l_libs lib0_name, cur_dir_path, library_path, system_dir0, err_message_found_lib0, head_f_l, import_box_lib, err_message_import0, head_f_i |
506,7 → 499,6 |
edit3 edit_box 153, 56, 33, 0xffffff, 0xff, 0x80ff, 0, 0x8000,(path_end-path-1), path, mouse_dd, 0, 6,6 |
editboxes_end: |
ch1_dbg check_box 5, 49, 6, 12, 0xffffff, 0x80ff, 0, s_dbgdescr,(s_dbgdescr_end-s_dbgdescr) |
|
;--------------------------------------------------------------------- |
align 4 |
OpenDialog_data: |
544,9 → 536,9 |
db 'ASM',0 |
.end: |
db 0 |
|
;--------------------------------------------------------------------- |
mouse_dd dd 0 ;íóæíî äëÿ Shift-à â editbox |
|
;--------------------------------------------------------------------- |
infile db 'example.asm' |
times MAX_PATH-$+infile db 0 |
outfile db 'example' |
555,8 → 547,7 |
times MAX_PATH-$+path db 0 |
path_end: |
lf db 13,10,0 |
|
|
;--------------------------------------------------------------------- |
mov_param_str: |
cld |
@@: |
570,9 → 561,7 |
xor al,al |
stosb |
ret |
|
|
|
;--------------------------------------------------------------------- |
start: |
cmp [_mode],NORMAL_MODE |
jne @f |
582,10 → 571,9 |
mov esi,_logo |
call display_string |
|
; |
;--------------------------------------------------------------------- |
; Fasm native code |
; |
|
;--------------------------------------------------------------------- |
mov [input_file],infile |
mov [output_file],outfile |
|
644,8 → 632,7 |
mcall |
@@: |
jmp exit_program |
|
|
;--------------------------------------------------------------------- |
include 'system.inc' |
include 'version.inc' |
include 'errors.inc' |
658,7 → 645,7 |
include 'tables.inc' |
include 'symbdump.inc' |
include 'messages.inc' |
|
;--------------------------------------------------------------------- |
title db appname,VERSION_STRING,0 |
|
_logo db 'flat assembler version ',VERSION_STRING,13,10,0 |