You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
869 lines
18 KiB
869 lines
18 KiB
push bp |
|
mov bp,sp |
|
push 10[bp] |
|
push 8[bp] |
|
push 6[bp] |
|
call _main |
|
add sp, #0x6 |
|
pop bp |
|
retf |
|
! 1 |
|
! 1 # 1 "main.c" |
|
! 1 # 1 "std_singos/string.h" |
|
! 1 void strcpy (destination, destination_segment, source, source_segment ); |
|
!BCC_EOS |
|
! 2 int strlen (source, source_segment); |
|
!BCC_EOS |
|
! 3 void memcpy (destination, destination_segment, source, source_segment, num_bytes ); |
|
!BCC_EOS |
|
! 4 |
|
! 5 int strlen (source, source_segment) |
|
! 6 { |
|
export _strlen |
|
_strlen: |
|
! 7 #asm |
|
!BCC_ASM |
|
_strlen.source set 2 |
|
_strlen.source_segment set 4 |
|
|
|
|
|
push bp |
|
mov bp,sp |
|
push ds |
|
push bx |
|
|
|
mov ax, 6[bp]; |
|
mov ds, ax |
|
|
|
mov bx, 4[bp]; |
|
|
|
label_strlen: |
|
mov cx, #0x0 ; Set counte to zero |
|
.label_strlen_loop: |
|
mov BYTE al, [bx] |
|
cmp al, #0x0 |
|
je .label_strlen_done |
|
inc cx ; Count 1 |
|
inc bx ; Look at next char |
|
jmp .label_strlen_loop |
|
.label_strlen_done: |
|
mov ax, cx |
|
|
|
pop bx |
|
pop ds |
|
pop bp |
|
! 35 endasm |
|
!BCC_ENDASM |
|
! 36 } |
|
ret |
|
! 37 |
|
! 38 void strcpy (destination, destination_segment, source, source_segment ) |
|
! 39 char *destination; |
|
export _strcpy |
|
_strcpy: |
|
!BCC_EOS |
|
! 40 int destination_segment; |
|
!BCC_EOS |
|
! 41 char *source; |
|
!BCC_EOS |
|
! 42 int source_segment; |
|
!BCC_EOS |
|
! 43 { |
|
! 44 #asm |
|
!BCC_ASM |
|
_strcpy.source set 6 |
|
_strcpy.destination set 2 |
|
_strcpy.source_segment set 8 |
|
_strcpy.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) |
|
|
|
! 50 54 |
|
|
|
push bp |
|
mov bp,sp |
|
label_strcpy: |
|
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, 0x050 |
|
.label_strcpy_loop: |
|
movsb |
|
cmp cx, 0x0 |
|
je .label_strcpy_end |
|
dec cx |
|
jmp .label_strcpy_loop |
|
.label_strcpy_end: |
|
pop ds |
|
pop si |
|
pop es |
|
pop di |
|
pop bx |
|
pop ax |
|
pop bp |
|
|
|
! 88 endasm |
|
!BCC_ENDASM |
|
! 89 } |
|
ret |
|
! 90 |
|
! 91 void memcpy (destination, destination_segment, source, source_segment, num_bytes) |
|
! 92 void *destination; |
|
export _memcpy |
|
_memcpy: |
|
!BCC_EOS |
|
! 93 int destination_segment; |
|
!BCC_EOS |
|
! 94 void *source; |
|
!BCC_EOS |
|
! 95 int source_segment; |
|
!BCC_EOS |
|
! 96 int num_bytes; |
|
!BCC_EOS |
|
! 97 { |
|
! 98 #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) |
|
|
|
! 104 109 |
|
|
|
push bp |
|
mov bp,sp |
|
label_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]; |
|
.label_memcpy_loop: |
|
movsb |
|
cmp cx, 0x0 |
|
je .label_memcpy_end |
|
dec cx |
|
jmp .label_memcpy_loop |
|
.label_memcpy_end: |
|
pop ds |
|
pop si |
|
pop es |
|
pop di |
|
pop bx |
|
pop ax |
|
pop bp |
|
|
|
! 143 endasm |
|
!BCC_ENDASM |
|
! 144 # 6 "main.c" |
|
! 6 } |
|
ret |
|
! 7 # 1 "std_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 |
|
! 64 } |
|
ret |
|
! 65 # 1 "driver/disk.h" |
|
! 1 int data_from_disk(index, number_sectors, data_buffer, data_buffer_segment); |
|
!BCC_EOS |
|
! 2 int disk_service_read_data_from_disk(index, number_sectors, data_buffer, data_buffer_segment); |
|
!BCC_EOS |
|
! 3 |
|
! 4 int disk_service_read_data_from_disk(index, number_sectors, data_buffer, data_buffer_segment) |
|
! 5 long* index; |
|
export _disk_service_read_data_from_disk |
|
_disk_service_read_data_from_disk: |
|
!BCC_EOS |
|
! 6 long number_sectors; |
|
!BCC_EOS |
|
! 7 void* data_buffer; |
|
!BCC_EOS |
|
! 8 int data_buffer_segment; |
|
!BCC_EOS |
|
! 9 { |
|
! 10 |
|
! 11 #asm |
|
!BCC_ASM |
|
_disk_service_read_data_from_disk.data_buffer set 8 |
|
_disk_service_read_data_from_disk.number_sectors set 4 |
|
_disk_service_read_data_from_disk.data_buffer_segment set $A |
|
_disk_service_read_data_from_disk.index set 2 |
|
|
|
! 13 define number_sectors 8[bp]; |
|
|
|
|
|
|
|
push bp |
|
mov bp,sp |
|
pusha |
|
|
|
lsfs_load_data: |
|
mov ax, 4[bp]; |
|
mov WORD [DAPACK.lba_addr_dw_low], ax |
|
mov bx, 8[bp]; |
|
mov WORD [DAPACK.blkcnt], bx |
|
mov cx, 12[bp]; |
|
mov WORD [DAPACK.db_addr_segment], cx |
|
mov dx, 10[bp]; ; |
|
mov WORD [DAPACK.db_addr_offset], dx |
|
mov si, #DAPACK ; address of |
|
mov ah, #0x42 ; READ |
|
mov dl, [global_disk_identifier] |
|
int #0x13 |
|
;call 0x0000:0x7C2A |
|
popa |
|
pop bp |
|
ret |
|
|
|
|
|
DAPACK: |
|
DAPACK.dap_Size: db 0x10 |
|
DAPACK.rev_byte: db 0x0 |
|
DAPACK.blkcnt: dw 0x0 |
|
DAPACK.db_addr_offset: dw 0x0 |
|
DAPACK.db_addr_segment: dw 0x0 |
|
DAPACK.lba_addr_dw_low: dd 0x0 |
|
DAPACK.lba_addr_dw_high: dd 0x0 |
|
|
|
global_disk_identifier: db 0x80 |
|
|
|
! 51 endasm |
|
!BCC_ENDASM |
|
! 52 } |
|
ret |
|
! 53 # 11 "main.c" |
|
! 11 #define SPACE_VBR_RECORD 2048 |
|
! 12 |
|
! 13 #define DEFAULT_ENTRY_SIZE 1 |
|
! 14 |
|
! 15 #define NUMBER_OF_MBR_PARTITIONS 4 |
|
! 16 |
|
! 17 #define DEFAULT_DATA_POINTER_SIZE 4 |
|
! 18 |
|
! 19 |
|
! 20 |
|
! 21 void dump_ax(input); |
|
!BCC_EOS |
|
! 22 void print_stack(argument); |
|
!BCC_EOS |
|
! 23 void print_newline(); |
|
!BCC_EOS |
|
! 24 |
|
! 25 typedef struct Directory_Table Directory_Table; |
|
!BCC_EOS |
|
! 26 typedef struct Struct_Table_Entry Table_Entry; |
|
!BCC_EOS |
|
! 27 typedef struct struct_partition_control partition_control; |
|
!BCC_EOS |
|
! 28 typedef struct File_System_Control_Information FSCI; |
|
!BCC_EOS |
|
! 29 typedef struct meta_information_format mif; |
|
!BCC_EOS |
|
! 30 typedef struct tag_record tag_record; |
|
!BCC_EOS |
|
! 31 typedef struct lsfs_file lsfs_file; |
|
!BCC_EOS |
|
! 32 typedef struct Parameter_Struct Parameter_Struct; |
|
!BCC_EOS |
|
! 33 |
|
! 34 typedef enum Table_Entry_Kind |
|
! 35 { |
|
! 36 |
|
! 37 ENTRY_EMPTY = 0, |
|
! 38 ENTRY_FILE = 1, |
|
! 39 ENTRY_DIRECTORY = 2, |
|
! 40 } Table_Entry_Kind; |
|
!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 |
|
! 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 |
|
! 59 short entry_kind; |
|
!BCC_EOS |
|
! 60 short extra_control_bits1; |
|
!BCC_EOS |
|
! 61 short extra_control_bits2; |
|
!BCC_EOS |
|
! 62 short extra_control_bits3; |
|
!BCC_EOS |
|
! 63 long table_entry_sector_index[2]; |
|
!BCC_EOS |
|
! 64 long data_pointer[27 * 2]; |
|
!BCC_EOS |
|
! 65 }; |
|
!BCC_EOS |
|
! 66 |
|
! 67 struct File_System_Control_Information |
|
! 68 { |
|
! 69 char filesystem_information[256]; |
|
!BCC_EOS |
|
! 70 long master_table_index[2]; |
|
!BCC_EOS |
|
! 71 long this_partition_offset_on_disk[2]; |
|
!BCC_EOS |
|
! 72 long next |
|
! 72 _free_sector[2]; |
|
!BCC_EOS |
|
! 73 long next_uniqe_id[2]; |
|
!BCC_EOS |
|
! 74 long next_sector_reuse_pointer[2]; |
|
!BCC_EOS |
|
! 75 long last_sector_index_on_partition[2]; |
|
!BCC_EOS |
|
! 76 long maximum_sectors_on_disk[2]; |
|
!BCC_EOS |
|
! 77 long sector_size_on_disk[2]; |
|
!BCC_EOS |
|
! 78 long not_used[48]; |
|
!BCC_EOS |
|
! 79 |
|
! 80 }; |
|
!BCC_EOS |
|
! 81 |
|
! 82 typedef struct Directory_Table |
|
! 83 { |
|
! 84 Table_Entry entries[16 ]; |
|
!BCC_EOS |
|
! 85 |
|
! 86 }; |
|
!BCC_EOS |
|
! 87 |
|
! 88 struct Parameter_Struct |
|
! 89 { |
|
! 90 char* path; |
|
!BCC_EOS |
|
! 91 char* new_path; |
|
!BCC_EOS |
|
! 92 int buffer_segment; |
|
!BCC_EOS |
|
! 93 int buffer_address; |
|
!BCC_EOS |
|
! 94 int buffer_size; |
|
!BCC_EOS |
|
! 95 int data_length; |
|
!BCC_EOS |
|
! 96 int byte_offset_into_file; |
|
!BCC_EOS |
|
! 97 Table_Entry_Kind entry_kind; |
|
!BCC_EOS |
|
! 98 }; |
|
!BCC_EOS |
|
! 99 |
|
! 100 int main(selector, pointer_parameter_segment, pointer_parameter_struct) |
|
! 101 int selector; |
|
export _main |
|
_main: |
|
!BCC_EOS |
|
! 102 void* pointer_parameter_segment; |
|
!BCC_EOS |
|
! 103 void* pointer_parameter_struct; |
|
!BCC_EOS |
|
! 104 { |
|
! 105 |
|
! 106 |
|
! 107 |
|
! 108 FSCI fsci; |
|
!BCC_EOS |
|
! 109 Service_Action service_action; |
|
!BCC_EOS |
|
! 110 Directory_Table current_table; |
|
!BCC_EOS |
|
! 111 Parameter_Struct parameter_struct; |
|
!BCC_EOS |
|
! 112 int local_segment = 0x7e0; |
|
push bp |
|
mov bp,sp |
|
push di |
|
push si |
|
add sp,#-$2214 |
|
! Debug: eq int = const $7E0 to int local_segment = [S+$221A-$221A] (used reg = ) |
|
mov ax,#$7E0 |
|
mov -$2218[bp],ax |
|
!BCC_EOS |
|
! 113 int stack_segment = 0x8fc0; |
|
dec sp |
|
dec sp |
|
! Debug: eq unsigned int = const $8FC0 to int stack_segment = [S+$221C-$221C] (used reg = ) |
|
mov ax,#$8FC0 |
|
mov -$221A[bp],ax |
|
!BCC_EOS |
|
! 114 int path_length; |
|
!BCC_EOS |
|
! 115 long index_as_long; |
|
!BCC_EOS |
|
! 116 |
|
! 117 char local_path[256]; |
|
!BCC_EOS |
|
! 118 service_action = selector; |
|
add sp,#-$106 |
|
! Debug: eq int selector = [S+$2322+2] to int service_action = [S+$2322-$208] (used reg = ) |
|
mov ax,4[bp] |
|
mov -$206[bp],ax |
|
!BCC_EOS |
|
! 119 |
|
! 120 switch (service_action) |
|
mov ax,-$206[bp] |
|
! 121 { |
|
br .3 |
|
! 122 case SERIVCE_LOAD_DISK: |
|
! 123 { |
|
.4: |
|
! 124 |
|
! 125 |
|
! 126 |
|
! 127 |
|
! 128 index_as_long = pointer_parameter_struct; |
|
! Debug: eq * void pointer_parameter_struct = [S+$2322+6] to long index_as_long = [S+$2322-$2222] (used reg = ) |
|
mov ax,8[bp] |
|
xor bx,bx |
|
mov -$2220[bp],ax |
|
mov -$221E[bp],bx |
|
!BCC_EOS |
|
! 129 disk_service_read_data_from_disk(index_as_long, 1, &fsci, stack_segment); |
|
! Debug: list int stack_segment = [S+$2322-$221C] (used reg = ) |
|
push -$221A[bp] |
|
! Debug: list * struct File_System_Control_Information fsci = S+$2324-$206 (used reg = ) |
|
lea bx,-$204[bp] |
|
push bx |
|
! Debug: list int = const 1 (used reg = ) |
|
mov ax,*1 |
|
push ax |
|
! Debug: list long index_as_long = [S+$2328-$2222] (used reg = ) |
|
push -$221E[bp] |
|
push -$2220[bp] |
|
! Debug: func () int = disk_service_read_data_from_disk+0 (used reg = ) |
|
call _disk_service_read_data_from_disk |
|
add sp,*$A |
|
!BCC_EOS |
|
! 130 print("File System has been loaded: "); |
|
! Debug: list * char = .5+0 (used reg = ) |
|
mov bx,#.5 |
|
push bx |
|
! Debug: func () void = print+0 (used reg = ) |
|
call _print |
|
inc sp |
|
inc sp |
|
!BCC_EOS |
|
! 131 print_newline(); |
|
! Debug: func () void = print_newline+0 (used reg = ) |
|
call _print_newline |
|
!BCC_EOS |
|
! 132 print_stack(fsci.filesystem_information); |
|
! Debug: list * char fsci = S+$2322-$206 (used reg = ) |
|
lea bx,-$204[bp] |
|
push bx |
|
! Debug: func () void = print_stack+0 (used reg = ) |
|
call _print_stack |
|
inc sp |
|
inc sp |
|
!BCC_EOS |
|
! 133 print_newline(); |
|
! Debug: func () void = print_newline+0 (used reg = ) |
|
call _print_newline |
|
!BCC_EOS |
|
! 134 } break; |
|
br .1 |
|
!BCC_EOS |
|
! 135 case SERVICE_FIND_ENTRY: |
|
! 136 { |
|
.6: |
|
! 137 memcpy(¶meter_struct, stack_segment, pointer_parameter_struct, pointer_parameter_segment, sizeof(Parameter_Struct)); |
|
! Debug: list int = const $10 (used reg = ) |
|
mov ax,*$10 |
|
push ax |
|
! Debug: list * void pointer_parameter_segment = [S+$2324+4] (used reg = ) |
|
push 6[bp] |
|
! Debug: list * void pointer_parameter_struct = [S+$2326+6] (used reg = ) |
|
push 8[bp] |
|
! Debug: list int stack_segment = [S+$2328-$221C] (used reg = ) |
|
push -$221A[bp] |
|
! Debug: list * struct Parameter_Struct parameter_struct = S+$232A-$2218 (used reg = ) |
|
lea bx,-$2216[bp] |
|
push bx |
|
! Debug: func () void = memcpy+0 (used reg = ) |
|
call _memcpy |
|
add sp,*$A |
|
!BCC_EOS |
|
! 138 path_length = strlen(parameter_struct.path, pointer_parameter_segment); |
|
! Debug: list * void pointer_parameter_segment = [S+$2322+4] (used reg = ) |
|
push 6[bp] |
|
! Debug: list * char parameter_struct = [S+$2324-$2218] (used reg = ) |
|
push -$2216[bp] |
|
! Debug: func () int = strlen+0 (used reg = ) |
|
call _strlen |
|
add sp,*4 |
|
! Debug: eq int = ax+0 to int path_length = [S+$2322-$221E] (used reg = ) |
|
mov -$221C[bp],ax |
|
!BCC_EOS |
|
! 139 memcpy(local_path, stack_segment, parameter_struct.path, pointer_parameter_segment, path_length); |
|
! Debug: list int path_length = [S+$2322-$221E] (used reg = ) |
|
push -$221C[bp] |
|
! Debug: list * void pointer_parameter_segment = [S+$2324+4] (used reg = ) |
|
push 6[bp] |
|
! Debug: list * char parameter_struct = [S+$2326-$2218] (used reg = ) |
|
push -$2216[bp] |
|
! Debug: list int stack_segment = [S+$2328-$221C] (used reg = ) |
|
push -$221A[bp] |
|
! Debug: list * char local_path = S+$232A-$2322 (used reg = ) |
|
lea bx,-$2320[bp] |
|
push bx |
|
! Debug: func () void = memcpy+0 (used reg = ) |
|
call _memcpy |
|
add sp,*$A |
|
!BCC_EOS |
|
! 140 local_path[path_length] = 0; |
|
! Debug: ptradd int path_length = [S+$2322-$221E] to [$100] char local_path = S+$2322-$2322 (used reg = ) |
|
mov ax,-$221C[bp] |
|
mov bx,bp |
|
add bx,ax |
|
! Debug: eq int = const 0 to char = [bx-$2320] (used reg = ) |
|
xor al,al |
|
mov -$2320[bx],al |
|
!BCC_EOS |
|
! 141 print_stack(local_path); |
|
! Debug: list * char local_path = S+$2322-$2322 (used reg = ) |
|
lea bx,-$2320[bp] |
|
push bx |
|
! Debug: func () void = print_stack+0 (used reg = ) |
|
call _print_stack |
|
inc sp |
|
inc sp |
|
!BCC_EOS |
|
! 142 print_newline(); |
|
! Debug: func () void = print_newline+0 (used reg = ) |
|
call _print_newline |
|
!BCC_EOS |
|
! 143 disk_service_read_data_from_disk(fsci.master_table_index[0], 16 , ¤t_table, stack_segment); |
|
! Debug: list int stack_segment = [S+$2322-$221C] (used reg = ) |
|
push -$221A[bp] |
|
! Debug: list * struct Directory_Table current_table = S+$2324-$2208 (used reg = ) |
|
lea bx,-$2206[bp] |
|
push bx |
|
! Debug: list int = const $10 (used reg = ) |
|
mov ax,*$10 |
|
push ax |
|
! Debug: list long fsci = [S+$2328-$106] (used reg = ) |
|
push -$102[bp] |
|
push -$104[bp] |
|
! Debug: func () int = disk_service_read_data_from_disk+0 (used reg = ) |
|
call _disk_service_read_data_from_disk |
|
add sp,*$A |
|
!BCC_EOS |
|
! 144 print("Current table: "); |
|
! Debug: list * char = .7+0 (used reg = ) |
|
mov bx,#.7 |
|
push bx |
|
! Debug: func () void = print+0 (used reg = ) |
|
call _print |
|
inc sp |
|
inc sp |
|
!BCC_EOS |
|
! 145 print_newline( |
|
! 145 ); |
|
! Debug: func () void = print_newline+0 (used reg = ) |
|
call _print_newline |
|
!BCC_EOS |
|
! 146 print_stack(current_table.entries[0].filename); |
|
! Debug: list * char current_table = S+$2322-$2208 (used reg = ) |
|
lea bx,-$2206[bp] |
|
push bx |
|
! Debug: func () void = print_stack+0 (used reg = ) |
|
call _print_stack |
|
inc sp |
|
inc sp |
|
!BCC_EOS |
|
! 147 print_newline(); |
|
! Debug: func () void = print_newline+0 (used reg = ) |
|
call _print_newline |
|
!BCC_EOS |
|
! 148 print_stack(current_table.entries[1].filename); |
|
! Debug: list * char current_table = S+$2322-$2008 (used reg = ) |
|
lea bx,-$2006[bp] |
|
push bx |
|
! Debug: func () void = print_stack+0 (used reg = ) |
|
call _print_stack |
|
inc sp |
|
inc sp |
|
!BCC_EOS |
|
! 149 print_newline(); |
|
! Debug: func () void = print_newline+0 (used reg = ) |
|
call _print_newline |
|
!BCC_EOS |
|
! 150 print_stack(current_table.entries[2].filename); |
|
! Debug: list * char current_table = S+$2322-$1E08 (used reg = ) |
|
lea bx,-$1E06[bp] |
|
push bx |
|
! Debug: func () void = print_stack+0 (used reg = ) |
|
call _print_stack |
|
inc sp |
|
inc sp |
|
!BCC_EOS |
|
! 151 print_newline(); |
|
! Debug: func () void = print_newline+0 (used reg = ) |
|
call _print_newline |
|
!BCC_EOS |
|
! 152 } break; |
|
jmp .1 |
|
!BCC_EOS |
|
! 153 case SERIVCE_READ_DATA: |
|
! 154 { |
|
.8: |
|
! 155 # 163 |
|
! 163 |
|
! 164 print("Hit READ case"); |
|
! Debug: list * char = .9+0 (used reg = ) |
|
mov bx,#.9 |
|
push bx |
|
! Debug: func () void = print+0 (used reg = ) |
|
call _print |
|
inc sp |
|
inc sp |
|
!BCC_EOS |
|
! 165 } break; |
|
jmp .1 |
|
!BCC_EOS |
|
! 166 case SERIVCE_WRITE_DATA: |
|
! 167 { |
|
.A: |
|
! 168 print("Hit WRITE case"); |
|
! Debug: list * char = .B+0 (used reg = ) |
|
mov bx,#.B |
|
push bx |
|
! Debug: func () void = print+0 (used reg = ) |
|
call _print |
|
inc sp |
|
inc sp |
|
!BCC_EOS |
|
! 169 } break; |
|
jmp .1 |
|
!BCC_EOS |
|
! 170 default: |
|
! 171 { |
|
.C: |
|
! 172 print("Default case"); |
|
! Debug: list * char = .D+0 (used reg = ) |
|
mov bx,#.D |
|
push bx |
|
! Debug: func () void = print+0 (used reg = ) |
|
call _print |
|
inc sp |
|
inc sp |
|
!BCC_EOS |
|
! 173 } |
|
! 174 } |
|
! 175 |
|
! 176 return 0; |
|
jmp .1 |
|
.3: |
|
sub ax,*1 |
|
beq .4 |
|
sub ax,*1 |
|
beq .6 |
|
sub ax,*1 |
|
je .8 |
|
sub ax,*1 |
|
je .A |
|
jmp .C |
|
.1: |
|
..FFFF = -$2322 |
|
xor ax,ax |
|
lea sp,-4[bp] |
|
pop si |
|
pop di |
|
pop bp |
|
ret |
|
!BCC_EOS |
|
! 177 |
|
! 178 } |
|
! 179 |
|
! Register BX used in function main |
|
.D: |
|
.E: |
|
.ascii "Default case" |
|
.byte 0 |
|
.B: |
|
.F: |
|
.ascii "Hit WRITE case" |
|
.byte 0 |
|
.9: |
|
.10: |
|
.ascii "Hit READ case" |
|
.byte 0 |
|
.7: |
|
.11: |
|
.ascii "Current table: " |
|
.byte 0 |
|
.5: |
|
.12: |
|
.ascii "File System has been loaded: " |
|
.byte 0 |
|
.bss |
|
|
|
! 0 errors detected
|
|
|