2006-01-03 12:43:31 +03:00
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; flat assembler source ;;
2006-07-28 17:39:16 +04:00
;; Copyright (c) 1999-2006, Tomasz Grysztar ;;
2006-01-03 12:43:31 +03:00
;; All rights reserved. ;;
;; ;;
;; Menuet port by VT ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
NORMAL_MODE = 8
CONSOLE_MODE = 32
2010-01-04 20:51:09 +03:00
MAGIC1 = 6 * ( text.line_size - 1 ) + 14
2006-10-11 02:15:57 +04:00
MAX_PATH = 100
2006-01-03 12:43:31 +03:00
2006-10-11 02:15:57 +04:00
APP_MEMORY = 0x00800000
2006-01-03 12:43:31 +03:00
;; Menuet header
2006-11-02 17:18:23 +03:00
appname equ "flat assembler "
2006-10-11 02:15:57 +04:00
2006-01-03 12:43:31 +03:00
use32
org 0x0
db 'MENUET01' ; 8 byte id
2010-01-04 20:51:09 +03:00
dd 0x01 ; header version
dd START ; program start
2006-01-03 12:43:31 +03:00
dd program_end ; program image size
2010-01-04 20:51:09 +03:00
dd stacktop ; required amount of memory
dd stacktop ; stack
dd params , cur_dir_path ; parameters,icon
2006-01-03 12:43:31 +03:00
include 'lang.inc'
2007-05-10 17:48:35 +04:00
include '..\..\..\macros.inc'
2010-01-04 20:51:09 +03:00
purge add , sub ; macros.inc does incorrect substitution
2006-01-03 12:43:31 +03:00
include 'fasm.inc'
2010-01-10 01:01:26 +03:00
include '..\..\..\develop\libraries\box_lib\trunk\box_lib.mac'
;include '..\..\..\develop\libraries\box_lib\trunk\editbox.mac'
;include '..\..\..\develop\libraries\box_lib\trunk\checkbox.mac'
2010-01-04 20:51:09 +03:00
include '..\..\..\develop\libraries\box_lib\load_lib.mac'
@ use_library
2006-01-03 12:43:31 +03:00
center fix true
2006-07-28 17:39:16 +04:00
START: ; Start of execution
2010-01-04 20:51:09 +03:00
sys_load_library library_name , cur_dir_path , library_path , system_path , \
err_message_found_lib , head_f_l , myimport , err_message_import , head_f_i
cmp eax , - 1
jne @ f
mcall - 1 ;exit if not open box_lib.obj
@ @ :
mcall 40 , 0x27 ;<3B> <> ᪠ <20> <> <EFBFBD> ⥬<EFBFBD> <E2A5AC> <EFBFBD> ᮡ<> ⨩
2010-01-09 20:39:07 +03:00
get_sys_colors 1 , 0
edit_boxes_set_sys_color edi t1 , edi tboxes_end , sc
check_boxes_set_sys_color ch 1 _dbg , ch 1 _dbg + ch _struc_size , sc
2010-01-04 20:51:09 +03:00
mov edi , fileinfos
mov ecx , ( fileinfos_end - fileinfos ) / 4
or eax , - 1
rep stosd
push 68
pop eax
push 11
pop ebx
mcall
cmp [ params ], 0
2006-10-11 02:15:57 +04:00
jz red
2006-01-03 12:43:31 +03:00
2010-01-04 20:51:09 +03:00
mov ecx , 10
mov eax , ' '
mov edi , infile
2006-10-11 02:15:57 +04:00
push ecx
2006-01-03 12:43:31 +03:00
cld
2010-01-04 20:51:09 +03:00
rep stosd
mov ecx ,[ esp ]
mov edi , outfile
rep stosd
pop ecx
mov edi , path
rep stosd
mov esi , params
2006-01-03 12:43:31 +03:00
; DEBUGF "params: %s\n",esi
2010-01-04 20:51:09 +03:00
mov edi , infile
2006-01-03 12:43:31 +03:00
call mov_param_str
; mov edi,infile
; DEBUGF " input: %s\n",edi
2010-01-04 20:51:09 +03:00
inc esi
mov edi , outfile
2006-01-03 12:43:31 +03:00
call mov_param_str
; mov edi,outfile
; DEBUGF "output: %s\n",edi
2010-01-04 20:51:09 +03:00
inc esi
mov edi , path
2006-01-03 12:43:31 +03:00
call mov_param_str
; mov edi,path
; DEBUGF " path: %s\n",edi
2010-01-04 20:51:09 +03:00
cmp [ esi ], dword ',run'
jne @ f
mov [ _run_outfile ], 1
2006-01-03 12:43:31 +03:00
@ @ :
2010-01-04 20:51:09 +03:00
mov [ _mode ], CONSOLE_MODE
jmp start
2006-01-03 12:43:31 +03:00
2006-07-28 17:39:16 +04:00
red: ; Redraw
2006-01-03 12:43:31 +03:00
call draw_window
2010-01-04 20:51:09 +03:00
still:
push 10 ; Wait here for event
2006-10-11 02:15:57 +04:00
pop eax
2010-01-04 20:51:09 +03:00
mcall
cmp al , 6
jne @ f
call mouse
@ @ :
2006-10-11 02:15:57 +04:00
dec eax
2010-01-04 20:51:09 +03:00
je red ; Redraw request
2006-10-11 02:15:57 +04:00
dec eax
2010-01-04 20:51:09 +03:00
jne button ; Button in buffer
2006-10-11 02:15:57 +04:00
2010-01-04 20:51:09 +03:00
key: ; Key
mov al , 2 ; Read it and ignore
2007-05-10 17:48:35 +04:00
mcall
2010-01-04 20:51:09 +03:00
push dword edi t1
call [ edi t_box_key ]
push dword edi t2
call [ edi t_box_key ]
push dword edi t3
call [ edi t_box_key ]
2006-01-03 12:43:31 +03:00
jmp still
button: ; Button in Window
2006-10-11 02:15:57 +04:00
mov al , 17
2007-05-10 17:48:35 +04:00
mcall
2006-01-03 12:43:31 +03:00
2006-10-11 02:15:57 +04:00
cmp ah , 1
jne noclose
2010-01-04 20:51:09 +03:00
or eax , - 1
2007-05-10 17:48:35 +04:00
mcall
2006-10-11 02:15:57 +04:00
noclose:
2010-01-04 20:51:09 +03:00
cmp ah , 2 ; Start compiling
je start
cmp ah , 3 ; Start compiled file
2006-01-03 12:43:31 +03:00
jnz norunout
mov edx , outfile
call make_fullpaths
2006-10-11 02:15:57 +04:00
mcall 70 , file_info_start
2006-01-03 12:43:31 +03:00
; xor ecx,ecx
jmp still
norunout:
2007-06-14 16:56:45 +04:00
cmp ah , 4
jnz norundebug
2006-01-03 12:43:31 +03:00
2007-06-14 16:56:45 +04:00
mov edx , outfile
call make_fullpaths
mcall 70 , file_info_debug
jmp still
norundebug:
2006-01-03 12:43:31 +03:00
2006-10-11 02:15:57 +04:00
jmp still
2006-01-03 12:43:31 +03:00
2010-01-04 20:51:09 +03:00
mouse:
push dword edi t1
call [ edi t_box_mouse ]
push dword edi t2
call [ edi t_box_mouse ]
push dword edi t3
call [ edi t_box_mouse ]
2010-01-08 22:33:30 +03:00
push dword ch 1 _dbg
call [ ch eck_box_mouse ]
2010-01-04 20:51:09 +03:00
ret
2006-01-03 12:43:31 +03:00
draw_window:
pusha
mcall 12 , 1 ; Start of draw
2010-01-09 20:39:07 +03:00
;get_sys_colors 1,0
2006-01-03 12:43:31 +03:00
2010-01-04 20:51:09 +03:00
xor eax , eax
2008-12-09 02:45:35 +03:00
mov ebx , 100 * 65536 + 280
mov ecx , 90 * 65536 + 260
2006-10-11 02:15:57 +04:00
mov edx ,[ sc.work ]
2010-01-04 20:51:09 +03:00
or edx , 0x33000000
mov edi , title ; Draw Window Label Text
2007-05-10 17:48:35 +04:00
mcall
2006-01-03 12:43:31 +03:00
2006-10-11 02:15:57 +04:00
mcall 9 , PROCESSINFO , - 1
2006-01-03 12:43:31 +03:00
2010-01-08 22:33:30 +03:00
cmp dword [ pinfo.box.width ], 230 ; <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD>
jge @ f
mov dword [ pinfo.box.width ], 230 ; <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
@ @ :
2006-10-11 02:15:57 +04:00
mpack ecx , 1 , 1
2007-05-17 03:02:17 +04:00
mov ebx ,[ pinfo.box.width ]
2006-10-11 02:15:57 +04:00
sub ebx , 10
2006-01-03 12:43:31 +03:00
2010-01-08 22:33:30 +03:00
mov eax , 8
mov edx , 0x4000000B
2007-05-17 03:02:17 +04:00
mpack ebx ,[ pinfo.box.width ], MAGIC1
2006-10-11 02:15:57 +04:00
msub ebx , MAGIC1 + 10 + 1 , 0
2007-06-14 16:56:45 +04:00
mpack ecx , 0 , ( 14 * 3 + 16 ) / 3 - 1
2007-02-22 11:47:28 +03:00
madd ecx , 1 , 0
2006-01-03 12:43:31 +03:00
mcall ,,, 0x00000002 ,[ sc.work_button ]
2007-06-14 16:56:45 +04:00
madd ecx , ( 14 * 3 + 16 ) / 3 + 1 , 0
2006-01-03 12:43:31 +03:00
mcall ,,, 0x00000003
2007-06-14 16:56:45 +04:00
madd ecx , ( 14 * 3 + 16 ) / 3 + 1 , 0
mcall ,,, 4
2006-01-03 12:43:31 +03:00
2006-10-11 02:15:57 +04:00
mpack ebx , 6 , 0 ; Draw Window Text
2007-02-22 11:47:28 +03:00
add ebx , 1 + 14 / 2 - 3
2006-01-03 12:43:31 +03:00
mov ecx ,[ sc.work_text ]
mov edx , text
mov esi , text.line_size
mov eax , 4
newline:
2007-05-10 17:48:35 +04:00
mcall
2010-01-04 20:51:09 +03:00
add ebx , 16 ;14
2006-01-03 12:43:31 +03:00
add edx , text.line_size
cmp byte [ edx ], 'x'
jne newline
2007-05-17 03:02:17 +04:00
mov ebx ,[ pinfo.box.width ]
2006-10-11 02:15:57 +04:00
sub ebx , MAGIC1 + 10 + 1 - 9
2006-01-03 12:43:31 +03:00
shl ebx , 16
2007-06-14 16:56:45 +04:00
add ebx , 1 + ( ( 14 * 3 + 16 ) / 3 - 1 ) / 2 - 3
2006-01-03 12:43:31 +03:00
mcall ,,[ sc.work_button_text ], s_compile , 7
2007-06-14 16:56:45 +04:00
add ebx ,( 14 * 3 + 16 ) / 3 + 1
2006-01-03 12:43:31 +03:00
mcall ,,, s_run
2007-06-14 16:56:45 +04:00
add ebx ,( 14 * 3 + 16 ) / 3 + 1
mcall ,,, s_debug
2006-01-03 12:43:31 +03:00
2006-10-11 02:15:57 +04:00
mpack ebx , MAGIC1 + 6 , 0
2007-02-22 11:47:28 +03:00
add ebx , 1 + 14 / 2 - 3 + 14 * 0
2007-05-17 03:02:17 +04:00
mov esi ,[ pinfo.box.width ]
2006-01-03 12:43:31 +03:00
sub esi , MAGIC1 * 2 + 5 * 2 + 6 + 3
mov eax , esi
mov cl , 6
div cl
cmp al , MAX_PATH
jbe @ f
mov al , MAX_PATH
@ @ : movzx esi , al
2010-01-04 20:51:09 +03:00
call draw_messages
2007-06-14 16:56:45 +04:00
2010-01-05 21:46:12 +03:00
mov eax , dword [ pinfo.box.width ]
sub eax , 127
2010-01-08 22:33:30 +03:00
mov dword [ edi t1.width ], eax ; <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD>
2010-01-05 21:46:12 +03:00
mov dword [ edi t2.width ], eax
mov dword [ edi t3.width ], eax
2010-01-04 20:51:09 +03:00
push dword edi t1
call [ edi t_box_draw ]
push dword edi t2
call [ edi t_box_draw ]
push dword edi t3
call [ edi t_box_draw ]
2010-01-08 22:33:30 +03:00
push dword ch 1 _dbg
call [ ch eck_box_draw ]
2006-01-03 12:43:31 +03:00
mcall 12 , 2 ; End of Draw
popa
ret
bottom_right dd ?
draw_messages:
mov eax , 13 ; clear work area
2007-05-17 03:02:17 +04:00
mpack ebx , 7 - 2 ,[ pinfo.box.width ]
2007-02-22 11:47:28 +03:00
sub ebx , 5 * 2 + 7 * 2 - 1 - 2 * 2
2007-05-17 03:02:17 +04:00
mpack ecx , 0 ,[ pinfo.box.height ]
2007-06-14 16:56:45 +04:00
madd ecx , 14 * 3 + 16 + 1 + 7 + 1 , - ( 14 * 3 + 16 + 1 + 7 * 2 + 25 )
2006-01-03 12:43:31 +03:00
mov word [ bottom_right + 2 ], bx
mov word [ bottom_right ], cx
msub [ bottom_right ], 7 , 11
2007-02-22 11:47:28 +03:00
add [ bottom_right ], 7 shl 16 + 53
2006-01-03 12:43:31 +03:00
mov edx ,[ sc.work ]
2007-05-10 17:48:35 +04:00
mcall
2006-01-03 12:43:31 +03:00
_cy = 0
_sy = 2
_cx = 4
_sx = 6
push ebx ecx
2007-02-22 11:47:28 +03:00
mpack ebx , 4 , 5
2006-01-03 12:43:31 +03:00
add bx ,[ esp + _cx ]
mov ecx ,[ esp + _sy - 2 ]
mov cx ,[ esp + _sy ]
msub ecx , 1 , 1
mcall 38 ,,,[ sc.work_graph ]
mov si ,[ esp + _cy ]
add cx , si
shl esi , 16
add ecx , esi
madd ecx , 1 , 1
mcall
2007-02-22 11:47:28 +03:00
mpack ebx , 4 , 4
2006-01-03 12:43:31 +03:00
mov esi ,[ esp + _sy - 2 ]
mov si , cx
mov ecx , esi
mcall
mov si ,[ esp + _cx ]
add bx , si
shl esi , 16
add ebx , esi
madd ebx , 1 , 1
mcall
pop ecx ebx
ret
2010-01-04 20:51:09 +03:00
; DATA
2006-01-03 12:43:31 +03:00
2010-01-04 20:51:09 +03:00
if lang eq ru
text:
db ' <20> 唠<EFBFBD> <E594A0> :'
.line_size = $ - text
db '<27> <> 唠<EFBFBD> <E594A0> :'
db ' <20> <> <EFBFBD> <EFBFBD> :'
db 'x'
2006-01-03 12:43:31 +03:00
2010-01-04 20:51:09 +03:00
s_compile db '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> .'
s_run db ' <20> <> <EFBFBD> <EFBFBD> '
s_debug db '<27> ⫠<EFBFBD> <E2ABA0> <EFBFBD> '
2010-01-08 22:33:30 +03:00
s_dbgdescr db '<27> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> ⫠<EFBFBD> <E2ABA0> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> ଠ <EFBFBD> <E0ACA0> <EFBFBD> ' , 0
s_dbgdescr_end:
2010-01-04 20:51:09 +03:00
err_message_import db '<27> 訡<EFBFBD> <E8A8A1> <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> box_lib.obj' , 0
err_message_found_lib db '<27> 訡<EFBFBD> <E8A8A1> <20> <> <EFBFBD> <20> <> <EFBFBD> ᪥ box_lib.obj' , 0 ;<3B> <> ப<EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> 㤥<EFBFBD> <20> <20> <> <EFBFBD> ନ<E0ACA8> <E0AEA2> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> , <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ⥪<EFBFBD> <20> <> <20> 㤥<EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
head_f_i:
head_f_l db '<27> <> <EFBFBD> ⥬<EFBFBD> <E2A5AC> <EFBFBD> <20> 訡<EFBFBD> <E8A8A1> ' , 0 ;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> 訡<EFBFBD> <E8A8A1>
system_path db '/sys/lib/'
library _name db 'box_lib.obj' , 0
else
text:
db ' INFILE:'
.line_size = $ - text
db 'OUTFILE:'
db ' PATH:'
db 'x'
2006-01-03 12:43:31 +03:00
2010-01-04 20:51:09 +03:00
s_compile db 'COMPILE'
s_run db ' RUN '
s_debug db ' DEBUG '
2010-01-08 22:33:30 +03:00
s_dbgdescr db 'Generate debug information' , 0
s_dbgdescr_end:
2006-01-03 12:43:31 +03:00
2010-01-04 20:51:09 +03:00
err_message_import db 'Error on load import library box_lib.obj' , 0
err_message_found_lib db 'Sorry I cannot found library box_lib.obj' , 0 ;<3B> <> ப<EFBFBD> , <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> 㤥<EFBFBD> <20> <20> <> <EFBFBD> ନ<E0ACA8> <E0AEA2> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> , <20> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ⥪<EFBFBD> <20> <> <20> 㤥<EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
head_f_i:
head_f_l db 'System error' , 0 ;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> , <20> <> <EFBFBD> <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <20> 訡<EFBFBD> <E8A8A1>
system_path db '/sys/lib/'
library _name db 'box_lib.obj' , 0
end if
2006-01-03 12:43:31 +03:00
2010-01-04 20:51:09 +03:00
myimport:
edit_box_draw dd aEdit_box_draw
edit_box_key dd aEdit_box_key
edit_box_mouse dd aEdit_box_mouse
;version_ed dd aVersion_ed
2006-01-03 12:43:31 +03:00
2010-01-08 22:33:30 +03:00
check_box_draw dd aCheck_box_draw
check_box_mouse dd aCheck_box_mouse
2010-01-04 20:51:09 +03:00
;version_ch dd aVersion_ch
2006-01-03 12:43:31 +03:00
2010-01-04 20:51:09 +03:00
dd 0 , 0
2006-01-03 12:43:31 +03:00
2010-01-04 20:51:09 +03:00
aEdit_box_draw db 'edit_box' , 0
aEdit_box_key db 'edit_box_key' , 0
aEdit_box_mouse db 'edit_box_mouse' , 0
;aVersion_ed db 'version_ed',0
2006-01-03 12:43:31 +03:00
2010-01-08 22:33:30 +03:00
aCheck_box_draw db 'check_box_draw' , 0
aCheck_box_mouse db 'check_box_mouse' , 0
2010-01-04 20:51:09 +03:00
;aVersion_ch db 'version_ch',0
2006-01-03 12:43:31 +03:00
2010-01-08 22:33:30 +03:00
edit1 edi t_box 153 , 56 , 1 , 0xffffff , 0xff , 0x80ff , 0 , 0x8000 , ( outfile - infile - 1 ), infile , mouse_dd , 0 , 11 , 11
edit2 edi t_box 153 , 56 , 17 , 0xffffff , 0xff , 0x80ff , 0 , 0x8000 ,( path - outfile - 1 ), outfile , mouse_dd , 0 , 7 , 7
edit3 edi t_box 153 , 56 , 33 , 0xffffff , 0xff , 0x80ff , 0 , 0x8000 ,( path_end - path - 1 ), path , mouse_dd , 0 , 6 , 6
2010-01-09 20:39:07 +03:00
editboxes_end:
ch1_dbg ch eck_box 5 , 49 , 6 , 12 , 0xffffff , 0x80ff , 0 , s_dbgdescr ,( s_dbgdescr_end - s_dbgdescr )
2007-06-14 16:56:45 +04:00
2010-01-04 20:51:09 +03:00
mouse_dd dd 0 ;<3B> <> <EFBFBD> <EFBFBD> <EFBFBD> <20> <> <EFBFBD> Shift-<2D> <20> editbox
2006-01-03 12:43:31 +03:00
2006-11-02 17:18:23 +03:00
infile db 'example.asm'
2010-01-08 22:33:30 +03:00
times MAX_PATH - $ + infile db 0
2006-11-02 17:18:23 +03:00
outfile db 'example'
2010-01-08 22:33:30 +03:00
times MAX_PATH - $ + outfile db 0
2007-06-14 16:56:45 +04:00
path db '/rd/1/'
2010-01-08 22:33:30 +03:00
times MAX_PATH - $ + path db 0
2010-01-08 00:35:23 +03:00
path_end:
2006-01-03 12:43:31 +03:00
lf db 13 , 10 , 0
mov_param_str:
@ @ :
mov al ,[ esi ]
cmp al , ','
2006-07-28 17:39:16 +04:00
je @ f
2006-01-03 12:43:31 +03:00
cmp al , 0
2006-07-28 17:39:16 +04:00
je @ f
2006-01-03 12:43:31 +03:00
mov [ edi ], al
inc esi
inc edi
jmp @ b
@ @ :
mov al , 0
stosb
ret
start:
cmp [ _mode ], NORMAL_MODE
jne @ f
call draw_messages
2007-06-14 16:56:45 +04:00
mov [ textxy ], 7 shl 16 + 70
2006-01-03 12:43:31 +03:00
@ @ :
mov esi , _logo
call di sp lay_string
;
; Fasm native code
;
mov [ input_file ], infile
mov [ output_file ], outfile
call init_memory
call make_timestamp
mov [ start_time ], eax
call preprocessor
call parser
call assembler
2010-01-08 22:33:30 +03:00
bt dword [ ch 1 _dbg.flags ], 1 ;cmp [bGenerateDebugInfo], 0
jae @ f ;jz @f
2007-06-14 16:56:45 +04:00
call symbol_dump
@ @ :
2006-01-03 12:43:31 +03:00
call formatter
call di sp lay_user_messages
movzx eax ,[ current_pass ]
inc eax
call di sp lay_number
mov esi , _passes_suffix
call di sp lay_string
call make_timestamp
sub eax ,[ start_time ]
xor edx , edx
mov ebx , 100
div ebx
2006-07-28 17:39:16 +04:00
or eax , eax
jz di sp lay_bytes_count
2006-01-03 12:43:31 +03:00
xor edx , edx
mov ebx , 10
div ebx
push edx
call di sp lay_number
mov dl , '.'
call di sp lay_character
pop eax
call di sp lay_number
mov esi , _seconds_suffix
call di sp lay_string
display_bytes_count:
mov eax ,[ written_size ]
call di sp lay_number
mov esi , _bytes_suffix
call di sp lay_string
xor al , al
cmp [ _run_outfile ], 0
2010-01-04 20:51:09 +03:00
je @ f
2006-01-03 12:43:31 +03:00
mov edx , outfile
call make_fullpaths
2006-10-11 02:15:57 +04:00
mov eax , 70
2006-01-03 12:43:31 +03:00
mov ebx , file_info_start
xor ecx , ecx
2007-05-10 17:48:35 +04:00
mcall
2006-01-03 12:43:31 +03:00
@ @ :
jmp exit_program
include 'system.inc'
include 'version.inc'
include 'errors.inc'
include 'expressi.inc'
include 'preproce.inc'
include 'parser.inc'
include 'assemble.inc'
include 'formats.inc'
include 'x86_64.inc'
2006-07-28 17:39:16 +04:00
include 'tables.inc'
2007-06-14 16:56:45 +04:00
include 'symbdump.inc'
2007-12-31 02:34:37 +03:00
include 'messages.inc'
2006-01-03 12:43:31 +03:00
2007-05-10 17:48:35 +04:00
title db appname , VERSION_STRING , 0
2006-10-27 11:38:46 +04:00
2006-01-03 12:43:31 +03:00
_logo db 'flat assembler version ' , VERSION_STRING , 13 , 10 , 0
_passes_suffix db ' passes, ' , 0
_seconds_suffix db ' seconds, ' , 0
_bytes_suffix db ' bytes.' , 13 , 10 , 0
_include db 'INCLUDE' , 0
_counter db 4 , '0000'
2006-07-28 17:39:16 +04:00
_mode dd NORMAL_MODE
2006-01-03 12:43:31 +03:00
_run_outfile dd 0
2010-01-08 22:33:30 +03:00
;bGenerateDebugInfo db 0
2006-01-03 12:43:31 +03:00
sub_table:
times $ 41 db $ 00
times $ 1 A db $ 20
times $ 25 db $ 00
times $ 10 db $ 20
times $ 30 db $ 00
times $ 10 db $ 50
times $ 04 db $ 00 , $ 01
times $ 08 db $ 00
;include_debug_strings
2010-01-04 20:51:09 +03:00
params db 0 ; 'TINYPAD.ASM,TINYPAD,/HD/1/TPAD4/',
cur_dir_path rb 4096
library _path rb 4096
2006-01-03 12:43:31 +03:00
program_end:
2010-01-04 20:51:09 +03:00
rb 1000h
2006-01-03 12:43:31 +03:00
align 4
include 'variable.inc'
program_base dd ?
buffer_address dd ?
memory_setting dd ?
start_time dd ?
2008-02-23 13:16:37 +03:00
memblock dd ?
2006-01-03 12:43:31 +03:00
2007-12-31 02:34:37 +03:00
predefinitions rb 1000h
2010-01-04 20:51:09 +03:00
db gfilename rb MAX_PATH + 4
2007-06-14 16:56:45 +04:00
2006-01-03 12:43:31 +03:00
sc system_colors
2007-02-08 19:38:05 +03:00
max_handles = 8
fileinfos rb ( 4 + 20 + MAX_PATH ) * max_handles
fileinfos_end:
2006-01-03 12:43:31 +03:00
pinfo process_information
2007-09-20 21:07:33 +04:00
align 1000h
rb 1000h
stacktop: