Compare commits

..
Author SHA1 Message Date
Burerandefpiem e268b223df libs/asm-xml: add the AsmXml XML parser as xml.obj
Test PR / Build (es_ES) (pull_request) Successful in 2m24s
Test PR / Build (ru_RU) (pull_request) Successful in 2m29s
Test PR / Build (en_US) (pull_request) Successful in 2m30s
AsmXml 1.4 by Marc Kerbiquet (BSD 3-clause, tibleiz.net), unmodified,
with a KolibriOS wrapper: COFF export table, lib_init and cdecl
adapters for the heap functions passed by the loader. It exports
lib_init and the ax_* functions used by FeedFlow and by the C--
header lib/obj/xml.h, and is shipped as /sys/lib/xml.obj.

Co-authored-by: efpiem <fpmastrorilli@gmail.com>
Assisted-by: Claude:claude-opus-5-5
2026-10-04 11:18:22 +03:00
14 changed files with 5737 additions and 76 deletions

No files matched your search

+1 -1
View File
@@ -166,7 +166,6 @@ extra_files = {
{"kolibrios/demos/rpento.lif", "common/demos/rpento.lif"},
{"kolibrios/develop/fpc/", "common/develop/fpc/*"},
{"kolibrios/develop/fpc/examples/", "../programs/develop/fp/examples/src/*"},
{"kolibrios/develop/fasm/fasm.txt", SRC_PROGS .. "/develop/fasm/1.73/fasm.txt"},
{"kolibrios/develop/oberon07/compiler.kex", SRC_PROGS .. "/develop/oberon07/Compiler.kex"},
{"kolibrios/develop/oberon07/LICENSE", SRC_PROGS .. "/develop/oberon07/LICENSE"},
{"kolibrios/develop/oberon07/doc/CC.txt", SRC_PROGS .. "/develop/oberon07/doc/CC.txt"},
@@ -524,6 +523,7 @@ tup.append_table(img_files, {
{"LIB/RASTERWORKS.OBJ", VAR_PROGS .. "/develop/libraries/fontRasterWorks_unicode/RasterWorks.obj"},
{"LIB/SORT.OBJ", VAR_PROGS .. "/develop/libraries/sorter/sort.obj"},
{"LIB/TINYGL.OBJ", VAR_PROGS .. "/develop/libraries/TinyGL/asm_fork/tinygl.obj"},
{"LIB/XML.OBJ", VAR_PROGS .. "/develop/libraries/asm-xml/xml.obj"},
{"MEDIA/ANIMAGE", VAR_PROGS .. "/media/animage/animage"},
{"MEDIA/FILLSCR", VAR_PROGS .. "/media/FillScr/fillscr"},
{"MEDIA/KIV", VAR_PROGS .. "/media/kiv/kiv"},
+5 -5
View File
@@ -20,13 +20,13 @@
<a href="hardware_support.htm">Поддержка оборудования</a>
<strong>Разработка</strong>
<a href="/sys/docpack|d">Справочник по системным функциям Колибри</a>
<a href="/sys/docpack|c">Использование отладчика</a>
<a href="/kolibrios/develop/fasm/fasm.txt">Руководство FASM</a>
<a href="/sys/docpack|f">Справочник по системным функциям Колибри</a>
<a href="/sys/docpack|e">Использование отладчика</a>
<a href="/sys/docpack|d">Руководство FASM</a>
<strong>Использование библиотек</strong>
<a href="/sys/docpack|g">Ini</a>
<a href="/sys/docpack|h">Диалог открытия файла OpenDial</a>
<a href="/sys/docpack|i">Ini</a>
<a href="/sys/docpack|j">Диалог открытия файла OpenDial</a>
<strong>Смотрите также</strong>
Вики проекта <a href="http://wiki.kolibrios.org/">wiki.kolibrios.org</a>
+2 -7
View File
@@ -31,7 +31,6 @@ macro debug_print_dec arg
dpd fix debug_print_dec
;---------------------------------
if used debug_outdec
debug_outdec: ;(eax - num, edi-str)
push 10 ;2
pop ecx ;1
@@ -60,9 +59,7 @@ debug_outchar: ; al - char
popad
popf
ret
end if
if used debug_outstr
debug_outstr:
mov eax,63
mov ebx,1
@@ -75,7 +72,7 @@ debug_outstr:
jmp @b
@@:
ret
end if
macro newline
{
@@ -115,7 +112,6 @@ macro debug_print_hex arg
}
dph fix debug_print_hex
if used debug_outhex
debug_outhex:
; eax - number
mov edx, 8
@@ -134,5 +130,4 @@ debug_outhex:
ret
__hexdigits:
db '0123456789ABCDEF'
end if
db '0123456789ABCDEF'
@@ -0,0 +1,25 @@
Copyright (c) 2007-2012, Marc Kerbiquet
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of AsmXml nor the names of its contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,2 @@
if tup.getconfig("NO_FASM") ~= "" then return end
tup.rule("xml.asm", "fasm %f %o " .. tup.getconfig("KPACK_CMD"), "xml.obj")
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,59 @@
; SPDX-License-Identifier: GPL-2.0-only
;
; xml.obj - AsmXml parser as a KolibriOS library
; Copyright (C) KolibriOS team 2026
;
; asm-xml.asm and LICENSE.txt are the unmodified AsmXml 1.4 release
; by Marc Kerbiquet (BSD 3-clause), https://tibleiz.net/asm-xml/
format MS COFF
public EXPORTS
section '.flat' code readable align 16
; AsmXml calls malloc/free as cdecl, the heap functions given to lib_init
; are stdcall: the caller pops the argument they have already taken
lib_init:
mov [mem.alloc], eax
mov [mem.free], ebx
mov eax, malloc
mov ebx, free
jmp initialize
malloc:
push dword [esp + 4]
call [mem.alloc]
ret
free:
push dword [esp + 4]
call [mem.free]
ret
align 4
mem.alloc dd ?
mem.free dd ?
align 16
EXPORTS:
dd sz_lib_init, lib_init
dd sz_initializeParser, _initializeParser
dd sz_releaseParser, _releaseParser
dd sz_parse, _parse
dd sz_initializeClassParser, _initializeClassParser
dd sz_releaseClassParser, _releaseClassParser
dd sz_classFromElement, _classFromElement
dd sz_classFromString, _classFromString
dd 0, 0
sz_lib_init db 'lib_init', 0
sz_initializeParser db 'ax_initializeParser', 0
sz_releaseParser db 'ax_releaseParser', 0
sz_parse db 'ax_parse', 0
sz_initializeClassParser db 'ax_initializeClassParser', 0
sz_releaseClassParser db 'ax_releaseClassParser', 0
sz_classFromElement db 'ax_classFromElement', 0
sz_classFromString db 'ax_classFromString', 0
include 'asm-xml.asm'
+3 -12
View File
@@ -104,12 +104,8 @@ START:
load_libraries l_libs_start,end_l_libs
cmp [lib1.status_lib],0
jnz close
cmp [lib2.status_lib],0
jnz close
cmp [lib4.status_lib],0
jnz close
cmp eax,-1
jz close
mcall SF_SET_EVENTS_MASK,0x80000067 ; 1100111b
;---------------------------------------------------------
@@ -226,14 +222,9 @@ include 'menu.inc'
;-----------------------------------------------------------
;------------variables and data of program------------------
;-----------------------------------------------------------
name_of_program db 'ANIMAGE graphics editor v1.54',0
mouse_pos_x db 'X='
mouse_pos_y db 'Y='
new_text1 db 'Picture size X'
new_text2 db 'Picture size Y'
ok_text db 'OK'
include 'lib_data.inc'
include 'panel_data.inc'
include 'brushes.inc'
include 'spray.inc'
include 'width_lines.inc'
@@ -3,23 +3,8 @@
;---------------------------------------------
align 4
mouse:
cmp [lib3.status_lib],0 ; test load library
jnz .m_end
cld
stdcall [kmainmenu_dispatch_cursorevent], [main_menu]
mov eax,[main_menu]
cmp dword[eax+16],-1
je @f
mov [m_lost],1
jmp still
@@:
cmp [m_lost],0
je .m_end
dec [m_lost]
jmp still
.m_end:
or ecx,-1
mcall SF_THREAD_INFO,procinfo
+24 -19
View File
@@ -1,13 +1,15 @@
align 4
square_width_put:
macro square_width_put
{
local .no_put_to_screen
local .next_color_put
local .vertical_width_put
local .horizontal_width_put
mov ebx,[ReserveArray]
mov eax,[ebx]
test eax,eax
jz .no_put_to_screen
mov ecx,[ebx]
cmp ecx,[Picture_SizeX]
jg .no_put_to_screen ;if ecx > screen size return
add ebx,4
xor ebp,ebp
@@ -46,10 +48,13 @@ square_width_put:
jnz .next_color_put
.no_put_to_screen:
ret
}
align 4
square_width_save:
macro square_width_save
{
local .next_color_save
local .vertical_width_save
local .horizontal_width_save
mov ebx,[ReserveArray]
mov [ebx],eax
mov ecx,eax
@@ -88,7 +93,7 @@ square_width_save:
add ebx,4
dec ecx
jnz .next_color_save
ret
}
macro draw_calc_pixels brush
{
@@ -675,7 +680,7 @@ TakeButtonInstruments:
no_new_line_xy:
;put saved pixels
call square_width_put
square_width_put
;calculate line
mov ebx,[ReserveArray]
@@ -707,7 +712,7 @@ TakeButtonInstruments:
call calculate_line
;save color pixels in ReserveArray
call square_width_save
square_width_save
;draw calculated pixels on work arrea
draw_calc_pixels width_pixels
@@ -741,7 +746,7 @@ TakeButtonInstruments:
no_new_rectangle_xy:
;put saved pixels
call square_width_put
square_width_put
;calculate line
mov ebx,[ReserveArray]
@@ -773,7 +778,7 @@ TakeButtonInstruments:
call calculate_rectangle
;save color pixels in ReserveArray
call square_width_save
square_width_save
;draw calculated pixels on work arrea
draw_calc_pixels width_pixels_rectangle
@@ -807,7 +812,7 @@ TakeButtonInstruments:
no_new_circle_xy:
;put saved pixels
call square_width_put
square_width_put
mov esi,[ScreenX]
mov edi,[ScreenY]
@@ -926,7 +931,7 @@ TakeButtonInstruments:
call calculate_circle
;save color pixels in ReserveArray
call square_width_save
square_width_save
;draw calculated pixels on work arrea
draw_calc_pixels width_pixels
@@ -1306,7 +1311,7 @@ end if
no_new_konture_xy:
;put saved pixels
call square_width_put
square_width_put
;calculate line
mov ebx,[ReserveArray]
@@ -1338,7 +1343,7 @@ end if
call calculate_line
;save color pixels in ReserveArray
call square_width_save
square_width_save
;draw calculated pixels on work arrea
draw_calc_pixels width_pixels
@@ -1379,7 +1384,7 @@ end if
no_new_ellips_xy:
;put saved pixels
call square_width_put
square_width_put
mov esi,[ScreenX]
@@ -1490,7 +1495,7 @@ end if
call calculate_ellips
;save color pixels in ReserveArray
call square_width_save
square_width_save
;draw calculated pixels on work arrea
draw_calc_pixels width_pixels
-8
View File
@@ -15,8 +15,6 @@ no_set:
}
init_main_menu:
cmp [lib3.status_lib],0 ; test load library
jnz @f
stdcall [kmenu_init], syscolors
stdcall [ksubmenu_new]
@@ -112,14 +110,10 @@ init_main_menu:
; add 'Reflection' menu to main
stdcall [kmenuitem_new], KMENUITEM_SUBMENU, sz_main_menu_Filters, [main_menu_filters]
stdcall [ksubmenu_add], [main_menu], eax
@@:
ret
put_main_menu:
cmp [lib3.status_lib],0 ; test load library
jnz @f
stdcall [kmainmenu_draw], [main_menu]
@@:
ret
button_handler_main_menu:
@@ -151,13 +145,11 @@ button_handler_main_menu:
.end_handler:
ret
align 4
main_menu dd 0
main_menu_file dd 0
main_menu_edit dd 0
main_menu_instr dd 0
main_menu_filters dd 0
m_lost db 0
sz_main_menu_File db 'File', 0
sz_main_menu_File_New db 'New', 0
+9
View File
@@ -0,0 +1,9 @@
;**********************************************************
;------------------TEXT DATA-------------------------------
;**********************************************************
name_of_program db 'ANIMAGE graphics editor v1.53',0
mouse_pos_x db 'X='
mouse_pos_y db 'Y='
new_text1 db 'PICTURE SIZE X'
new_text2 db 'PICTURE SIZE Y'
ok_text db 'OK'
+3
View File
@@ -15,6 +15,9 @@ then tup.append_table(deps,
else tup.append_table(deps,
tup.rule("../../../kernel/trunk/docs/sysfuncs.txt", cp_cmd, "SysFuncs.txt"))
end
tup.append_table(deps,
tup.rule("../../develop/fasm/1.73/fasm.txt", cp_cmd, "Fasm.txt")
)
tup.append_table(deps,
tup.rule("../../../kernel/trunk/docs/stack.txt", cp_cmd, "Stack.txt")
)
+10 -9
View File
@@ -9,7 +9,7 @@
;---------------------------------------------------------------------
FILE_COUNT=0
DEF_FILE equ 'f'
DEF_FILE equ 'g'
macro embed_docdir_file fn
{
@@ -197,17 +197,18 @@ embedded:
embed_docdir_file 'Copying.txt' ;a
embed_docdir_file 'Hot_Keys.txt' ;b
embed_docdir_file 'Mtdbg.txt' ;c
embed_local_file 'Fasm.txt' ;c
embed_docdir_file 'Mtdbg.txt' ;d
if lang eq ru_RU
embed_local_file 'SysFuncr.txt' ;d
embed_local_file 'SysFuncr.txt' ;e
else ; Default to en_US
embed_local_file 'SysFuncs.txt' ;d
embed_local_file 'SysFuncs.txt' ;e
end if
embed_local_file 'Stack.txt' ;e
embed_docdir_file 'KFAR_Keys.txt' ;f
embed_docdir_file 'INI.txt' ;g
embed_docdir_file 'OpenDial.txt' ;h
embed_docdir_file 'Credits.txt' ;i
embed_local_file 'Stack.txt' ;f
embed_docdir_file 'KFAR_Keys.txt' ;g
embed_docdir_file 'INI.txt' ;h
embed_docdir_file 'OpenDial.txt' ;i
embed_docdir_file 'Credits.txt' ;j
; -- End of embedding area -------
dd 0