|
@ -1,9 +1,10 @@ |
|
|
push bp |
|
|
push bp |
|
|
mov bp,sp |
|
|
mov bp,sp |
|
|
|
|
|
push 10[bp] |
|
|
push 8[bp] |
|
|
push 8[bp] |
|
|
push 6[bp] |
|
|
push 6[bp] |
|
|
call _main |
|
|
call _main |
|
|
add sp, #0x4 |
|
|
add sp, #0x6 |
|
|
pop bp |
|
|
pop bp |
|
|
retf |
|
|
retf |
|
|
! 1 |
|
|
! 1 |
|
@ -11,20 +12,22 @@ retf |
|
|
! 1 # 1 "std_singos/string.h" |
|
|
! 1 # 1 "std_singos/string.h" |
|
|
! 1 void strcpy (destination, destination_segment, source, source_segment ); |
|
|
! 1 void strcpy (destination, destination_segment, source, source_segment ); |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 2 |
|
|
! 2 void memcpy (destination, destination_segment, source, source_segment, num_bytes ); |
|
|
! 3 void strcpy (destination, destination_segment, source, source_segment ) |
|
|
!BCC_EOS |
|
|
! 4 char *destination; |
|
|
! 3 |
|
|
|
|
|
! 4 void strcpy (destination, destination_segment, source, source_segment ) |
|
|
|
|
|
! 5 char *destination; |
|
|
export _strcpy |
|
|
export _strcpy |
|
|
_strcpy: |
|
|
_strcpy: |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 5 int destination_segment; |
|
|
! 6 int destination_segment; |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 6 char *source; |
|
|
! 7 char *source; |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 7 int source_segment; |
|
|
! 8 int source_segment; |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 8 { |
|
|
! 9 { |
|
|
! 9 #asm |
|
|
! 10 #asm |
|
|
!BCC_ASM |
|
|
!BCC_ASM |
|
|
_strcpy.source set 6 |
|
|
_strcpy.source set 6 |
|
|
_strcpy.destination set 2 |
|
|
_strcpy.destination set 2 |
|
@ -35,7 +38,7 @@ _strcpy.destination_segment set 4 |
|
|
; IN di: the second (zero terminated) string |
|
|
; IN di: the second (zero terminated) string |
|
|
; OUT SF and ZF (same semantics as cmp) |
|
|
; OUT SF and ZF (same semantics as cmp) |
|
|
|
|
|
|
|
|
! 15 19 |
|
|
! 16 20 |
|
|
|
|
|
|
|
|
push bp |
|
|
push bp |
|
|
mov bp,sp |
|
|
mov bp,sp |
|
@ -70,11 +73,202 @@ _strcpy.destination_segment set 4 |
|
|
pop ax |
|
|
pop ax |
|
|
pop bp |
|
|
pop bp |
|
|
|
|
|
|
|
|
! 53 endasm |
|
|
! 54 endasm |
|
|
|
|
|
!BCC_ENDASM |
|
|
|
|
|
! 55 } |
|
|
|
|
|
ret |
|
|
|
|
|
! 56 |
|
|
|
|
|
! 57 void memcpy (destination, destination_segment, source, source_segment, num_bytes) |
|
|
|
|
|
! 58 void *destination; |
|
|
|
|
|
export _memcpy |
|
|
|
|
|
_memcpy: |
|
|
|
|
|
!BCC_EOS |
|
|
|
|
|
! 59 int destination_segment; |
|
|
|
|
|
!BCC_EOS |
|
|
|
|
|
! 60 void *source; |
|
|
|
|
|
!BCC_EOS |
|
|
|
|
|
! 61 int source_segment; |
|
|
|
|
|
!BCC_EOS |
|
|
|
|
|
! 62 int num_bytes; |
|
|
|
|
|
!BCC_EOS |
|
|
|
|
|
! 63 { |
|
|
|
|
|
! 64 #asm |
|
|
|
|
|
!BCC_ASM |
|
|
|
|
|
_memcpy.source set 6 |
|
|
|
|
|
_memcpy.destination set 2 |
|
|
|
|
|
_memcpy.num_bytes set $A |
|
|
|
|
|
_memcpy.source_segment set 8 |
|
|
|
|
|
_memcpy.destination_segment set 4 |
|
|
|
|
|
; copy two strings |
|
|
|
|
|
; IN si: the first (zero terminated) string |
|
|
|
|
|
; IN di: the second (zero terminated) string |
|
|
|
|
|
; OUT SF and ZF (same semantics as cmp) |
|
|
|
|
|
|
|
|
|
|
|
! 70 75 |
|
|
|
|
|
|
|
|
|
|
|
push bp |
|
|
|
|
|
mov bp,sp |
|
|
|
|
|
memcpy: |
|
|
|
|
|
push ax |
|
|
|
|
|
push bx |
|
|
|
|
|
push di |
|
|
|
|
|
push es |
|
|
|
|
|
push si |
|
|
|
|
|
push ds |
|
|
|
|
|
mov ax, 4[bp]; ; |
|
|
|
|
|
mov di, ax |
|
|
|
|
|
mov ax, 6[bp]; ; |
|
|
|
|
|
mov es, ax |
|
|
|
|
|
mov ax, 8[bp]; ; |
|
|
|
|
|
mov si, ax |
|
|
|
|
|
mov ax, 10[bp]; ; |
|
|
|
|
|
mov ds, ax |
|
|
|
|
|
mov cx, 12[bp]; |
|
|
|
|
|
.memcpy_loop: |
|
|
|
|
|
movsb |
|
|
|
|
|
cmp cx, 0x0 |
|
|
|
|
|
je .end |
|
|
|
|
|
dec cx |
|
|
|
|
|
jmp .loop |
|
|
|
|
|
.memcpy_end: |
|
|
|
|
|
pop ds |
|
|
|
|
|
pop si |
|
|
|
|
|
pop es |
|
|
|
|
|
pop di |
|
|
|
|
|
pop bx |
|
|
|
|
|
pop ax |
|
|
|
|
|
pop bp |
|
|
|
|
|
|
|
|
|
|
|
! 109 endasm |
|
|
|
|
|
!BCC_ENDASM |
|
|
|
|
|
! 110 # 6 "main.c" |
|
|
|
|
|
! 6 } |
|
|
|
|
|
ret |
|
|
|
|
|
! 7 # 1 "std_ |
|
|
|
|
|
! 0 singos/stdio.h" |
|
|
|
|
|
! 1 void print(string); |
|
|
|
|
|
!BCC_EOS |
|
|
|
|
|
! 2 |
|
|
|
|
|
! 3 void print(string) |
|
|
|
|
|
! 4 char* string; |
|
|
|
|
|
export _print |
|
|
|
|
|
_print: |
|
|
|
|
|
!BCC_EOS |
|
|
|
|
|
! 5 { |
|
|
|
|
|
! 6 #asm |
|
|
|
|
|
!BCC_ASM |
|
|
|
|
|
_print.string set 2 |
|
|
|
|
|
|
|
|
|
|
|
push bp |
|
|
|
|
|
mov bp,sp |
|
|
|
|
|
mov si,4[bp] |
|
|
|
|
|
call 0x0000:0x7C47 |
|
|
|
|
|
pop bp |
|
|
|
|
|
! 12 endasm |
|
|
|
|
|
!BCC_ENDASM |
|
|
|
|
|
! 13 } |
|
|
|
|
|
ret |
|
|
|
|
|
! 14 |
|
|
|
|
|
! 15 void print_stack(argument) |
|
|
|
|
|
! 16 { |
|
|
|
|
|
export _print_stack |
|
|
|
|
|
_print_stack: |
|
|
|
|
|
! 17 #asm |
|
|
|
|
|
!BCC_ASM |
|
|
|
|
|
_print_stack.argument set 2 |
|
|
|
|
|
|
|
|
|
|
|
push bp |
|
|
|
|
|
mov bp,sp |
|
|
|
|
|
push ds |
|
|
|
|
|
push ax |
|
|
|
|
|
|
|
|
|
|
|
mov ax, ss |
|
|
|
|
|
mov ds, ax |
|
|
|
|
|
mov si,4[bp] |
|
|
|
|
|
call 0x0000:0x7C47 |
|
|
|
|
|
|
|
|
|
|
|
pop ax |
|
|
|
|
|
pop ds |
|
|
|
|
|
pop bp |
|
|
|
|
|
! 31 endasm |
|
|
|
|
|
!BCC_ENDASM |
|
|
|
|
|
! 32 } |
|
|
|
|
|
ret |
|
|
|
|
|
! 33 |
|
|
|
|
|
! 34 dump_ax_return(input) |
|
|
|
|
|
! 35 void* input; |
|
|
|
|
|
export _dump_ax_return |
|
|
|
|
|
_dump_ax_return: |
|
|
|
|
|
!BCC_EOS |
|
|
|
|
|
! 36 { |
|
|
|
|
|
! 37 return input; |
|
|
|
|
|
push bp |
|
|
|
|
|
mov bp,sp |
|
|
|
|
|
push di |
|
|
|
|
|
push si |
|
|
|
|
|
mov ax,4[bp] |
|
|
|
|
|
pop si |
|
|
|
|
|
pop di |
|
|
|
|
|
pop bp |
|
|
|
|
|
ret |
|
|
|
|
|
!BCC_EOS |
|
|
|
|
|
! 38 } |
|
|
|
|
|
! 39 |
|
|
|
|
|
! 40 void dump_ax(input) |
|
|
|
|
|
! 41 void* input; |
|
|
|
|
|
export _dump_ax |
|
|
|
|
|
_dump_ax: |
|
|
|
|
|
!BCC_EOS |
|
|
|
|
|
! 42 { |
|
|
|
|
|
! 43 |
|
|
|
|
|
! 44 dump_ax_return(input) |
|
|
|
|
|
push bp |
|
|
|
|
|
mov bp,sp |
|
|
|
|
|
push di |
|
|
|
|
|
push si |
|
|
|
|
|
! 45 #asm |
|
|
|
|
|
! Debug: list * void input = [S+6+2] (used reg = ) |
|
|
|
|
|
push 4[bp] |
|
|
|
|
|
! Debug: func () int = dump_ax_return+0 (used reg = ) |
|
|
|
|
|
call _dump_ax_return |
|
|
|
|
|
inc sp |
|
|
|
|
|
inc sp |
|
|
|
|
|
!BCC_EOS |
|
|
|
|
|
!BCC_ASM |
|
|
|
|
|
_dump_ax.input set 8 |
|
|
|
|
|
.dump_ax.input set 4 |
|
|
|
|
|
push bp |
|
|
|
|
|
mov bp,sp |
|
|
|
|
|
call 0x000:0x7C2A |
|
|
|
|
|
pop bp |
|
|
|
|
|
! 50 endasm |
|
|
|
|
|
!BCC_ENDASM |
|
|
|
|
|
!BCC_EOS |
|
|
|
|
|
! 51 } |
|
|
|
|
|
pop si |
|
|
|
|
|
pop di |
|
|
|
|
|
pop bp |
|
|
|
|
|
ret |
|
|
|
|
|
! 52 |
|
|
|
|
|
! 53 void print_newline() |
|
|
|
|
|
! 54 { |
|
|
|
|
|
export _print_newline |
|
|
|
|
|
_print_newline: |
|
|
|
|
|
! 55 #asm |
|
|
|
|
|
!BCC_ASM |
|
|
|
|
|
|
|
|
|
|
|
printCRLF: |
|
|
|
|
|
mov ah, #0xE |
|
|
|
|
|
mov al, #13 |
|
|
|
|
|
int #0x10 |
|
|
|
|
|
mov al, #10 |
|
|
|
|
|
int #0x10 |
|
|
|
|
|
ret |
|
|
|
|
|
! 63 endasm |
|
|
!BCC_ENDASM |
|
|
!BCC_ENDASM |
|
|
! 54 } |
|
|
! 64 } |
|
|
ret |
|
|
ret |
|
|
! 55 # 1 "driver/disk.h" |
|
|
! 65 # 1 "driver/disk.h" |
|
|
! 1 int data_from_disk(index, number_sectors, data_buffer, data_buffer_segment); |
|
|
! 1 int data_from_disk(index, number_sectors, data_buffer, data_buffer_segment); |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 2 int disk_service_read_data_from_disk(index, number_sectors, data_buffer, data_buffer_segment); |
|
|
! 2 int disk_service_read_data_from_disk(index, number_sectors, data_buffer, data_buffer_segment); |
|
@ -142,212 +336,231 @@ _disk_service_read_data_from_disk.index set 2 |
|
|
!BCC_ENDASM |
|
|
!BCC_ENDASM |
|
|
! 52 } |
|
|
! 52 } |
|
|
ret |
|
|
ret |
|
|
! 53 # 10 "main.c" |
|
|
! 53 # 11 "main.c" |
|
|
! 10 #define SPACE_VBR_RECORD 2048 |
|
|
! 11 #define SPACE_VBR_RECORD 2048 |
|
|
! 11 |
|
|
! 12 |
|
|
! 12 #define DEFAULT_ENTRY_SIZE 1 |
|
|
! 13 #define DEFAULT_ENTRY_SIZE 1 |
|
|
! 13 |
|
|
! 14 |
|
|
! 14 #define NUMBER_OF_MBR_PARTITIONS 4 |
|
|
! 15 #def |
|
|
! 15 |
|
|
! 15 ine NUMBER_OF_MBR_PARTITIONS 4 |
|
|
! 16 #define DEFAULT_DATA_POINTER_SIZE 4 |
|
|
! 16 |
|
|
! 17 |
|
|
! 17 #define DEFAULT_DATA_POINTER_SIZE 4 |
|
|
! 18 |
|
|
! 18 |
|
|
! 19 |
|
|
! 19 |
|
|
! 20 void dump_ax(input); |
|
|
! 20 |
|
|
|
|
|
! 21 void dump_ax(input); |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 21 void print_stack(argument); |
|
|
! 22 void print_stack(argument); |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 22 void print_newline(); |
|
|
! 23 void print_newline(); |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 23 |
|
|
! 24 |
|
|
! 24 typedef struct Directory_Table Directory_Table; |
|
|
! 25 typedef struct Directory_Table Directory_Table; |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 25 typedef struct Struct_Table_Entry Table_Entry; |
|
|
! 26 typedef struct Struct_Table_Entry Table_Entry; |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 26 typedef struct struct_partition_control partition_control; |
|
|
! 27 typedef struct struct_partition_control partition_control; |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 27 typedef struct File_System_Control_Information FSCI; |
|
|
! 28 typedef struct File_System_Control_Information FSCI; |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 28 typedef struct meta_information_format mif; |
|
|
! 29 typedef struct meta_information_format mif; |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 29 typedef struct tag_record tag_record; |
|
|
! 30 typedef struct tag_record tag_record; |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 30 typedef struct lsfs_file lsfs_file; |
|
|
! 31 typedef struct lsfs_file lsfs_file; |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 31 |
|
|
! 32 typedef struct Parameter_Struct Parameter_Struct; |
|
|
! 32 typedef enum Table_Entry_Kind |
|
|
|
|
|
! 33 { |
|
|
|
|
|
! 34 |
|
|
|
|
|
! 35 ENTRY_EMPTY = 0, |
|
|
|
|
|
! 36 ENTRY_FILE = 1, |
|
|
|
|
|
! 37 ENTRY_DIRECTORY = 2, |
|
|
|
|
|
! 38 } Table_Entry_Kind; |
|
|
|
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 39 |
|
|
! 33 |
|
|
! 40 typedef enum Service_Action |
|
|
! 34 typedef enum Table_Entry_Kind |
|
|
! 41 { |
|
|
! 35 { |
|
|
! 42 SERIVCE_LOAD_DISK = 1, |
|
|
! 36 |
|
|
! 43 SERVICE_FIND_ENTRY = 2, |
|
|
! 37 ENTRY_EMPTY = 0, |
|
|
! 44 SERIVCE_READ_DATA = 3, |
|
|
! 38 ENTRY_FILE = 1, |
|
|
! 45 SERIVCE_WRITE_DATA = 4, |
|
|
! 39 ENTRY_DIRECTORY = 2, |
|
|
! 46 |
|
|
! 40 } Table_Entry_Kind; |
|
|
! 47 } Service_Action; |
|
|
|
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
|
|
|
! 41 |
|
|
|
|
|
! 42 typedef enum Service_Action |
|
|
|
|
|
! 43 { |
|
|
|
|
|
! 44 SERIVCE_LOAD_DISK = 1, |
|
|
|
|
|
! 45 SERVICE_FIND_ENTRY = 2, |
|
|
|
|
|
! 46 SERIVCE_READ_DATA = 3, |
|
|
|
|
|
! 47 SERIVCE_WRITE_DATA = 4, |
|
|
! 48 |
|
|
! 48 |
|
|
! 49 int number_low; |
|
|
! 49 } Service_Action; |
|
|
|
|
|
!BCC_EOS |
|
|
|
|
|
! 50 |
|
|
|
|
|
! 51 struct Struct_Table_Entry |
|
|
|
|
|
! 52 { |
|
|
|
|
|
! 53 char filename[256]; |
|
|
|
|
|
!BCC_EOS |
|
|
|
|
|
! 54 long file_id[2]; |
|
|
|
|
|
!BCC_EOS |
|
|
|
|
|
! 55 long file_size[2]; |
|
|
|
|
|
!BCC_EOS |
|
|
|
|
|
! 56 void* ext_file_data_low; |
|
|
|
|
|
!BCC_EOS |
|
|
|
|
|
! 57 void* ext_file_data_high; |
|
|
|
|
|
!BCC_EOS |
|
|
|
|
|
! 58 long number_sector_s; |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 50 int selector; |
|
|
! 59 short entry_kind; |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 51 |
|
|
! 60 short extra_control_bits1; |
|
|
! 52 struct Struct_Table_Entry |
|
|
|
|
|
! 53 { |
|
|
|
|
|
! 54 char filename[256]; |
|
|
|
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 55 long file_id[2]; |
|
|
! 61 short extra_control_bits2; |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 56 long file_size[2]; |
|
|
! 62 short extra_control_bits3; |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 57 void* ext_file_data_low; |
|
|
! 63 long table_entry_sector_index[2]; |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 58 void* ext_file_data_high; |
|
|
! 64 long data_pointer[27 * 2]; |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 59 long number_sector_s; |
|
|
! 65 }; |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 60 short entry_kind; |
|
|
! 66 |
|
|
|
|
|
! 67 struct File_System_Control_Information |
|
|
|
|
|
! 68 { |
|
|
|
|
|
! 69 char filesystem_information[256]; |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 61 short extra_control_bits1; |
|
|
! 70 long master_table_index[2]; |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 62 short extra_control_bits2; |
|
|
! 71 long this_partition_offset_on_disk[2]; |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 63 short extra_control_bits3; |
|
|
! 72 long next_free_sector[2]; |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 64 long table_entry_sector_index[2]; |
|
|
! 73 long next_uniqe_id[2]; |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 65 long data_pointer[27 * 2]; |
|
|
! 74 long next_sector_reuse_pointer[2]; |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 66 }; |
|
|
! 75 long last_sector_index_on_partition[2]; |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 67 |
|
|
! 76 long maximum_sectors_on_disk[2]; |
|
|
! 68 struct File_System_Control_Information |
|
|
|
|
|
! 69 { |
|
|
|
|
|
! 70 char filesystem_information[256]; |
|
|
|
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 71 long master_table_index[2]; |
|
|
! 77 long sector_size_on_disk[2]; |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 72 long this_partition_offset_on_disk[2]; |
|
|
! 78 long not_used[48]; |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 73 long next_free_sector[2]; |
|
|
! 79 |
|
|
|
|
|
! 80 }; |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 74 long next_uniqe_id[2]; |
|
|
! 81 |
|
|
|
|
|
! 82 typedef struct Directory_Table |
|
|
|
|
|
! 83 { |
|
|
|
|
|
! 84 Table_Entry entries[16 ]; |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 75 long next_sector_reuse_pointer[2]; |
|
|
! 85 |
|
|
|
|
|
! 86 }; |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 76 long last_sector_index_on_partition[2]; |
|
|
! 87 |
|
|
|
|
|
! 88 struct Parameter_Struct |
|
|
|
|
|
! 89 { |
|
|
|
|
|
! 90 char* path; |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 77 long maximum_sectors_on_disk[2]; |
|
|
! 91 char* new_path; |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 78 long sector_size_on_disk[2]; |
|
|
! 92 int buffer_segment; |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 79 long not_used[48]; |
|
|
! 93 int buffer_address; |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 80 |
|
|
! 94 int buffer_size; |
|
|
! 81 }; |
|
|
|
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 82 |
|
|
! 95 int data_length; |
|
|
! 83 typedef struct Directory_Table |
|
|
|
|
|
! 84 { |
|
|
|
|
|
! 85 Table_Entry entries[16 ]; |
|
|
|
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 86 |
|
|
! 96 int byte_offset_into_file; |
|
|
! 87 }; |
|
|
|
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 88 |
|
|
! 97 Table_Entry_Kind entry_kind; |
|
|
! 89 |
|
|
|
|
|
! 90 void print(string); |
|
|
|
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 91 |
|
|
! 98 }; |
|
|
! 92 int main(selector, parameter_struct) |
|
|
!BCC_EOS |
|
|
! 93 int selector; |
|
|
! 99 |
|
|
|
|
|
! 100 int main(selector, pointer_parameter_segment, pointer_parameter_struct) |
|
|
|
|
|
! 101 int selector; |
|
|
export _main |
|
|
export _main |
|
|
_main: |
|
|
_main: |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 94 void* parameter |
|
|
! 102 void* pointer_parameter_segment; |
|
|
! 94 _struct; |
|
|
!BCC_EOS |
|
|
|
|
|
! 103 void* pointer_parameter_struct |
|
|
|
|
|
! 103 ; |
|
|
|
|
|
!BCC_EOS |
|
|
|
|
|
! 104 { |
|
|
|
|
|
! 105 |
|
|
|
|
|
! 106 |
|
|
|
|
|
! 107 |
|
|
|
|
|
! 108 FSCI fsci; |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 95 { |
|
|
! 109 Service_Action service_action; |
|
|
! 96 |
|
|
|
|
|
! 97 |
|
|
|
|
|
! 98 |
|
|
|
|
|
! 99 FSCI fsci; |
|
|
|
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 100 Service_Action service_action; |
|
|
! 110 Directory_Table current_table; |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 101 Directory_Table current_table; |
|
|
! 111 Parameter_Struct parameter_struct; |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 102 int local_segment = 0x7e0; |
|
|
! 112 int local_segment = 0x7e0; |
|
|
push bp |
|
|
push bp |
|
|
mov bp,sp |
|
|
mov bp,sp |
|
|
push di |
|
|
push di |
|
|
push si |
|
|
push si |
|
|
add sp,#-$2204 |
|
|
add sp,#-$2214 |
|
|
! Debug: eq int = const $7E0 to int local_segment = [S+$220A-$220A] (used reg = ) |
|
|
! Debug: eq int = const $7E0 to int local_segment = [S+$221A-$221A] (used reg = ) |
|
|
mov ax,#$7E0 |
|
|
mov ax,#$7E0 |
|
|
mov -$2208[bp],ax |
|
|
mov -$2218[bp],ax |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 103 int stack_segment = 0x8fc0; |
|
|
! 113 int stack_segment = 0x8fc0; |
|
|
dec sp |
|
|
dec sp |
|
|
dec sp |
|
|
dec sp |
|
|
! Debug: eq unsigned int = const $8FC0 to int stack_segment = [S+$220C-$220C] (used reg = ) |
|
|
! Debug: eq unsigned int = const $8FC0 to int stack_segment = [S+$221C-$221C] (used reg = ) |
|
|
mov ax,#$8FC0 |
|
|
mov ax,#$8FC0 |
|
|
mov -$220A[bp],ax |
|
|
mov -$221A[bp],ax |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 104 long index_as_long; |
|
|
! 114 long index_as_long; |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 105 |
|
|
! 115 |
|
|
! 106 char local_path[256]; |
|
|
! 116 char local_path[256]; |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 107 service_action = selector; |
|
|
! 117 service_action = selector; |
|
|
add sp,#-$104 |
|
|
add sp,#-$104 |
|
|
! Debug: eq int selector = [S+$2310+2] to int service_action = [S+$2310-$208] (used reg = ) |
|
|
! Debug: eq int selector = [S+$2320+2] to int service_action = [S+$2320-$208] (used reg = ) |
|
|
mov ax,4[bp] |
|
|
mov ax,4[bp] |
|
|
mov -$206[bp],ax |
|
|
mov -$206[bp],ax |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 108 |
|
|
! 118 |
|
|
! 109 switch (service_action) |
|
|
! 119 switch (service_action) |
|
|
mov ax,-$206[bp] |
|
|
mov ax,-$206[bp] |
|
|
! 110 { |
|
|
! 120 { |
|
|
br .3 |
|
|
br .3 |
|
|
! 111 case SERIVCE_LOAD_DISK: |
|
|
! 121 case SERIVCE_LOAD_DISK: |
|
|
! 112 { |
|
|
! 122 { |
|
|
.4: |
|
|
.4: |
|
|
! 113 |
|
|
! 123 |
|
|
! 114 |
|
|
! 124 |
|
|
! 115 |
|
|
! 125 |
|
|
! 116 |
|
|
! 126 |
|
|
! 117 index_as_long = parameter_struct; |
|
|
! 127 index_as_long = pointer_parameter_struct; |
|
|
! Debug: eq * void parameter_struct = [S+$2310+4] to long index_as_long = [S+$2310-$2210] (used reg = ) |
|
|
! Debug: eq * void pointer_parameter_struct = [S+$2320+6] to long index_as_long = [S+$2320-$2220] (used reg = ) |
|
|
mov ax,6[bp] |
|
|
mov ax,8[bp] |
|
|
xor bx,bx |
|
|
xor bx,bx |
|
|
mov -$220E[bp],ax |
|
|
mov -$221E[bp],ax |
|
|
mov -$220C[bp],bx |
|
|
mov -$221C[bp],bx |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 118 disk_service_read_data_from_disk(index_as_long, 1, &fsci, stack_segment); |
|
|
! 128 disk_service_read_data_from_disk(index_as_long, 1, &fsci, stack_segment); |
|
|
! Debug: list int stack_segment = [S+$2310-$220C] (used reg = ) |
|
|
! Debug: list int stack_segment = [S+$2320-$221C] (used reg = ) |
|
|
push -$220A[bp] |
|
|
push -$221A[bp] |
|
|
! Debug: list * struct File_System_Control_Information fsci = S+$2312-$206 (used reg = ) |
|
|
! Debug: list * struct File_System_Control_Information fsci = S+$2322-$206 (used reg = ) |
|
|
lea bx,-$204[bp] |
|
|
lea bx,-$204[bp] |
|
|
push bx |
|
|
push bx |
|
|
! Debug: list int = const 1 (used reg = ) |
|
|
! Debug: list int = const 1 (used reg = ) |
|
|
mov ax,*1 |
|
|
mov ax,*1 |
|
|
push ax |
|
|
push ax |
|
|
! Debug: list long index_as_long = [S+$2316-$2210] (used reg = ) |
|
|
! Debug: list long index_as_long = [S+$2326-$2220] (used reg = ) |
|
|
push -$220C[bp] |
|
|
push -$221C[bp] |
|
|
push -$220E[bp] |
|
|
push -$221E[bp] |
|
|
! Debug: func () int = disk_service_read_data_from_disk+0 (used reg = ) |
|
|
! Debug: func () int = disk_service_read_data_from_disk+0 (used reg = ) |
|
|
call _disk_service_read_data_from_disk |
|
|
call _disk_service_read_data_from_disk |
|
|
add sp,*$A |
|
|
add sp,*$A |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 119 print("File System has been loaded: "); |
|
|
! 129 print("File System has been loaded: "); |
|
|
! Debug: list * char = .5+0 (used reg = ) |
|
|
! Debug: list * char = .5+0 (used reg = ) |
|
|
mov bx,#.5 |
|
|
mov bx,#.5 |
|
|
push bx |
|
|
push bx |
|
@ -356,12 +569,12 @@ call _print |
|
|
inc sp |
|
|
inc sp |
|
|
inc sp |
|
|
inc sp |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 120 print_newline(); |
|
|
! 130 print_newline(); |
|
|
! Debug: func () void = print_newline+0 (used reg = ) |
|
|
! Debug: func () void = print_newline+0 (used reg = ) |
|
|
call _print_newline |
|
|
call _print_newline |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 121 print_stack(fsci.filesystem_information); |
|
|
! 131 print_stack(fsci.filesystem_information); |
|
|
! Debug: list * char fsci = S+$2310-$206 (used reg = ) |
|
|
! Debug: list * char fsci = S+$2320-$206 (used reg = ) |
|
|
lea bx,-$204[bp] |
|
|
lea bx,-$204[bp] |
|
|
push bx |
|
|
push bx |
|
|
! Debug: func () void = print_stack+0 (used reg = ) |
|
|
! Debug: func () void = print_stack+0 (used reg = ) |
|
@ -369,33 +582,62 @@ call _print_stack |
|
|
inc sp |
|
|
inc sp |
|
|
inc sp |
|
|
inc sp |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 122 print_newline(); |
|
|
! 132 print_newline(); |
|
|
! Debug: func () void = print_newline+0 (used reg = ) |
|
|
! Debug: func () void = print_newline+0 (used reg = ) |
|
|
call _print_newline |
|
|
call _print_newline |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 123 } break; |
|
|
! 133 } break; |
|
|
br .1 |
|
|
br .1 |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 124 case SERVICE_FIND_ENTRY: |
|
|
! 134 case SERVICE_FIND_ENTRY: |
|
|
! 125 { |
|
|
! 135 { |
|
|
.6: |
|
|
.6: |
|
|
! 126 disk_service_read_data_from_disk(fsci.master_table_index[0], 16 , ¤t_table, stack_segment); |
|
|
! 136 memcpy(¶meter_struct, stack_segment, pointer_parameter_struct, pointer_parameter_segment, sizeof(Parameter_Struct)); |
|
|
! Debug: list int stack_segment = [S+$2310-$220C] (used reg = ) |
|
|
! Debug: list int = const $10 (used reg = ) |
|
|
push -$220A[bp] |
|
|
mov ax,*$10 |
|
|
! Debug: list * struct Directory_Table current_table = S+$2312-$2208 (used reg = ) |
|
|
push ax |
|
|
|
|
|
! Debug: list * void pointer_parameter_segment = [S+$2322+4] (used reg = ) |
|
|
|
|
|
push 6[bp] |
|
|
|
|
|
! Debug: list * void pointer_parameter_struct = [S+$2324+6] (used reg = ) |
|
|
|
|
|
push 8[bp] |
|
|
|
|
|
! Debug: list int stack_segment = [S+$2326-$221C] (used reg = ) |
|
|
|
|
|
push -$221A[bp] |
|
|
|
|
|
! Debug: list * struct Parameter_Struct parameter_struct = S+$2328-$2218 (used reg = ) |
|
|
|
|
|
lea bx,-$2216[bp] |
|
|
|
|
|
push bx |
|
|
|
|
|
! Debug: func () void = memcpy+0 (used reg = ) |
|
|
|
|
|
call _memcpy |
|
|
|
|
|
add sp,*$A |
|
|
|
|
|
!BCC_EOS |
|
|
|
|
|
! 137 dump_ax(parameter_struct.buffer_size); |
|
|
|
|
|
! Debug: list int parameter_struct = [S+$2320-$2210] (used reg = ) |
|
|
|
|
|
push -$220E[bp] |
|
|
|
|
|
! Debug: func () void = dump_ax+0 (used reg = ) |
|
|
|
|
|
call _dump_ax |
|
|
|
|
|
inc sp |
|
|
|
|
|
inc sp |
|
|
|
|
|
!BCC_EOS |
|
|
|
|
|
! 138 print_newline(); |
|
|
|
|
|
! Debug: func () void = print_newline+0 (used reg = ) |
|
|
|
|
|
call _print_newline |
|
|
|
|
|
!BCC_EOS |
|
|
|
|
|
! 139 disk_service_read_data_from_disk(fsci.master_table_index[0], 16 , ¤t_table, stack_segment); |
|
|
|
|
|
! Debug: list int stack_segment = [S+$2320-$221C] (used reg = ) |
|
|
|
|
|
push -$221A[bp] |
|
|
|
|
|
! Debug: list * struct Directory_Table current_table = S+$2322-$2208 (used reg = ) |
|
|
lea bx,-$2206[bp] |
|
|
lea bx,-$2206[bp] |
|
|
push bx |
|
|
push bx |
|
|
! Debug: list int = const $10 (used reg = ) |
|
|
! Debug: list int = const $10 (used reg = ) |
|
|
mov ax,*$10 |
|
|
mov ax,*$10 |
|
|
push ax |
|
|
push ax |
|
|
! Debug: list long fsci = [S+$2316-$106] (used reg = ) |
|
|
! Debug: list long fsci = [S+$2326-$106] (used reg = ) |
|
|
push -$102[bp] |
|
|
push -$102[bp] |
|
|
push -$104[bp] |
|
|
push -$104[bp] |
|
|
! Debug: func () int = disk_service_read_data_from_disk+0 (used reg = ) |
|
|
! Debug: func () int = disk_service_read_data_from_disk+0 (used reg = ) |
|
|
call _disk_service_read_data_from_disk |
|
|
call _disk_service_read_data_from_disk |
|
|
add sp,*$A |
|
|
add sp,*$A |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 127 print("Current table: "); |
|
|
! 140 print("Current table: "); |
|
|
! Debug: list * char = .7+0 (used reg = ) |
|
|
! Debug: list * char = .7+0 (used reg = ) |
|
|
mov bx,#.7 |
|
|
mov bx,#.7 |
|
|
push bx |
|
|
push bx |
|
@ -404,12 +646,12 @@ call _print |
|
|
inc sp |
|
|
inc sp |
|
|
inc sp |
|
|
inc sp |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 128 print_newline(); |
|
|
! 141 print_newline(); |
|
|
! Debug: func () void = print_newline+0 (used reg = ) |
|
|
! Debug: func () void = print_newline+0 (used reg = ) |
|
|
call _print_newline |
|
|
call _print_newline |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 129 print_stack(current_table.entries[0].filename); |
|
|
! 142 print_stack(current_table.entries[0].filename); |
|
|
! Debug: list * char current_table = S+$2310-$2208 (used reg = ) |
|
|
! Debug: list * char current_table = S+$2320-$2208 (used reg = ) |
|
|
lea bx,-$2206[bp] |
|
|
lea bx,-$2206[bp] |
|
|
push bx |
|
|
push bx |
|
|
! Debug: func () void = print_stack+0 (used reg = ) |
|
|
! Debug: func () void = print_stack+0 (used reg = ) |
|
@ -417,12 +659,12 @@ call _print_stack |
|
|
inc sp |
|
|
inc sp |
|
|
inc sp |
|
|
inc sp |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 130 print_newline(); |
|
|
! 143 print_newline(); |
|
|
! Debug: func () void = print_newline+0 (used reg = ) |
|
|
! Debug: func () void = print_newline+0 (used reg = ) |
|
|
call _print_newline |
|
|
call _print_newline |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 131 print_stack(current_table.entries[1].filename); |
|
|
! 144 print_stack(current_table.entries[1].filename); |
|
|
! Debug: list * char current_table = S+$2310-$2008 (used reg = ) |
|
|
! Debug: list * char current_table = S+$2320-$2008 (used reg = ) |
|
|
lea bx,-$2006[bp] |
|
|
lea bx,-$2006[bp] |
|
|
push bx |
|
|
push bx |
|
|
! Debug: func () void = print_stack+0 (used reg = ) |
|
|
! Debug: func () void = print_stack+0 (used reg = ) |
|
@ -430,12 +672,12 @@ call _print_stack |
|
|
inc sp |
|
|
inc sp |
|
|
inc sp |
|
|
inc sp |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 132 print_newline(); |
|
|
! 145 print_newline(); |
|
|
! Debug: func () void = print_newline+0 (used reg = ) |
|
|
! Debug: func () void = print_newline+0 (used reg = ) |
|
|
call _print_newline |
|
|
call _print_newline |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 133 print_stack(current_table.entries[2].filename); |
|
|
! 146 print_stack(current_table.entries[2].filename); |
|
|
! Debug: list * char current_table = S+$2310-$1E08 (used reg = ) |
|
|
! Debug: list * char current_table = S+$2320-$1E08 (used reg = ) |
|
|
lea bx,-$1E06[bp] |
|
|
lea bx,-$1E06[bp] |
|
|
push bx |
|
|
push bx |
|
|
! Debug: func () void = print_stack+0 (used reg = ) |
|
|
! Debug: func () void = print_stack+0 (used reg = ) |
|
@ -443,17 +685,19 @@ call _print_stack |
|
|
inc sp |
|
|
inc sp |
|
|
inc sp |
|
|
inc sp |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 134 print_newline(); |
|
|
! 147 print_newline(); |
|
|
! Debug: func () void = print_newline+0 (used reg = ) |
|
|
! Debug: func () void = print_newline+0 (used reg = ) |
|
|
call _print_newline |
|
|
call _print_newline |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 135 } break; |
|
|
! 148 } break; |
|
|
jmp .1 |
|
|
jmp .1 |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 136 case SERIVCE_READ_DATA: |
|
|
! 149 case SERIVCE_READ_DATA: |
|
|
! 137 { |
|
|
! 150 { |
|
|
.8: |
|
|
.8: |
|
|
! 138 print("Hit READ case"); |
|
|
! 151 # 159 |
|
|
|
|
|
! 159 |
|
|
|
|
|
! 160 print("Hit READ case"); |
|
|
! Debug: list * char = .9+0 (used reg = ) |
|
|
! Debug: list * char = .9+0 (used reg = ) |
|
|
mov bx,#.9 |
|
|
mov bx,#.9 |
|
|
push bx |
|
|
push bx |
|
@ -462,13 +706,13 @@ call _print |
|
|
inc sp |
|
|
inc sp |
|
|
inc sp |
|
|
inc sp |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 139 } break; |
|
|
! 161 } break; |
|
|
jmp .1 |
|
|
jmp .1 |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 140 case SERIVCE_WRITE_DATA: |
|
|
! 162 case SERIVCE_WRITE_DATA: |
|
|
! 141 { |
|
|
! 163 { |
|
|
.A: |
|
|
.A: |
|
|
! 142 print("Hit WRITE case"); |
|
|
! 164 print("Hit WRITE case"); |
|
|
! Debug: list * char = .B+0 (used reg = ) |
|
|
! Debug: list * char = .B+0 (used reg = ) |
|
|
mov bx,#.B |
|
|
mov bx,#.B |
|
|
push bx |
|
|
push bx |
|
@ -477,13 +721,13 @@ call _print |
|
|
inc sp |
|
|
inc sp |
|
|
inc sp |
|
|
inc sp |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 143 } break; |
|
|
! 165 } break; |
|
|
jmp .1 |
|
|
jmp .1 |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 144 default: |
|
|
! 166 default: |
|
|
! 145 { |
|
|
! 167 { |
|
|
.C: |
|
|
.C: |
|
|
! 146 print("Default case"); |
|
|
! 168 print("Default case"); |
|
|
! Debug: list * char = .D+0 (used reg = ) |
|
|
! Debug: list * char = .D+0 (used reg = ) |
|
|
mov bx,#.D |
|
|
mov bx,#.D |
|
|
push bx |
|
|
push bx |
|
@ -492,10 +736,10 @@ call _print |
|
|
inc sp |
|
|
inc sp |
|
|
inc sp |
|
|
inc sp |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 147 } |
|
|
! 169 } |
|
|
! 148 } |
|
|
! 170 } |
|
|
! 149 |
|
|
! 171 |
|
|
! 150 return 0; |
|
|
! 172 return 0; |
|
|
jmp .1 |
|
|
jmp .1 |
|
|
.3: |
|
|
.3: |
|
|
sub ax,*1 |
|
|
sub ax,*1 |
|
@ -508,7 +752,7 @@ sub ax,*1 |
|
|
je .A |
|
|
je .A |
|
|
jmp .C |
|
|
jmp .C |
|
|
.1: |
|
|
.1: |
|
|
..FFFF = -$2310 |
|
|
..FFFF = -$2320 |
|
|
xor ax,ax |
|
|
xor ax,ax |
|
|
lea sp,-4[bp] |
|
|
lea sp,-4[bp] |
|
|
pop si |
|
|
pop si |
|
@ -516,131 +760,10 @@ pop di |
|
|
pop bp |
|
|
pop bp |
|
|
ret |
|
|
ret |
|
|
!BCC_EOS |
|
|
!BCC_EOS |
|
|
! 151 |
|
|
! 173 |
|
|
! 152 } |
|
|
! 174 } |
|
|
! 153 # 157 |
|
|
! 175 |
|
|
! 157 void print(string) |
|
|
|
|
|
! Register BX used in function main |
|
|
! Register BX used in function main |
|
|
! 158 char* string; |
|
|
|
|
|
export _print |
|
|
|
|
|
_print: |
|
|
|
|
|
!BCC_EOS |
|
|
|
|
|
! 159 { |
|
|
|
|
|
! 160 #asm |
|
|
|
|
|
!BCC_ASM |
|
|
|
|
|
_print.string set 2 |
|
|
|
|
|
|
|
|
|
|
|
push bp |
|
|
|
|
|
mov bp,sp |
|
|
|
|
|
mov si,4[bp] |
|
|
|
|
|
call 0x0000:0x7C47 |
|
|
|
|
|
pop bp |
|
|
|
|
|
! 166 endasm |
|
|
|
|
|
!BCC_ENDASM |
|
|
|
|
|
! 167 } |
|
|
|
|
|
ret |
|
|
|
|
|
! 168 |
|
|
|
|
|
! 169 void print_stack(argument) |
|
|
|
|
|
! 170 { |
|
|
|
|
|
export _print_stack |
|
|
|
|
|
_print_stack: |
|
|
|
|
|
! 171 #asm |
|
|
|
|
|
!BCC_ASM |
|
|
|
|
|
_print_stack.argument set 2 |
|
|
|
|
|
|
|
|
|
|
|
push bp |
|
|
|
|
|
mov bp,sp |
|
|
|
|
|
push ds |
|
|
|
|
|
push ax |
|
|
|
|
|
|
|
|
|
|
|
mov ax, ss |
|
|
|
|
|
mov ds, ax |
|
|
|
|
|
mov si,4[bp] |
|
|
|
|
|
call 0x0000:0x7C47 |
|
|
|
|
|
|
|
|
|
|
|
pop ax |
|
|
|
|
|
pop ds |
|
|
|
|
|
pop bp |
|
|
|
|
|
! 185 endasm |
|
|
|
|
|
!BCC_ENDASM |
|
|
|
|
|
! 186 } |
|
|
|
|
|
ret |
|
|
|
|
|
! 187 |
|
|
|
|
|
! 188 dump_ax_return(input) |
|
|
|
|
|
! 189 void* input; |
|
|
|
|
|
export _dump_ax_return |
|
|
|
|
|
_dump_ax_return: |
|
|
|
|
|
!BCC_EOS |
|
|
|
|
|
! 190 { |
|
|
|
|
|
! 191 return input; |
|
|
|
|
|
push bp |
|
|
|
|
|
mov bp,sp |
|
|
|
|
|
push di |
|
|
|
|
|
push si |
|
|
|
|
|
mov ax,4[bp] |
|
|
|
|
|
pop si |
|
|
|
|
|
pop di |
|
|
|
|
|
pop bp |
|
|
|
|
|
ret |
|
|
|
|
|
!BCC_EOS |
|
|
|
|
|
! 192 } |
|
|
|
|
|
! 193 |
|
|
|
|
|
! 194 void dump_ax(input) |
|
|
|
|
|
! 195 void* input; |
|
|
|
|
|
export _dump_ax |
|
|
|
|
|
_dump_ax: |
|
|
|
|
|
!BCC_EOS |
|
|
|
|
|
! 196 { |
|
|
|
|
|
! 197 |
|
|
|
|
|
! 198 dump_ax_return(input) |
|
|
|
|
|
push bp |
|
|
|
|
|
mov bp,sp |
|
|
|
|
|
push di |
|
|
|
|
|
push si |
|
|
|
|
|
! 199 #asm |
|
|
|
|
|
! Debug: list * void input = [S+6+2] (used reg = ) |
|
|
|
|
|
push 4[bp] |
|
|
|
|
|
! Debug: func () int = dump_ax_return+0 (used reg = ) |
|
|
|
|
|
call _dump_ax_return |
|
|
|
|
|
inc sp |
|
|
|
|
|
inc sp |
|
|
|
|
|
!BCC_EOS |
|
|
|
|
|
!BCC_ASM |
|
|
|
|
|
_dump_ax.input set 8 |
|
|
|
|
|
.dump_ax.input set 4 |
|
|
|
|
|
push bp |
|
|
|
|
|
mov bp,sp |
|
|
|
|
|
call 0x000:0x7C2A |
|
|
|
|
|
pop bp |
|
|
|
|
|
! 204 endasm |
|
|
|
|
|
!BCC_ENDASM |
|
|
|
|
|
!BCC_EOS |
|
|
|
|
|
! 205 } |
|
|
|
|
|
pop si |
|
|
|
|
|
pop di |
|
|
|
|
|
pop bp |
|
|
|
|
|
ret |
|
|
|
|
|
! 206 |
|
|
|
|
|
! 207 void print_newline() |
|
|
|
|
|
! 208 { |
|
|
|
|
|
export _print_newline |
|
|
|
|
|
_print_newline: |
|
|
|
|
|
! 209 #asm |
|
|
|
|
|
!BCC_ASM |
|
|
|
|
|
|
|
|
|
|
|
printCRLF: |
|
|
|
|
|
mov ah, #0xE |
|
|
|
|
|
mov al, #13 |
|
|
|
|
|
int #0x10 |
|
|
|
|
|
mov al, #10 |
|
|
|
|
|
int #0x10 |
|
|
|
|
|
ret |
|
|
|
|
|
! 217 endasm |
|
|
|
|
|
!BCC_ENDASM |
|
|
|
|
|
! 218 # 217 |
|
|
|
|
|
! 217 } |
|
|
|
|
|
ret |
|
|
|
|
|
! 218 |
|
|
|
|
|
.D: |
|
|
.D: |
|
|
.E: |
|
|
.E: |
|
|
.ascii "Default case" |
|
|
.ascii "Default case" |
|
@ -662,7 +785,5 @@ ret |
|
|
.ascii "File System has been loaded: " |
|
|
.ascii "File System has been loaded: " |
|
|
.byte 0 |
|
|
.byte 0 |
|
|
.bss |
|
|
.bss |
|
|
.comm _selector,2 |
|
|
|
|
|
.comm _number_low,2 |
|
|
|
|
|
|
|
|
|
|
|
! 0 errors detected |
|
|
! 0 errors detected |
|
|