From 4d719e6bc5215b4c9d3defda28806010d7a8eb89 Mon Sep 17 00:00:00 2001 From: "Andrey Halyavin (halyavin)" Date: Sat, 23 Sep 2006 14:00:36 +0000 Subject: [PATCH] * Assembler part of libc now also exports "name@params_size" for every system function because of stdcall convention. * Some fixes in calculating relocations procedure. git-svn-id: svn://kolibrios.org@159 a494cfbc-eb01-0410-851d-a64ba20cac60 --- .../develop/metcc/trunk/libc/include/mesys.h | 6 ++-- .../develop/metcc/trunk/libc/mesys/backgr.asm | 16 ++++------- .../develop/metcc/trunk/libc/mesys/button.asm | 7 ++--- .../develop/metcc/trunk/libc/mesys/clock.asm | 4 +-- .../develop/metcc/trunk/libc/mesys/date.asm | 4 +-- .../metcc/trunk/libc/mesys/debug_board.asm | 5 ++-- .../develop/metcc/trunk/libc/mesys/delay.asm | 4 +-- .../develop/metcc/trunk/libc/mesys/dga.asm | 4 +-- .../metcc/trunk/libc/mesys/draw_bar.asm | 4 +-- .../metcc/trunk/libc/mesys/draw_image.asm | 4 +-- .../metcc/trunk/libc/mesys/draw_window.asm | 5 ++-- .../develop/metcc/trunk/libc/mesys/event.asm | 13 ++++----- .../develop/metcc/trunk/libc/mesys/exit.asm | 4 +-- .../metcc/trunk/libc/mesys/file_58.asm | 10 +++---- .../develop/metcc/trunk/libc/mesys/ipc.asm | 7 ++--- .../develop/metcc/trunk/libc/mesys/irq.asm | 28 +++++++------------ .../metcc/trunk/libc/mesys/keyboard.asm | 7 ++--- .../develop/metcc/trunk/libc/mesys/line.asm | 4 +-- .../develop/metcc/trunk/libc/mesys/midi.asm | 7 ++--- .../develop/metcc/trunk/libc/mesys/pci.asm | 28 +++++++------------ .../develop/metcc/trunk/libc/mesys/pixel.asm | 4 +-- .../metcc/trunk/libc/mesys/process.asm | 4 +-- .../develop/metcc/trunk/libc/mesys/screen.asm | 4 +-- .../develop/metcc/trunk/libc/mesys/sound.asm | 19 +++++-------- .../develop/metcc/trunk/libc/mesys/thread.asm | 4 +-- .../metcc/trunk/libc/mesys/window_redraw.asm | 4 +-- .../metcc/trunk/libc/mesys/write_text.asm | 4 +-- programs/develop/metcc/trunk/source/tccmeos.c | 5 ++-- 28 files changed, 92 insertions(+), 127 deletions(-) diff --git a/programs/develop/metcc/trunk/libc/include/mesys.h b/programs/develop/metcc/trunk/libc/include/mesys.h index 7066c50ae..34bd8cef0 100644 --- a/programs/develop/metcc/trunk/libc/include/mesys.h +++ b/programs/develop/metcc/trunk/libc/include/mesys.h @@ -82,7 +82,7 @@ extern void stdcall _msys_sound_speaker_play(void* data); extern void stdcall _msys_write_text(int x,int y,int color,char* text,int len); extern void* stdcall _msys_start_thread(void (* func_ptr)(void),int stack_size,int* pid); extern void stdcall _msys_window_redraw(int status); -extern void* stdcall malloc(int); -extern void stdcall free(void*); -extern void* stdcall realloc(void*,int); +extern void* malloc(int); +extern void free(void*); +extern void* realloc(void*,int); #endif diff --git a/programs/develop/metcc/trunk/libc/mesys/backgr.asm b/programs/develop/metcc/trunk/libc/mesys/backgr.asm index df4a637e6..d25a1322c 100644 --- a/programs/develop/metcc/trunk/libc/mesys/backgr.asm +++ b/programs/develop/metcc/trunk/libc/mesys/backgr.asm @@ -1,7 +1,7 @@ format ELF +include "public_stdcall.inc" section '.text' executable -public _msys_set_background_size -_msys_set_background_size: +public_stdcall _msys_set_background_size,8 ;arg1 - xsize ;arg2 - ysize push ebx @@ -12,8 +12,7 @@ _msys_set_background_size: int 0x40 pop ebx ret 8 -public _msys_write_background_mem -_msys_write_background_mem: +public_stdcall _msys_write_background_mem,8 ;arg1 - pos ;arg2 - color push ebx @@ -24,16 +23,14 @@ _msys_write_background_mem: int 0x40 pop ebx ret 8 -public _msys_draw_background -_msys_draw_background: +public_stdcall _msys_draw_background,0 mov edx,ebx mov eax,15 mov ebx,3 int 0x40 mov ebx,edx ret -public _msys_set_background_draw_type -_msys_set_background_draw_type: +public_stdcall _msys_set_background_draw_type,4 ;arg1 - type mov edx,ebx mov eax,15 @@ -42,8 +39,7 @@ _msys_set_background_draw_type: int 0x40 mov ebx,edx ret 4 -public _msys_background_blockmove -_msys_background_blockmove: +public_stdcall _msys_background_blockmove,12 ;arg1 - source ;arg2 - position in dest ;arg3 - size diff --git a/programs/develop/metcc/trunk/libc/mesys/button.asm b/programs/develop/metcc/trunk/libc/mesys/button.asm index 1c7899999..cc6e3610a 100644 --- a/programs/develop/metcc/trunk/libc/mesys/button.asm +++ b/programs/develop/metcc/trunk/libc/mesys/button.asm @@ -1,7 +1,7 @@ format ELF +include "public_stdcall.inc" section '.text' executable -public _msys_make_button -_msys_make_button: +public_stdcall _msys_make_button,24 ;arg1 - x ;arg2 - y ;arg3 - xsize @@ -22,8 +22,7 @@ _msys_make_button: pop esi ebx ret 24 -public _msys_get_button_id -_msys_get_button_id: +public_stdcall _msys_get_button_id,0 mov eax,17 int 0x40 test al,al diff --git a/programs/develop/metcc/trunk/libc/mesys/clock.asm b/programs/develop/metcc/trunk/libc/mesys/clock.asm index f999a8d73..7c3b53c24 100644 --- a/programs/develop/metcc/trunk/libc/mesys/clock.asm +++ b/programs/develop/metcc/trunk/libc/mesys/clock.asm @@ -1,7 +1,7 @@ format ELF +include "public_stdcall.inc" section '.text' executable -public _msys_get_system_clock -_msys_get_system_clock: +public_stdcall _msys_get_system_clock,0 mov eax,3 int 0x40 ret \ No newline at end of file diff --git a/programs/develop/metcc/trunk/libc/mesys/date.asm b/programs/develop/metcc/trunk/libc/mesys/date.asm index e60ce2d2a..4c9c1e9ce 100644 --- a/programs/develop/metcc/trunk/libc/mesys/date.asm +++ b/programs/develop/metcc/trunk/libc/mesys/date.asm @@ -1,7 +1,7 @@ format ELF +include "public_stdcall.inc" section '.text' executable -public _msys_get_date -_msys_get_date: +public_stdcall _msys_get_date,0 mov eax,29 int 0x40 ret \ No newline at end of file diff --git a/programs/develop/metcc/trunk/libc/mesys/debug_board.asm b/programs/develop/metcc/trunk/libc/mesys/debug_board.asm index 4081b8518..1ff638d5f 100644 --- a/programs/develop/metcc/trunk/libc/mesys/debug_board.asm +++ b/programs/develop/metcc/trunk/libc/mesys/debug_board.asm @@ -1,8 +1,7 @@ format ELF +include "public_stdcall.inc" section '.text' executable - -public _msys_debug_out -_msys_debug_out: +public_stdcall _msys_debug_out,4 ;arg1 - char to out push ebx mov ecx,[esp+8] diff --git a/programs/develop/metcc/trunk/libc/mesys/delay.asm b/programs/develop/metcc/trunk/libc/mesys/delay.asm index b8fd800a4..ab637faa9 100644 --- a/programs/develop/metcc/trunk/libc/mesys/delay.asm +++ b/programs/develop/metcc/trunk/libc/mesys/delay.asm @@ -1,7 +1,7 @@ format ELF +include "public_stdcall.inc" section '.text' executable -public _msys_delay -_msys_delay: +public_stdcall _msys_delay,4 ;arg1 - time mov edx,ebx mov eax,5 diff --git a/programs/develop/metcc/trunk/libc/mesys/dga.asm b/programs/develop/metcc/trunk/libc/mesys/dga.asm index b7f5957e1..f68cacba5 100644 --- a/programs/develop/metcc/trunk/libc/mesys/dga.asm +++ b/programs/develop/metcc/trunk/libc/mesys/dga.asm @@ -1,7 +1,7 @@ format ELF +include "public_stdcall.inc" section '.text' executable -public _msys_dga_get_resolution -_msys_dga_get_resolution: +public_stdcall _msys_dga_get_resolution,16 ;arg1 - *xres ;arg2 - *yres ;arg3 - *bpp diff --git a/programs/develop/metcc/trunk/libc/mesys/draw_bar.asm b/programs/develop/metcc/trunk/libc/mesys/draw_bar.asm index fcb7c2806..b1afef4a0 100644 --- a/programs/develop/metcc/trunk/libc/mesys/draw_bar.asm +++ b/programs/develop/metcc/trunk/libc/mesys/draw_bar.asm @@ -1,7 +1,7 @@ format ELF +include "public_stdcall.inc" section '.text' executable -public _msys_draw_bar -_msys_draw_bar: +public_stdcall _msys_draw_bar,20 ;arg1 - x ;arg2 - y ;arg3 - xsize diff --git a/programs/develop/metcc/trunk/libc/mesys/draw_image.asm b/programs/develop/metcc/trunk/libc/mesys/draw_image.asm index 5f4d7d02a..6bca4a788 100644 --- a/programs/develop/metcc/trunk/libc/mesys/draw_image.asm +++ b/programs/develop/metcc/trunk/libc/mesys/draw_image.asm @@ -1,7 +1,7 @@ format ELF +include "public_stdcall.inc" section '.text' executable -public _msys_putimage -_msys_putimage: +public_stdcall _msys_putimage,20 ;arg1 - x ;arg2 - y ;arg3 - xsize diff --git a/programs/develop/metcc/trunk/libc/mesys/draw_window.asm b/programs/develop/metcc/trunk/libc/mesys/draw_window.asm index a26e528b4..fa3fce490 100644 --- a/programs/develop/metcc/trunk/libc/mesys/draw_window.asm +++ b/programs/develop/metcc/trunk/libc/mesys/draw_window.asm @@ -1,8 +1,7 @@ format ELF +include "public_stdcall.inc" section '.text' executable - -public _msys_draw_window -_msys_draw_window: +public_stdcall _msys_draw_window,36 ;arg1 - xcoord ;arg2 - ycoord ;arg3 - xsize diff --git a/programs/develop/metcc/trunk/libc/mesys/event.asm b/programs/develop/metcc/trunk/libc/mesys/event.asm index bfd0f4ba3..dfac427c8 100644 --- a/programs/develop/metcc/trunk/libc/mesys/event.asm +++ b/programs/develop/metcc/trunk/libc/mesys/event.asm @@ -1,19 +1,17 @@ format ELF +include "public_stdcall.inc" section '.text' executable -public _msys_wait_for_event_infinite -_msys_wait_for_event_infinite: +public_stdcall _msys_wait_for_event_infinite,0 mov eax,10 int 0x40 ret -public _msys_check_for_event -_msys_check_for_event: +public_stdcall _msys_check_for_event,0 mov eax,11 int 0x40 ret -public _msys_wait_for_event -_msys_wait_for_event: +public_stdcall _msys_wait_for_event,4 ;arg1 - time mov edx,ebx mov eax,23 @@ -22,8 +20,7 @@ _msys_wait_for_event: mov ebx,edx ret 4 -public _msys_set_wanted_events -_msys_set_wanted_events: +public_stdcall _msys_set_wanted_events,4 ;arg1 - flags mov edx,ebx mov eax,40 diff --git a/programs/develop/metcc/trunk/libc/mesys/exit.asm b/programs/develop/metcc/trunk/libc/mesys/exit.asm index 75c4c0e74..4541546d8 100644 --- a/programs/develop/metcc/trunk/libc/mesys/exit.asm +++ b/programs/develop/metcc/trunk/libc/mesys/exit.asm @@ -1,7 +1,7 @@ format ELF +include "public_stdcall.inc" section '.text' executable -public _msys_exit -_msys_exit: +public_stdcall _msys_exit,0 xor eax,eax dec eax int 0x40 diff --git a/programs/develop/metcc/trunk/libc/mesys/file_58.asm b/programs/develop/metcc/trunk/libc/mesys/file_58.asm index 68e7190b9..0c56505d9 100644 --- a/programs/develop/metcc/trunk/libc/mesys/file_58.asm +++ b/programs/develop/metcc/trunk/libc/mesys/file_58.asm @@ -1,7 +1,7 @@ format ELF +include "public_stdcall.inc" section '.text' executable -public _msys_read_file -_msys_read_file: +public_stdcall _msys_read_file,20 ;arg1 - file name ;arg2 - file offset ;arg3 - size to read @@ -48,8 +48,7 @@ copy_file_name: pop edi esi ret -public _msys_write_file -_msys_write_file: +public_stdcall _msys_write_file,12 ;arg1 - file name ;arg2 - size ;arg3 - data @@ -74,8 +73,7 @@ _msys_write_file: pop ebp ret 12 -public _msys_run_program -_msys_run_program: +public_stdcall _msys_run_program,8 ;arg1 - program name ;arg2 - parameters push ebp diff --git a/programs/develop/metcc/trunk/libc/mesys/ipc.asm b/programs/develop/metcc/trunk/libc/mesys/ipc.asm index 980e27fab..3a32e0dc2 100644 --- a/programs/develop/metcc/trunk/libc/mesys/ipc.asm +++ b/programs/develop/metcc/trunk/libc/mesys/ipc.asm @@ -1,7 +1,7 @@ format ELF +include "public_stdcall.inc" section '.text' executable -public _msys_send_message -_msys_send_message: +public_stdcall _msys_send_message,12 ;arg1 - pid ;arg2 - msg ;arg3 - size @@ -15,8 +15,7 @@ _msys_send_message: pop esi ebx ret 12 -public _msys_define_receive_area -_msys_define_receive_area: +public_stdcall _msys_define_receive_area,8 ;arg1 - area ;arg2 - size push ebx diff --git a/programs/develop/metcc/trunk/libc/mesys/irq.asm b/programs/develop/metcc/trunk/libc/mesys/irq.asm index 2975bfe67..6d9228c05 100644 --- a/programs/develop/metcc/trunk/libc/mesys/irq.asm +++ b/programs/develop/metcc/trunk/libc/mesys/irq.asm @@ -1,7 +1,7 @@ format ELF +include "public_stdcall.inc" section '.text' executable -public _msys_get_irq_owner -_msys_get_irq_owner: +public_stdcall _msys_get_irq_owner,4 ;arg1 - irq mov edx,ebx mov eax,41 @@ -10,8 +10,7 @@ _msys_get_irq_owner: mov ebx,edx ret 4 -public _msys_get_data_read_by_irq -_msys_get_data_read_by_irq: +public_stdcall _msys_get_data_read_by_irq,12 ;arg1 - irq ;arg2 - *size ;arg3 - data @@ -37,8 +36,7 @@ _msys_get_data_read_by_irq: mov ebx,edx ret -public _msys_send_data_to_device -_msys_send_data_to_device: +public_stdcall _msys_send_data_to_device,8 ;arg1 - port ;arg2 - data mov edx,ebx @@ -49,8 +47,7 @@ _msys_send_data_to_device: mov ebx,edx ret 8 -public _msys_receive_data_from_device -_msys_receive_data_from_device: +public_stdcall _msys_receive_data_from_device,8 ;arg1 - port ;arg2 - data mov edx,ebx @@ -63,8 +60,7 @@ _msys_receive_data_from_device: mov ebx,edx ret 8 -public _msys_program_irq -_msys_program_irq: +public_stdcall _msys_program_irq,8 ;arg1 - intrtable ;arg2 - irq mov edx,ebx @@ -75,8 +71,7 @@ _msys_program_irq: mov ebx,edx ret 8 -public _msys_reserve_irq -_msys_reserve_irq: +public_stdcall _msys_reserve_irq,4 ;arg1 - irq mov edx,ebx mov eax,45 @@ -86,8 +81,7 @@ _msys_reserve_irq: mov ebx,edx ret 4 -public _msys_free_irq -_msys_free_irq: +public_stdcall _msys_free_irq,4 ;arg1 - irq mov edx,ebx mov eax,45 @@ -98,8 +92,7 @@ _msys_free_irq: mov ebx,edx ret 4 -public _msys_reserve_port_area -_msys_reserve_port_area: +public_stdcall _msys_reserve_port_area,8 ;arg1 - start ;arg2 - end push ebx @@ -111,8 +104,7 @@ _msys_reserve_port_area: pop ebx ret 8 -public _msys_free_port_area -_msys_free_port_area: +public_stdcall _msys_free_port_area,8 ;arg1 - start ;arg2 - end push ebx diff --git a/programs/develop/metcc/trunk/libc/mesys/keyboard.asm b/programs/develop/metcc/trunk/libc/mesys/keyboard.asm index f74efcbcf..2b196cee0 100644 --- a/programs/develop/metcc/trunk/libc/mesys/keyboard.asm +++ b/programs/develop/metcc/trunk/libc/mesys/keyboard.asm @@ -1,13 +1,12 @@ format ELF +include "public_stdcall.inc" section '.text' executable -public _msys_get_key -_msys_get_key: +public_stdcall _msys_get_key,0 mov eax,2 int 0x40 ret -public _msys_set_keyboard_mode -_msys_set_keyboard_mode: +public_stdcall _msys_set_keyboard_mode,4 ;arg1 - mode mov edx,ebx mov eax,66 diff --git a/programs/develop/metcc/trunk/libc/mesys/line.asm b/programs/develop/metcc/trunk/libc/mesys/line.asm index e230220df..4a82f5804 100644 --- a/programs/develop/metcc/trunk/libc/mesys/line.asm +++ b/programs/develop/metcc/trunk/libc/mesys/line.asm @@ -1,7 +1,7 @@ format ELF +include "public_stdcall.inc" section '.text' executable -public _msys_line -_msys_line: +public_stdcall _msys_line,20 ;arg1 - x1 ;arg2 - y1 ;arg3 - x2 diff --git a/programs/develop/metcc/trunk/libc/mesys/midi.asm b/programs/develop/metcc/trunk/libc/mesys/midi.asm index ef299fb7f..6929766a5 100644 --- a/programs/develop/metcc/trunk/libc/mesys/midi.asm +++ b/programs/develop/metcc/trunk/libc/mesys/midi.asm @@ -1,7 +1,7 @@ format ELF +include "public_stdcall.inc" section '.text' executable -public _msys_midi_reset -_msys_midi_reset: +public_stdcall _msys_midi_reset,0 mov edx,ebx mov eax,20 xor ebx,ebx @@ -10,8 +10,7 @@ _msys_midi_reset: mov ebx,edx ret -public _msys_midi_send -_msys_midi_send: +public_stdcall _msys_midi_send,4 ;arg1 - data mov edx,ebx mov eax,20 diff --git a/programs/develop/metcc/trunk/libc/mesys/pci.asm b/programs/develop/metcc/trunk/libc/mesys/pci.asm index 8d544c0ff..6f87e23db 100644 --- a/programs/develop/metcc/trunk/libc/mesys/pci.asm +++ b/programs/develop/metcc/trunk/libc/mesys/pci.asm @@ -1,7 +1,7 @@ format ELF +include "public_stdcall.inc" section '.text' executable -public _msys_get_pci_version -_msys_get_pci_version: +public_stdcall _msys_get_pci_version,0 mov edx,ebx mov eax,62 xor ebx,ebx @@ -10,8 +10,7 @@ _msys_get_pci_version: mov ebx,edx ret -public _msys_get_last_pci_bus -_msys_get_last_pci_bus: +public_stdcall _msys_get_last_pci_bus,0 mov edx,ebx mov eax,62 xor ebx,ebx @@ -21,8 +20,7 @@ _msys_get_last_pci_bus: mov ebx,edx ret -public _msys_get_pci_access_mechanism -_msys_get_pci_access_mechanism: +public_stdcall _msys_get_pci_access_mechanism,0 mov edx,ebx mov eax,62 mov ebx,2 @@ -31,8 +29,7 @@ _msys_get_pci_access_mechanism: mov ebx,edx ret -public _msys_pci_read_config_byte -_msys_pci_read_config_byte: +public_stdcall _msys_pci_read_config_byte,16 ;arg1 - bus ;arg2 - dev ;arg3 - fn @@ -49,8 +46,7 @@ _msys_pci_read_config_byte: mov ebx,edx ret 16 -public _msys_pci_read_config_word -_msys_pci_read_config_word: +public_stdcall _msys_pci_read_config_word,16 ;arg1 - bus ;arg2 - dev ;arg3 - fn @@ -67,8 +63,7 @@ _msys_pci_read_config_word: mov ebx,edx ret 16 -public _msys_pci_read_config_dword -_msys_pci_read_config_dword: +public_stdcall _msys_pci_read_config_dword,16 ;arg1 - bus ;arg2 - dev ;arg3 - fn @@ -85,8 +80,7 @@ _msys_pci_read_config_dword: mov ebx,edx ret 16 -public _msys_pci_write_config_byte -_msys_pci_write_config_byte: +public_stdcall _msys_pci_write_config_byte,20 ;arg1 - bus ;arg2 - dev ;arg3 - fn @@ -105,8 +99,7 @@ _msys_pci_write_config_byte: pop ebx ret 20 -public _msys_pci_write_config_word -_msys_pci_write_config_word: +public_stdcall _msys_pci_write_config_word,20 ;arg1 - bus ;arg2 - dev ;arg3 - fn @@ -125,8 +118,7 @@ _msys_pci_write_config_word: pop ebx ret 20 -public _msys_pci_write_config_dword -_msys_pci_write_config_dword: +public_stdcall _msys_pci_write_config_dword,20 ;arg1 - bus ;arg2 - dev ;arg3 - fn diff --git a/programs/develop/metcc/trunk/libc/mesys/pixel.asm b/programs/develop/metcc/trunk/libc/mesys/pixel.asm index f674ba4ce..348b1dded 100644 --- a/programs/develop/metcc/trunk/libc/mesys/pixel.asm +++ b/programs/develop/metcc/trunk/libc/mesys/pixel.asm @@ -1,7 +1,7 @@ format ELF +include "public_stdcall.inc" section '.text' executable -public _msys_putpixel -_msys_putpixel: +public_stdcall _msys_putpixel,12 ;arg1 - x ;arg2 - y ;arg3 - color diff --git a/programs/develop/metcc/trunk/libc/mesys/process.asm b/programs/develop/metcc/trunk/libc/mesys/process.asm index 15f4fda66..95c68ce3b 100644 --- a/programs/develop/metcc/trunk/libc/mesys/process.asm +++ b/programs/develop/metcc/trunk/libc/mesys/process.asm @@ -1,7 +1,7 @@ format ELF +include "public_stdcall.inc" section '.text' executable -public _msys_get_process_table -_msys_get_process_table: +public_stdcall _msys_get_process_table,8 ;arg1 - pointer to information ;arg2 - pid mov edx,ebx diff --git a/programs/develop/metcc/trunk/libc/mesys/screen.asm b/programs/develop/metcc/trunk/libc/mesys/screen.asm index 3271a6f40..8e63f2280 100644 --- a/programs/develop/metcc/trunk/libc/mesys/screen.asm +++ b/programs/develop/metcc/trunk/libc/mesys/screen.asm @@ -1,7 +1,7 @@ format ELF +include "public_stdcall.inc" section '.text' executable -public _msys_get_screen_size -_msys_get_screen_size: +public_stdcall _msys_get_screen_size,8 ;arg1 - x ;arg2 - y mov eax,14 diff --git a/programs/develop/metcc/trunk/libc/mesys/sound.asm b/programs/develop/metcc/trunk/libc/mesys/sound.asm index 9d2642919..96cb8e3f3 100644 --- a/programs/develop/metcc/trunk/libc/mesys/sound.asm +++ b/programs/develop/metcc/trunk/libc/mesys/sound.asm @@ -1,7 +1,7 @@ format ELF +include "public_stdcall.inc" section '.text' executable -public _msys_sound_load_block -_msys_sound_load_block: +public_stdcall _msys_sound_load_block,4 ;arg1 - blockptr mov edx,ebx mov eax,55 @@ -11,8 +11,7 @@ _msys_sound_load_block: mov ebx,edx ret 4 -public _msys_sound_play_block -_msys_sound_play_block: +public_stdcall _msys_sound_play_block,0 mov edx,ebx mov eax,55 xor ebx,ebx @@ -21,8 +20,7 @@ _msys_sound_play_block: mov ebx,edx ret -public _msys_sound_set_channels -_msys_sound_set_channels: +public_stdcall _msys_sound_set_channels,4 ;arg1 - channels push ebx mov eax,55 @@ -33,8 +31,7 @@ _msys_sound_set_channels: pop ebx ret 4 -public _msys_sound_set_data_size -_msys_sound_set_data_size: +public_stdcall _msys_sound_set_data_size,4 ;arg1 - data size push ebx mov eax,55 @@ -46,8 +43,7 @@ _msys_sound_set_data_size: pop ebx ret 4 -public _msys_sound_set_frequency -_msys_sound_set_frequency: +public_stdcall _msys_sound_set_frequency,4 ;arg1 - frequency push ebx mov eax,55 @@ -58,8 +54,7 @@ _msys_sound_set_frequency: pop ebx ret 4 -public _msys_sound_speaker_play -_msys_sound_speaker_play: +public_stdcall _msys_sound_speaker_play,4 ;arg1 - data mov edx,ebx mov eax,55 diff --git a/programs/develop/metcc/trunk/libc/mesys/thread.asm b/programs/develop/metcc/trunk/libc/mesys/thread.asm index 539cc375a..2e3f546e1 100644 --- a/programs/develop/metcc/trunk/libc/mesys/thread.asm +++ b/programs/develop/metcc/trunk/libc/mesys/thread.asm @@ -1,8 +1,8 @@ format ELF +include "public_stdcall.inc" section '.text' executable extrn malloc -public _msys_start_thread -_msys_start_thread: +public_stdcall _msys_start_thread,12 ;arg1 - proc ;arg2 - stacksize ;arg3 - pid diff --git a/programs/develop/metcc/trunk/libc/mesys/window_redraw.asm b/programs/develop/metcc/trunk/libc/mesys/window_redraw.asm index 459290e96..35981880a 100644 --- a/programs/develop/metcc/trunk/libc/mesys/window_redraw.asm +++ b/programs/develop/metcc/trunk/libc/mesys/window_redraw.asm @@ -1,7 +1,7 @@ format ELF +include "public_stdcall.inc" section '.text' executable -public _msys_window_redraw -_msys_window_redraw: +public_stdcall _msys_window_redraw,4 ;arg1 - status mov edx,ebx mov eax,12 diff --git a/programs/develop/metcc/trunk/libc/mesys/write_text.asm b/programs/develop/metcc/trunk/libc/mesys/write_text.asm index 318edb2b6..b2c7570ab 100644 --- a/programs/develop/metcc/trunk/libc/mesys/write_text.asm +++ b/programs/develop/metcc/trunk/libc/mesys/write_text.asm @@ -1,7 +1,7 @@ format ELF +include "public_stdcall.inc" section '.text' executable -public _msys_write_text -_msys_write_text: +public_stdcall _msys_write_text,20 ;arg1 - x ;arg2 - y ;arg3 - color diff --git a/programs/develop/metcc/trunk/source/tccmeos.c b/programs/develop/metcc/trunk/source/tccmeos.c index f6c4dbcf7..aa3858215 100644 --- a/programs/develop/metcc/trunk/source/tccmeos.c +++ b/programs/develop/metcc/trunk/source/tccmeos.c @@ -96,11 +96,12 @@ void build_reloc(me_info* me) Elf32_Sym* esym = ((Elf32_Sym *)symtab_section->data)+sym; int sect=esym->st_shndx; ss=findsection(me,sect); - if (ss==0) continue; + if (ss==0) + ss=me->bss_sections; if (rel->r_offset>s->data_size) continue; if (type==R_386_PC32) - *(int*)(rel->r_offset+s->data)+=ss->sh_addr+esym->st_value-rel->r_offset-s->sh_addr; + *(int*)(rel->r_offset+s->data)=ss->sh_addr+esym->st_value-rel->r_offset-s->sh_addr-4; else if (type==R_386_32) *(int*)(rel->r_offset+s->data)+=ss->sh_addr+esym->st_value; }