new macro szZ: same as sz, but with 0 at the end of line (ASCIIZ string)

git-svn-id: svn://kolibrios.org@1567 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Ivan Baravy 2010-08-14 14:08:07 +00:00
parent 54fadda10d
commit baf8ec007b

View File

@ -182,7 +182,7 @@ struc mls [sstring]
; strings ; strings
macro sz name,[data] { ; from MFAR [mike.dld] macro sz name,[data] { ; from MFAR [mike.dld]
common common
if used name if used name
name db data name db data
@ -190,6 +190,15 @@ macro sz name,[data] { ; from MFAR [mike.dld]
end if end if
} }
macro szZ name,[data] { ; same as sz, but with 0 at the end of line (ASCIIZ string) [dunkaist]
common
if used name
name db data,0
.size = $-name-1
end if
}
sz0 fix szZ
macro lsz name,[lng,data] { ; from MFAR [mike.dld] macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common common
if used name if used name
@ -203,7 +212,7 @@ macro lsz name,[lng,data] { ; from MFAR [mike.dld]
end if end if
} }
macro szc name,elsz,[data] { ; from MFAR [mike.dld] macro szc name,elsz,[data] { ; from MFAR [mike.dld]
common common
local s,m local s,m
m = 0 m = 0
@ -270,7 +279,7 @@ macro mpack dest, hsrc, lsrc
end if end if
} }
macro __mov reg,a,b { ; mike.dld macro __mov reg,a,b { ; mike.dld
if (~a eq)&(~b eq) if (~a eq)&(~b eq)
mpack reg,a,b mpack reg,a,b
else if (~a eq)&(b eq) else if (~a eq)&(b eq)
@ -280,11 +289,11 @@ macro __mov reg,a,b { ; mike.dld
include 'config.inc' include 'config.inc'
;__CPU_type equ p5 ;__CPU_type equ p5
SYSENTER_VAR equ 0 SYSENTER_VAR equ 0
macro mcall a,b,c,d,e,f { ; mike.dld, updated by Ghost for Fast System Calls macro mcall a,b,c,d,e,f { ; mike.dld, updated by Ghost for Fast System Calls
local ..ret_point local ..ret_point
__mov eax,a __mov eax,a
__mov ebx,b __mov ebx,b
__mov ecx,c __mov ecx,c
@ -293,26 +302,26 @@ macro mcall a,b,c,d,e,f { ; mike.dld, updated by Ghost for Fast System Calls
__mov edi,f __mov edi,f
if __CPU_type eq p5 if __CPU_type eq p5
int 0x40 int 0x40
else else
if __CPU_type eq p6 if __CPU_type eq p6
push ebp push ebp
mov ebp, esp mov ebp, esp
push ..ret_point ; it may be 2 or 5 byte push ..ret_point ; it may be 2 or 5 byte
sysenter sysenter
..ret_point: ..ret_point:
pop edx pop edx
pop ecx pop ecx
else else
if __CPU_type eq k6 if __CPU_type eq k6
push ecx push ecx
syscall syscall
pop ecx pop ecx
else else
display 'ERROR : unknown CPU type (set to p5)', 10, 13 display 'ERROR : unknown CPU type (set to p5)', 10, 13
__CPU_type equ p5 __CPU_type equ p5
int 0x40 int 0x40
end if end if
end if end if
end if end if
@ -393,9 +402,9 @@ macro add arg1,arg2
{ {
if (arg2 eqtype 0) if (arg2 eqtype 0)
if (arg2) = 1 if (arg2) = 1
inc arg1 inc arg1
else else
add arg1,arg2 add arg1,arg2
end if end if
else else
add arg1,arg2 add arg1,arg2
@ -406,9 +415,9 @@ macro sub arg1,arg2
{ {
if (arg2 eqtype 0) if (arg2 eqtype 0)
if (arg2) = 1 if (arg2) = 1
dec arg1 dec arg1
else else
sub arg1,arg2 sub arg1,arg2
end if end if
else else
sub arg1,arg2 sub arg1,arg2
@ -419,17 +428,17 @@ macro mov arg1,arg2
{ {
if (arg1 in __regs) & ((arg2 eqtype 0) | (arg2 eqtype '0')) if (arg1 in __regs) & ((arg2 eqtype 0) | (arg2 eqtype '0'))
if (arg2) = 0 if (arg2) = 0
xor arg1,arg1 xor arg1,arg1
else if (arg2) = 1 else if (arg2) = 1
xor arg1,arg1 xor arg1,arg1
inc arg1 inc arg1
else if (arg2) = -1 else if (arg2) = -1
or arg1,-1 or arg1,-1
else if (arg2) > -128 & (arg2) < 128 else if (arg2) > -128 & (arg2) < 128
push arg2 push arg2
pop arg1 pop arg1
else else
mov arg1,arg2 mov arg1,arg2
end if end if
else else
mov arg1,arg2 mov arg1,arg2
@ -454,68 +463,68 @@ struc POINT _t,_dx,_dy {
include 'struct.inc' include 'struct.inc'
struct RECT struct RECT
left dd ? left dd ?
top dd ? top dd ?
right dd ? right dd ?
bottom dd ? bottom dd ?
ends ends
struct BOX struct BOX
left dd ? left dd ?
top dd ? top dd ?
width dd ? width dd ?
height dd ? height dd ?
ends ends
; structures used in MeOS ; structures used in MeOS
struct process_information struct process_information
cpu_usage dd ? ; +0 cpu_usage dd ? ; +0
window_stack_position dw ? ; +4 window_stack_position dw ? ; +4
window_stack_value dw ? ; +6 window_stack_value dw ? ; +6
dw ? ; +8 dw ? ; +8
process_name rb 12 ; +10 process_name rb 12 ; +10
memory_start dd ? ; +22 memory_start dd ? ; +22
used_memory dd ? ; +26 used_memory dd ? ; +26
PID dd ? ; +30 PID dd ? ; +30
box BOX ; +34 box BOX ; +34
slot_state dw ? ; +50 slot_state dw ? ; +50
dw ? ; +52 dw ? ; +52
client_box BOX ; +54 client_box BOX ; +54
wnd_state db ? ; +70 wnd_state db ? ; +70
rb (1024-71) rb (1024-71)
ends ends
struct system_colors struct system_colors
frame dd ? frame dd ?
grab dd ? grab dd ?
grab_button dd ? grab_button dd ?
grab_button_text dd ? grab_button_text dd ?
grab_text dd ? grab_text dd ?
work dd ? work dd ?
work_button dd ? work_button dd ?
work_button_text dd ? work_button_text dd ?
work_text dd ? work_text dd ?
work_graph dd ? work_graph dd ?
ends ends
struct FILEDATE struct FILEDATE
Second db ? Second db ?
Minute db ? Minute db ?
Hour db ? Hour db ?
db ? db ?
Day db ? Day db ?
Month db ? Month db ?
Year dw ? Year dw ?
ends ends
struct FILEINFO struct FILEINFO
Attributes dd ? Attributes dd ?
IsUnicode db ? IsUnicode db ?
db 3 dup(?) db 3 dup(?)
DateCreate FILEDATE DateCreate FILEDATE
DateAccess FILEDATE DateAccess FILEDATE
DateModify FILEDATE DateModify FILEDATE
Size dq ? Size dq ?
ends ends
; constants ; constants
@ -524,16 +533,16 @@ ends
EV_IDLE = 0 EV_IDLE = 0
EV_TIMER = 0 EV_TIMER = 0
EV_REDRAW = 1 EV_REDRAW = 1
EV_KEY = 2 EV_KEY = 2
EV_BUTTON = 3 EV_BUTTON = 3
EV_EXIT = 4 EV_EXIT = 4
EV_BACKGROUND = 5 EV_BACKGROUND = 5
EV_MOUSE = 6 EV_MOUSE = 6
EV_IPC = 7 EV_IPC = 7
EV_STACK = 8 EV_STACK = 8
; event mask bits for function 40 ; event mask bits for function 40
EVM_REDRAW = 1b EVM_REDRAW = 1b
EVM_KEY = 10b EVM_KEY = 10b
EVM_BUTTON = 100b EVM_BUTTON = 100b
EVM_EXIT = 1000b EVM_EXIT = 1000b