rename __CDECL16_ENTRY and EXIT

This commit is contained in:
2025-09-07 13:29:24 -04:00
parent 6f2fc627be
commit 9493aefa68
11 changed files with 75 additions and 70 deletions

View File

@@ -35,7 +35,7 @@ endstruc
ALIGN 4, db 0x90
GetMemoryMap:
__CDECL16_ENTRY
__CDECL16_PROC_ENTRY
push es ; save segment register
.func:
mov dword [SteviaInfo + SteviaInfoStruct_t.MemoryMapEntries], 0
@@ -83,11 +83,11 @@ GetMemoryMap:
ERROR STAGE2_MM_E820_NO_SMAP
.endp:
pop es
__CDECL16_EXIT
__CDECL16_PROC_EXIT
ret
PrintMemoryMap:
__CDECL16_ENTRY
__CDECL16_PROC_ENTRY
.func:
mov eax, dword [SteviaInfo + SteviaInfoStruct_t.MemoryMapEntries]
cmp eax, 0
@@ -106,15 +106,15 @@ PrintMemoryMap:
; print_string strformat_buffer
.endp:
__CDECL16_EXIT
__CDECL16_PROC_EXIT
ret
FormatMemoryMapEntry:
__CDECL16_ENTRY
__CDECL16_PROC_ENTRY
.func:
; create a string buffer somewhere and return address to result string in ax
.endp:
__CDECL16_EXIT
__CDECL16_PROC_EXIT
ret

View File

@@ -64,7 +64,7 @@
; Bits 6-7 - 00: HDD activity LED off; any other value is "on"
ALIGN 4, db 0x90
EnableA20:
__CDECL16_ENTRY
__CDECL16_PROC_ENTRY
push ds
push es
.a20_check:
@@ -134,7 +134,7 @@ EnableA20:
.endp:
pop es
pop ds
__CDECL16_EXIT
__CDECL16_PROC_EXIT
ret
%endif

View File

@@ -76,7 +76,7 @@ endstruc
; uint16_t count, uint8_t drive_num)
ALIGN 4, db 0x90
read_disk_raw:
__CDECL16_ENTRY
__CDECL16_PROC_ENTRY
.func:
mov ax, LBAPkt_t_size
push ax ; len
@@ -123,7 +123,7 @@ read_disk_raw:
ERROR STAGE2_MBR_DISK_READ_ERROR
%endif
.endf:
__CDECL16_EXIT
__CDECL16_PROC_EXIT
ret
%endif

View File

@@ -20,7 +20,7 @@
ALIGN 4, db 0x90
SetTextMode:
.prolog:
__CDECL16_ENTRY
__CDECL16_PROC_ENTRY
pushf
.func:
xor ah, ah ; Set Video mode BIOS function
@@ -33,14 +33,14 @@ SetTextMode:
int 0x10 ; call video interrupt
.endp:
popf
__CDECL16_EXIT
__CDECL16_PROC_EXIT
ret
; disables blinking text mode cursor via crtc pokes
; 0x3D4/0x3D5 for color, mono at 0x3B4/0x3B5
ALIGN 4, db 0x90
disable_cursor_crtc:
__CDECL16_ENTRY
__CDECL16_PROC_ENTRY
.func:
mov dx, 0x3D4
mov al, 0xA ; low cursor shape register
@@ -50,13 +50,13 @@ disable_cursor_crtc:
mov al, 0x20 ; bits 6-7 unused, bit 5 disables the cursor, bits 0-4 control the cursor shape
out dx, al
.endp:
__CDECL16_EXIT
__CDECL16_PROC_EXIT
ret
; disables blinking text mode cursor via BIOS int 10h, ah = 01
ALIGN 4, db 0x90
disable_cursor_bios:
__CDECL16_ENTRY
__CDECL16_PROC_ENTRY
.func:
push bx
mov ah, 03h ; read cursor pos & shape
@@ -68,14 +68,14 @@ disable_cursor_bios:
int 10h
pop bx
.endp:
__CDECL16_EXIT
__CDECL16_PROC_EXIT
ret
; Prints a C-Style string (null terminated) using BIOS vga teletype call
; void PrintString(char* buf)
ALIGN 4, db 0x90
PrintString:
__CDECL16_ENTRY
__CDECL16_PROC_ENTRY
mov di, [bp + 4] ; first arg is char[]
.str_len:
xor cx, cx ; ECX = 0
@@ -101,14 +101,14 @@ PrintString:
jcxz PrintString.endp
jmp PrintString.print_L0 ; Fetch next character from string
.endp:
__CDECL16_EXIT
__CDECL16_PROC_EXIT
ret ; Return from procedure
; Prints a single character
; void PrintCharacter(char c);
ALIGN 4, db 0x90
PrintCharacter:
__CDECL16_ENTRY
__CDECL16_PROC_ENTRY
.func:
mov al, byte [bp + 4] ; AL = character c
mov ah, 0x0E ; INT 0x10, AH=0x0E call
@@ -116,7 +116,7 @@ PrintCharacter:
int 0x10 ; call video interrupt
; TODO: check for carry and clear carry before call
.endp:
__CDECL16_EXIT
__CDECL16_PROC_EXIT
ret
; TODO: fix the prolog, epilog and stack usage to confirm with cdecl16
@@ -124,7 +124,7 @@ PrintCharacter:
; void PrintDWORD(uint32_t val);
ALIGN 4, db 0x90
PrintDWORD:
__CDECL16_ENTRY
__CDECL16_PROC_ENTRY
.func:
mov si, IntToHex_table
mov ebx, 16 ; base-16
@@ -166,7 +166,7 @@ PrintDWORD:
jmp PrintDWORD.print_stack
.endp:
__CDECL16_EXIT
__CDECL16_PROC_EXIT
ret
%endif
%define __INC_VIDEO