Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 370 → Rev 485

/programs/develop/fasm/trunk/fasm.asm
32,6 → 32,7
dd params,0x0 ; parameters,icon
 
include 'lang.inc'
include '..\..\..\macros.inc'
include 'fasm.inc'
 
center fix true
90,7 → 91,7
still:
push 10 ; Wait here for event
pop eax
int 40h
mcall
dec eax
je red ; Redraw request
dec eax
98,18 → 99,18
 
key: ; Key
mov al,2 ; Read it and ignore
int 0x40
mcall
jmp still
 
button: ; Button in Window
 
mov al,17
int 0x40
mcall
 
cmp ah,1
jne noclose
or eax,-1
int 0x40
mcall
 
noclose:
cmp ah,2 ; Start compiling
150,13 → 151,13
mov ecx,50*65536+250
mov edx,[sc.work]
or edx,0x33000000
mov edi,header ; Draw Window Label Text
int 0x40
mov edi,title ; Draw Window Label Text
mcall
 
mcall 9,PROCESSINFO,-1
 
mpack ecx,1,1
mov ebx,[pinfo.x_size]
mov ebx,[pinfo.box.left]
sub ebx,10
 
push ecx
189,7 → 190,7
madd ecx, 14,0
mcall ,,,0x4000000D ; Button: Enter Path
 
mpack ebx,[pinfo.x_size],MAGIC1
mpack ebx,[pinfo.box.left],MAGIC1
msub ebx,MAGIC1+10+1,0
mpack ecx,0, 14*3/2-1
madd ecx,1,0
204,13 → 205,13
mov esi,text.line_size
mov eax,4
newline:
int 0x40
mcall
add ebx, 14
add edx,text.line_size
cmp byte[edx],'x'
jne newline
 
mov ebx,[pinfo.x_size]
mov ebx,[pinfo.box.left]
sub ebx,MAGIC1+10+1-9
shl ebx,16
add ebx,1+( 14*3/2-1)/2-3
220,7 → 221,7
 
mpack ebx,MAGIC1+6,0
add ebx,1+ 14/2-3+ 14*0
mov esi,[pinfo.x_size]
mov esi,[pinfo.box.left]
sub esi,MAGIC1*2+5*2+6+3
mov eax,esi
mov cl,6
246,9 → 247,9
 
draw_messages:
mov eax,13 ; clear work area
mpack ebx,7-2,[pinfo.x_size]
mpack ebx,7-2,[pinfo.box.left]
sub ebx,5*2+7*2-1-2*2
mpack ecx,0,[pinfo.y_size]
mpack ecx,0,[pinfo.box.top]
madd ecx, 14*3+1+7+1,-( 14*3+1+7*2+25)
mov word[bottom_right+2],bx
mov word[bottom_right],cx
255,7 → 256,7
msub [bottom_right],7,11
add [bottom_right],7 shl 16 + 53
mov edx,[sc.work]
int 0x40
mcall
_cy = 0
_sy = 2
_cx = 4
360,7 → 361,7
 
print_text:
 
mpack ebx,MAGIC1+6,[pinfo.x_size]
mpack ebx,MAGIC1+6,[pinfo.box.left]
sub ebx,MAGIC1*2+19
movzx esi,bx
mov ecx,[ya-2]
487,7 → 488,7
mov eax,70
mov ebx,file_info_start
xor ecx,ecx
int 0x40
mcall
@@:
jmp exit_program
 
503,7 → 504,7
include 'x86_64.inc'
include 'tables.inc'
 
header db appname,VERSION_STRING,0
title db appname,VERSION_STRING,0
 
_logo db 'flat assembler version ',VERSION_STRING,13,10,0
 
/programs/develop/fasm/trunk/fasm.inc
18,64 → 18,6
call __draw_caption
}
 
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
 
macro __mov reg,a,b {
if (~a eq)&(~b eq)
mpack reg,a,b
else if (~a eq)&(b eq)
mov reg,a
end if
}
 
macro mcall a,b,c,d,e,f {
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
 
macro sz name,[data] {
if used name
common
label name
forward
db data
common
.size = $-name
end if
}
 
macro lsz name,[lng,data] {
if used name
common
label name
forward
if lang eq lng
db data
end if
common
.size = $-name
end if
}
 
macro mmov reg,a1,a2 {
mov reg,(a1) shl 16 + (a2)
}
109,39 → 51,3
 
@^ fix macro comment {
^@ fix }
 
; structure definition helper
 
;include '%fasminc%struct.inc'
include 'struct.inc'
 
; structures used in MeOS
struct process_information
cpu_usage dd ? ; +0
window_stack_position dw ? ; +4
window_stack_value dw ? ; +6
not_used1 dw ? ; +8
process_name db 12 dup(?) ; +10
memory_start dd ? ; +22
used_memory dd ? ; +26
PID dd ? ; +30
x_start dd ? ; +34
y_start dd ? ; +38
x_size dd ? ; +42
y_size dd ? ; +46
slot_state dw ? ; +50
not_used2 db 1024-52 dup(?)
ends
 
struct system_colors
frame dd ?
grab dd ?
grab_button dd ?
grab_button_text dd ?
grab_text dd ?
work dd ?
work_button dd ?
work_button_text dd ?
work_text dd ?
work_graph dd ?
ends
/programs/develop/fasm/trunk/system.inc
63,7 → 63,7
cmp [_mode],NORMAL_MODE
je still
or eax,-1
int 0x40
mcall
 
make_timestamp:
push ebx
144,7 → 144,7
mov dword [ebx+16], fileinfo
mov eax, 70
push ebx
int 0x40
mcall
pop ebx
test eax, eax
jnz .fail
172,7 → 172,7
mov [ebx+16], edx
push ebx
mov eax, 70
int 0x40
mcall
xchg eax, [esp]
add [eax+4], ebx
adc [eax+8], dword 0
201,7 → 201,7
; mov [filesize],edx
; mov eax,58
; mov ebx,file_info_write
; int 0x40
; mcall
; popa
; ret
 
209,7 → 209,7
mov [ebx+16], edx
push ebx
mov eax, 70
int 0x40
mcall
xchg eax, [esp]
add [eax+4], ebx
adc [eax+8], dword 0
344,7 → 344,7
mov eax,63
mov ebx,1
mov cl,dl
int 0x40
mcall
popa
ret