Convert Unicode procedures to stdcall convention.

1. Use cinvoke macro instead of invoke for con_printf
2. Convert `end:` to `P_END:`, As the previous one was a FASM keyword
3. Upgrade all functions in libunicode.asm to use stdcall convention
This commit is contained in:
2026-03-20 20:42:37 +05:30
parent 6658afbe43
commit a4f8506fd1
2 changed files with 32 additions and 48 deletions
@@ -1,17 +1,17 @@
format binary as ""
use32
org 0x0
org 0x0
db 'MENUET01'
dd 0x01, START, I_END
dd end ; Memory
dd end ; Stack pointer
dd 0x0
dd 0x0
db 'MENUET01'
dd 0x01, START, I_END
dd P_END ; Memory
dd P_END ; Stack pointer
dd 0x0
dd 0x0
include '../../../../dll.inc'
include '../../../../proc32.inc'
include '../../../../macros.inc'
include '../../../../dll.inc'
START:
stdcall dll.Load, import_table
@@ -19,47 +19,33 @@ START:
jnz EXIT ; If not 0, jump to exit
invoke con_init, -1, -1, -1, -1, window_title
invoke con_write_asciiz, greet_text
;------------ testing the [test_combo] --------------
mov eax, test_combo
invoke count_utf8_codepoints
invoke count_utf8_codepoints, test_combo
cinvoke con_printf, fmt_codepoints, eax
invoke con_printf, fmt_codepoints, eax
mov eax, test_combo
invoke count_utf8_graphemes
invoke con_printf, fmt_graphemes, eax
invoke count_utf8_graphemes, test_combo
cinvoke con_printf, fmt_graphemes, eax
;------------ testing ends for [test_combo] --------------
;------------ testing the [unitxt] --------------
mov eax, unitxt
invoke count_utf8_codepoints
invoke count_utf8_codepoints, unitxt
cinvoke con_printf, fmt_codepoints, eax
invoke con_printf, fmt_codepoints, eax
mov eax, unitxt
invoke count_utf8_graphemes
invoke con_printf, fmt_graphemes, eax
invoke count_utf8_graphemes, unitxt
cinvoke con_printf, fmt_graphemes, eax
;------------ testing ends for [unitxt] --------------
;------------ testing the [test_tech] --------------
mov eax, test_tech
invoke count_utf8_codepoints
invoke count_utf8_codepoints, test_tech
cinvoke con_printf, fmt_codepoints, eax
invoke con_printf, fmt_codepoints, eax
mov eax, test_tech
invoke count_utf8_graphemes
invoke con_printf, fmt_graphemes, eax
invoke count_utf8_graphemes, test_tech
cinvoke con_printf, fmt_graphemes, eax
;------------ testing ends for [test_tech] --------------
invoke con_exit, 0
EXIT:
mcall -1 ; Exit cleanly
@@ -90,5 +76,5 @@ I_END:
mem rb 0x1000 ; 4096 bytes
end:
P_END: