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
@@ -29,16 +29,13 @@ section '.flat' code readable align 16
;=============================================================
; CodePoint Counting function
; Parameters:
; eax = pointer to the memory address of the null
; _str_ptr = pointer to the memory address of the null
; terminated string
; Return values:
; eax = total codepoints
; -------PRIVATE--------
; ebx <- counter of codepoints
; ecx <- each byte
;
;=============================================================
proc count_utf8_codepoints
proc count_utf8_codepoints uses ebx, _str_ptr
mov eax, [_str_ptr]
mov ebx, 0
.read_loop:
@@ -61,14 +58,15 @@ proc count_utf8_codepoints
endp
;=============================================================
; eax <- pointer to the memory address of the string
; * Do not use other register because it may be overwritten.
; -------PRIVATE--------
; ebx <- counter of grapheme
; ecx <- each byte
;
; Grapheme Counting function
; Parameters:
; _str_ptr = pointer to the memory address of the null
; terminated string
; Return values:
; eax = total grapheme count
;=============================================================
proc count_utf8_graphemes
proc count_utf8_graphemes uses ebx, _str_ptr
mov eax, [_str_ptr]
mov ebx, 0
.read_loop: