選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

789 行
16 KiB

5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
5年前
  1. push bp
  2. mov bp,sp
  3. push 10[bp]
  4. push 8[bp]
  5. push 6[bp]
  6. call _main
  7. add sp, #0x6
  8. pop bp
  9. retf
  10. ! 1
  11. ! 1 # 1 "main.c"
  12. ! 1 # 1 "std_singos/string.h"
  13. ! 1 void strcpy (destination, destination_segment, source, source_segment );
  14. !BCC_EOS
  15. ! 2 void memcpy (destination, destination_segment, source, source_segment, num_bytes );
  16. !BCC_EOS
  17. ! 3
  18. ! 4 void strcpy (destination, destination_segment, source, source_segment )
  19. ! 5 char *destination;
  20. export _strcpy
  21. _strcpy:
  22. !BCC_EOS
  23. ! 6 int destination_segment;
  24. !BCC_EOS
  25. ! 7 char *source;
  26. !BCC_EOS
  27. ! 8 int source_segment;
  28. !BCC_EOS
  29. ! 9 {
  30. ! 10 #asm
  31. !BCC_ASM
  32. _strcpy.source set 6
  33. _strcpy.destination set 2
  34. _strcpy.source_segment set 8
  35. _strcpy.destination_segment set 4
  36. ; copy two strings
  37. ; IN si: the first (zero terminated) string
  38. ; IN di: the second (zero terminated) string
  39. ; OUT SF and ZF (same semantics as cmp)
  40. ! 16 20
  41. push bp
  42. mov bp,sp
  43. stringcompare:
  44. push ax
  45. push bx
  46. push di
  47. push es
  48. push si
  49. push ds
  50. mov ax, 4[bp]; ;
  51. mov di, ax
  52. mov ax, 6[bp]; ;
  53. mov es, ax
  54. mov ax, 8[bp]; ;
  55. mov si, ax
  56. mov ax, 10[bp]; ;
  57. mov ds, ax
  58. mov cx, 0x050
  59. .loop:
  60. movsb
  61. cmp cx, 0x0
  62. je .end
  63. dec cx
  64. jmp .loop
  65. .end:
  66. pop ds
  67. pop si
  68. pop es
  69. pop di
  70. pop bx
  71. pop ax
  72. pop bp
  73. ! 54 endasm
  74. !BCC_ENDASM
  75. ! 55 }
  76. ret
  77. ! 56
  78. ! 57 void memcpy (destination, destination_segment, source, source_segment, num_bytes)
  79. ! 58 void *destination;
  80. export _memcpy
  81. _memcpy:
  82. !BCC_EOS
  83. ! 59 int destination_segment;
  84. !BCC_EOS
  85. ! 60 void *source;
  86. !BCC_EOS
  87. ! 61 int source_segment;
  88. !BCC_EOS
  89. ! 62 int num_bytes;
  90. !BCC_EOS
  91. ! 63 {
  92. ! 64 #asm
  93. !BCC_ASM
  94. _memcpy.source set 6
  95. _memcpy.destination set 2
  96. _memcpy.num_bytes set $A
  97. _memcpy.source_segment set 8
  98. _memcpy.destination_segment set 4
  99. ; copy two strings
  100. ; IN si: the first (zero terminated) string
  101. ; IN di: the second (zero terminated) string
  102. ; OUT SF and ZF (same semantics as cmp)
  103. ! 70 75
  104. push bp
  105. mov bp,sp
  106. memcpy:
  107. push ax
  108. push bx
  109. push di
  110. push es
  111. push si
  112. push ds
  113. mov ax, 4[bp]; ;
  114. mov di, ax
  115. mov ax, 6[bp]; ;
  116. mov es, ax
  117. mov ax, 8[bp]; ;
  118. mov si, ax
  119. mov ax, 10[bp]; ;
  120. mov ds, ax
  121. mov cx, 12[bp];
  122. .memcpy_loop:
  123. movsb
  124. cmp cx, 0x0
  125. je .end
  126. dec cx
  127. jmp .loop
  128. .memcpy_end:
  129. pop ds
  130. pop si
  131. pop es
  132. pop di
  133. pop bx
  134. pop ax
  135. pop bp
  136. ! 109 endasm
  137. !BCC_ENDASM
  138. ! 110 # 6 "main.c"
  139. ! 6 }
  140. ret
  141. ! 7 # 1 "std_
  142. ! 0 singos/stdio.h"
  143. ! 1 void print(string);
  144. !BCC_EOS
  145. ! 2
  146. ! 3 void print(string)
  147. ! 4 char* string;
  148. export _print
  149. _print:
  150. !BCC_EOS
  151. ! 5 {
  152. ! 6 #asm
  153. !BCC_ASM
  154. _print.string set 2
  155. push bp
  156. mov bp,sp
  157. mov si,4[bp]
  158. call 0x0000:0x7C47
  159. pop bp
  160. ! 12 endasm
  161. !BCC_ENDASM
  162. ! 13 }
  163. ret
  164. ! 14
  165. ! 15 void print_stack(argument)
  166. ! 16 {
  167. export _print_stack
  168. _print_stack:
  169. ! 17 #asm
  170. !BCC_ASM
  171. _print_stack.argument set 2
  172. push bp
  173. mov bp,sp
  174. push ds
  175. push ax
  176. mov ax, ss
  177. mov ds, ax
  178. mov si,4[bp]
  179. call 0x0000:0x7C47
  180. pop ax
  181. pop ds
  182. pop bp
  183. ! 31 endasm
  184. !BCC_ENDASM
  185. ! 32 }
  186. ret
  187. ! 33
  188. ! 34 dump_ax_return(input)
  189. ! 35 void* input;
  190. export _dump_ax_return
  191. _dump_ax_return:
  192. !BCC_EOS
  193. ! 36 {
  194. ! 37 return input;
  195. push bp
  196. mov bp,sp
  197. push di
  198. push si
  199. mov ax,4[bp]
  200. pop si
  201. pop di
  202. pop bp
  203. ret
  204. !BCC_EOS
  205. ! 38 }
  206. ! 39
  207. ! 40 void dump_ax(input)
  208. ! 41 void* input;
  209. export _dump_ax
  210. _dump_ax:
  211. !BCC_EOS
  212. ! 42 {
  213. ! 43
  214. ! 44 dump_ax_return(input)
  215. push bp
  216. mov bp,sp
  217. push di
  218. push si
  219. ! 45 #asm
  220. ! Debug: list * void input = [S+6+2] (used reg = )
  221. push 4[bp]
  222. ! Debug: func () int = dump_ax_return+0 (used reg = )
  223. call _dump_ax_return
  224. inc sp
  225. inc sp
  226. !BCC_EOS
  227. !BCC_ASM
  228. _dump_ax.input set 8
  229. .dump_ax.input set 4
  230. push bp
  231. mov bp,sp
  232. call 0x000:0x7C2A
  233. pop bp
  234. ! 50 endasm
  235. !BCC_ENDASM
  236. !BCC_EOS
  237. ! 51 }
  238. pop si
  239. pop di
  240. pop bp
  241. ret
  242. ! 52
  243. ! 53 void print_newline()
  244. ! 54 {
  245. export _print_newline
  246. _print_newline:
  247. ! 55 #asm
  248. !BCC_ASM
  249. printCRLF:
  250. mov ah, #0xE
  251. mov al, #13
  252. int #0x10
  253. mov al, #10
  254. int #0x10
  255. ret
  256. ! 63 endasm
  257. !BCC_ENDASM
  258. ! 64 }
  259. ret
  260. ! 65 # 1 "driver/disk.h"
  261. ! 1 int data_from_disk(index, number_sectors, data_buffer, data_buffer_segment);
  262. !BCC_EOS
  263. ! 2 int disk_service_read_data_from_disk(index, number_sectors, data_buffer, data_buffer_segment);
  264. !BCC_EOS
  265. ! 3
  266. ! 4 int disk_service_read_data_from_disk(index, number_sectors, data_buffer, data_buffer_segment)
  267. ! 5 long* index;
  268. export _disk_service_read_data_from_disk
  269. _disk_service_read_data_from_disk:
  270. !BCC_EOS
  271. ! 6 long number_sectors;
  272. !BCC_EOS
  273. ! 7 void* data_buffer;
  274. !BCC_EOS
  275. ! 8 int data_buffer_segment;
  276. !BCC_EOS
  277. ! 9 {
  278. ! 10
  279. ! 11 #asm
  280. !BCC_ASM
  281. _disk_service_read_data_from_disk.data_buffer set 8
  282. _disk_service_read_data_from_disk.number_sectors set 4
  283. _disk_service_read_data_from_disk.data_buffer_segment set $A
  284. _disk_service_read_data_from_disk.index set 2
  285. ! 13 define number_sectors 8[bp];
  286. push bp
  287. mov bp,sp
  288. pusha
  289. lsfs_load_data:
  290. mov ax, 4[bp];
  291. mov WORD [DAPACK.lba_addr_dw_low], ax
  292. mov bx, 8[bp];
  293. mov WORD [DAPACK.blkcnt], bx
  294. mov cx, 12[bp];
  295. mov WORD [DAPACK.db_addr_segment], cx
  296. mov dx, 10[bp]; ;
  297. mov WORD [DAPACK.db_addr_offset], dx
  298. mov si, #DAPACK ; address of
  299. mov ah, #0x42 ; READ
  300. mov dl, [global_disk_identifier]
  301. int #0x13
  302. ;call 0x0000:0x7C2A
  303. popa
  304. pop bp
  305. ret
  306. DAPACK:
  307. DAPACK.dap_Size: db 0x10
  308. DAPACK.rev_byte: db 0x0
  309. DAPACK.blkcnt: dw 0x0
  310. DAPACK.db_addr_offset: dw 0x0
  311. DAPACK.db_addr_segment: dw 0x0
  312. DAPACK.lba_addr_dw_low: dd 0x0
  313. DAPACK.lba_addr_dw_high: dd 0x0
  314. global_disk_identifier: db 0x80
  315. ! 51 endasm
  316. !BCC_ENDASM
  317. ! 52 }
  318. ret
  319. ! 53 # 11 "main.c"
  320. ! 11 #define SPACE_VBR_RECORD 2048
  321. ! 12
  322. ! 13 #define DEFAULT_ENTRY_SIZE 1
  323. ! 14
  324. ! 15 #def
  325. ! 15 ine NUMBER_OF_MBR_PARTITIONS 4
  326. ! 16
  327. ! 17 #define DEFAULT_DATA_POINTER_SIZE 4
  328. ! 18
  329. ! 19
  330. ! 20
  331. ! 21 void dump_ax(input);
  332. !BCC_EOS
  333. ! 22 void print_stack(argument);
  334. !BCC_EOS
  335. ! 23 void print_newline();
  336. !BCC_EOS
  337. ! 24
  338. ! 25 typedef struct Directory_Table Directory_Table;
  339. !BCC_EOS
  340. ! 26 typedef struct Struct_Table_Entry Table_Entry;
  341. !BCC_EOS
  342. ! 27 typedef struct struct_partition_control partition_control;
  343. !BCC_EOS
  344. ! 28 typedef struct File_System_Control_Information FSCI;
  345. !BCC_EOS
  346. ! 29 typedef struct meta_information_format mif;
  347. !BCC_EOS
  348. ! 30 typedef struct tag_record tag_record;
  349. !BCC_EOS
  350. ! 31 typedef struct lsfs_file lsfs_file;
  351. !BCC_EOS
  352. ! 32 typedef struct Parameter_Struct Parameter_Struct;
  353. !BCC_EOS
  354. ! 33
  355. ! 34 typedef enum Table_Entry_Kind
  356. ! 35 {
  357. ! 36
  358. ! 37 ENTRY_EMPTY = 0,
  359. ! 38 ENTRY_FILE = 1,
  360. ! 39 ENTRY_DIRECTORY = 2,
  361. ! 40 } Table_Entry_Kind;
  362. !BCC_EOS
  363. ! 41
  364. ! 42 typedef enum Service_Action
  365. ! 43 {
  366. ! 44 SERIVCE_LOAD_DISK = 1,
  367. ! 45 SERVICE_FIND_ENTRY = 2,
  368. ! 46 SERIVCE_READ_DATA = 3,
  369. ! 47 SERIVCE_WRITE_DATA = 4,
  370. ! 48
  371. ! 49 } Service_Action;
  372. !BCC_EOS
  373. ! 50
  374. ! 51 struct Struct_Table_Entry
  375. ! 52 {
  376. ! 53 char filename[256];
  377. !BCC_EOS
  378. ! 54 long file_id[2];
  379. !BCC_EOS
  380. ! 55 long file_size[2];
  381. !BCC_EOS
  382. ! 56 void* ext_file_data_low;
  383. !BCC_EOS
  384. ! 57 void* ext_file_data_high;
  385. !BCC_EOS
  386. ! 58 long number_sector_s;
  387. !BCC_EOS
  388. ! 59 short entry_kind;
  389. !BCC_EOS
  390. ! 60 short extra_control_bits1;
  391. !BCC_EOS
  392. ! 61 short extra_control_bits2;
  393. !BCC_EOS
  394. ! 62 short extra_control_bits3;
  395. !BCC_EOS
  396. ! 63 long table_entry_sector_index[2];
  397. !BCC_EOS
  398. ! 64 long data_pointer[27 * 2];
  399. !BCC_EOS
  400. ! 65 };
  401. !BCC_EOS
  402. ! 66
  403. ! 67 struct File_System_Control_Information
  404. ! 68 {
  405. ! 69 char filesystem_information[256];
  406. !BCC_EOS
  407. ! 70 long master_table_index[2];
  408. !BCC_EOS
  409. ! 71 long this_partition_offset_on_disk[2];
  410. !BCC_EOS
  411. ! 72 long next_free_sector[2];
  412. !BCC_EOS
  413. ! 73 long next_uniqe_id[2];
  414. !BCC_EOS
  415. ! 74 long next_sector_reuse_pointer[2];
  416. !BCC_EOS
  417. ! 75 long last_sector_index_on_partition[2];
  418. !BCC_EOS
  419. ! 76 long maximum_sectors_on_disk[2];
  420. !BCC_EOS
  421. ! 77 long sector_size_on_disk[2];
  422. !BCC_EOS
  423. ! 78 long not_used[48];
  424. !BCC_EOS
  425. ! 79
  426. ! 80 };
  427. !BCC_EOS
  428. ! 81
  429. ! 82 typedef struct Directory_Table
  430. ! 83 {
  431. ! 84 Table_Entry entries[16 ];
  432. !BCC_EOS
  433. ! 85
  434. ! 86 };
  435. !BCC_EOS
  436. ! 87
  437. ! 88 struct Parameter_Struct
  438. ! 89 {
  439. ! 90 char* path;
  440. !BCC_EOS
  441. ! 91 char* new_path;
  442. !BCC_EOS
  443. ! 92 int buffer_segment;
  444. !BCC_EOS
  445. ! 93 int buffer_address;
  446. !BCC_EOS
  447. ! 94 int buffer_size;
  448. !BCC_EOS
  449. ! 95 int data_length;
  450. !BCC_EOS
  451. ! 96 int byte_offset_into_file;
  452. !BCC_EOS
  453. ! 97 Table_Entry_Kind entry_kind;
  454. !BCC_EOS
  455. ! 98 };
  456. !BCC_EOS
  457. ! 99
  458. ! 100 int main(selector, pointer_parameter_segment, pointer_parameter_struct)
  459. ! 101 int selector;
  460. export _main
  461. _main:
  462. !BCC_EOS
  463. ! 102 void* pointer_parameter_segment;
  464. !BCC_EOS
  465. ! 103 void* pointer_parameter_struct
  466. ! 103 ;
  467. !BCC_EOS
  468. ! 104 {
  469. ! 105
  470. ! 106
  471. ! 107
  472. ! 108 FSCI fsci;
  473. !BCC_EOS
  474. ! 109 Service_Action service_action;
  475. !BCC_EOS
  476. ! 110 Directory_Table current_table;
  477. !BCC_EOS
  478. ! 111 Parameter_Struct parameter_struct;
  479. !BCC_EOS
  480. ! 112 int local_segment = 0x7e0;
  481. push bp
  482. mov bp,sp
  483. push di
  484. push si
  485. add sp,#-$2214
  486. ! Debug: eq int = const $7E0 to int local_segment = [S+$221A-$221A] (used reg = )
  487. mov ax,#$7E0
  488. mov -$2218[bp],ax
  489. !BCC_EOS
  490. ! 113 int stack_segment = 0x8fc0;
  491. dec sp
  492. dec sp
  493. ! Debug: eq unsigned int = const $8FC0 to int stack_segment = [S+$221C-$221C] (used reg = )
  494. mov ax,#$8FC0
  495. mov -$221A[bp],ax
  496. !BCC_EOS
  497. ! 114 long index_as_long;
  498. !BCC_EOS
  499. ! 115
  500. ! 116 char local_path[256];
  501. !BCC_EOS
  502. ! 117 service_action = selector;
  503. add sp,#-$104
  504. ! Debug: eq int selector = [S+$2320+2] to int service_action = [S+$2320-$208] (used reg = )
  505. mov ax,4[bp]
  506. mov -$206[bp],ax
  507. !BCC_EOS
  508. ! 118
  509. ! 119 switch (service_action)
  510. mov ax,-$206[bp]
  511. ! 120 {
  512. br .3
  513. ! 121 case SERIVCE_LOAD_DISK:
  514. ! 122 {
  515. .4:
  516. ! 123
  517. ! 124
  518. ! 125
  519. ! 126
  520. ! 127 index_as_long = pointer_parameter_struct;
  521. ! Debug: eq * void pointer_parameter_struct = [S+$2320+6] to long index_as_long = [S+$2320-$2220] (used reg = )
  522. mov ax,8[bp]
  523. xor bx,bx
  524. mov -$221E[bp],ax
  525. mov -$221C[bp],bx
  526. !BCC_EOS
  527. ! 128 disk_service_read_data_from_disk(index_as_long, 1, &fsci, stack_segment);
  528. ! Debug: list int stack_segment = [S+$2320-$221C] (used reg = )
  529. push -$221A[bp]
  530. ! Debug: list * struct File_System_Control_Information fsci = S+$2322-$206 (used reg = )
  531. lea bx,-$204[bp]
  532. push bx
  533. ! Debug: list int = const 1 (used reg = )
  534. mov ax,*1
  535. push ax
  536. ! Debug: list long index_as_long = [S+$2326-$2220] (used reg = )
  537. push -$221C[bp]
  538. push -$221E[bp]
  539. ! Debug: func () int = disk_service_read_data_from_disk+0 (used reg = )
  540. call _disk_service_read_data_from_disk
  541. add sp,*$A
  542. !BCC_EOS
  543. ! 129 print("File System has been loaded: ");
  544. ! Debug: list * char = .5+0 (used reg = )
  545. mov bx,#.5
  546. push bx
  547. ! Debug: func () void = print+0 (used reg = )
  548. call _print
  549. inc sp
  550. inc sp
  551. !BCC_EOS
  552. ! 130 print_newline();
  553. ! Debug: func () void = print_newline+0 (used reg = )
  554. call _print_newline
  555. !BCC_EOS
  556. ! 131 print_stack(fsci.filesystem_information);
  557. ! Debug: list * char fsci = S+$2320-$206 (used reg = )
  558. lea bx,-$204[bp]
  559. push bx
  560. ! Debug: func () void = print_stack+0 (used reg = )
  561. call _print_stack
  562. inc sp
  563. inc sp
  564. !BCC_EOS
  565. ! 132 print_newline();
  566. ! Debug: func () void = print_newline+0 (used reg = )
  567. call _print_newline
  568. !BCC_EOS
  569. ! 133 } break;
  570. br .1
  571. !BCC_EOS
  572. ! 134 case SERVICE_FIND_ENTRY:
  573. ! 135 {
  574. .6:
  575. ! 136 memcpy(&parameter_struct, stack_segment, pointer_parameter_struct, pointer_parameter_segment, sizeof(Parameter_Struct));
  576. ! Debug: list int = const $10 (used reg = )
  577. mov ax,*$10
  578. push ax
  579. ! Debug: list * void pointer_parameter_segment = [S+$2322+4] (used reg = )
  580. push 6[bp]
  581. ! Debug: list * void pointer_parameter_struct = [S+$2324+6] (used reg = )
  582. push 8[bp]
  583. ! Debug: list int stack_segment = [S+$2326-$221C] (used reg = )
  584. push -$221A[bp]
  585. ! Debug: list * struct Parameter_Struct parameter_struct = S+$2328-$2218 (used reg = )
  586. lea bx,-$2216[bp]
  587. push bx
  588. ! Debug: func () void = memcpy+0 (used reg = )
  589. call _memcpy
  590. add sp,*$A
  591. !BCC_EOS
  592. ! 137 dump_ax(parameter_struct.buffer_size);
  593. ! Debug: list int parameter_struct = [S+$2320-$2210] (used reg = )
  594. push -$220E[bp]
  595. ! Debug: func () void = dump_ax+0 (used reg = )
  596. call _dump_ax
  597. inc sp
  598. inc sp
  599. !BCC_EOS
  600. ! 138 print_newline();
  601. ! Debug: func () void = print_newline+0 (used reg = )
  602. call _print_newline
  603. !BCC_EOS
  604. ! 139 disk_service_read_data_from_disk(fsci.master_table_index[0], 16 , &current_table, stack_segment);
  605. ! Debug: list int stack_segment = [S+$2320-$221C] (used reg = )
  606. push -$221A[bp]
  607. ! Debug: list * struct Directory_Table current_table = S+$2322-$2208 (used reg = )
  608. lea bx,-$2206[bp]
  609. push bx
  610. ! Debug: list int = const $10 (used reg = )
  611. mov ax,*$10
  612. push ax
  613. ! Debug: list long fsci = [S+$2326-$106] (used reg = )
  614. push -$102[bp]
  615. push -$104[bp]
  616. ! Debug: func () int = disk_service_read_data_from_disk+0 (used reg = )
  617. call _disk_service_read_data_from_disk
  618. add sp,*$A
  619. !BCC_EOS
  620. ! 140 print("Current table: ");
  621. ! Debug: list * char = .7+0 (used reg = )
  622. mov bx,#.7
  623. push bx
  624. ! Debug: func () void = print+0 (used reg = )
  625. call _print
  626. inc sp
  627. inc sp
  628. !BCC_EOS
  629. ! 141 print_newline();
  630. ! Debug: func () void = print_newline+0 (used reg = )
  631. call _print_newline
  632. !BCC_EOS
  633. ! 142 print_stack(current_table.entries[0].filename);
  634. ! Debug: list * char current_table = S+$2320-$2208 (used reg = )
  635. lea bx,-$2206[bp]
  636. push bx
  637. ! Debug: func () void = print_stack+0 (used reg = )
  638. call _print_stack
  639. inc sp
  640. inc sp
  641. !BCC_EOS
  642. ! 143 print_newline();
  643. ! Debug: func () void = print_newline+0 (used reg = )
  644. call _print_newline
  645. !BCC_EOS
  646. ! 144 print_stack(current_table.entries[1].filename);
  647. ! Debug: list * char current_table = S+$2320-$2008 (used reg = )
  648. lea bx,-$2006[bp]
  649. push bx
  650. ! Debug: func () void = print_stack+0 (used reg = )
  651. call _print_stack
  652. inc sp
  653. inc sp
  654. !BCC_EOS
  655. ! 145 print_newline();
  656. ! Debug: func () void = print_newline+0 (used reg = )
  657. call _print_newline
  658. !BCC_EOS
  659. ! 146 print_stack(current_table.entries[2].filename);
  660. ! Debug: list * char current_table = S+$2320-$1E08 (used reg = )
  661. lea bx,-$1E06[bp]
  662. push bx
  663. ! Debug: func () void = print_stack+0 (used reg = )
  664. call _print_stack
  665. inc sp
  666. inc sp
  667. !BCC_EOS
  668. ! 147 print_newline();
  669. ! Debug: func () void = print_newline+0 (used reg = )
  670. call _print_newline
  671. !BCC_EOS
  672. ! 148 } break;
  673. jmp .1
  674. !BCC_EOS
  675. ! 149 case SERIVCE_READ_DATA:
  676. ! 150 {
  677. .8:
  678. ! 151 # 159
  679. ! 159
  680. ! 160 print("Hit READ case");
  681. ! Debug: list * char = .9+0 (used reg = )
  682. mov bx,#.9
  683. push bx
  684. ! Debug: func () void = print+0 (used reg = )
  685. call _print
  686. inc sp
  687. inc sp
  688. !BCC_EOS
  689. ! 161 } break;
  690. jmp .1
  691. !BCC_EOS
  692. ! 162 case SERIVCE_WRITE_DATA:
  693. ! 163 {
  694. .A:
  695. ! 164 print("Hit WRITE case");
  696. ! Debug: list * char = .B+0 (used reg = )
  697. mov bx,#.B
  698. push bx
  699. ! Debug: func () void = print+0 (used reg = )
  700. call _print
  701. inc sp
  702. inc sp
  703. !BCC_EOS
  704. ! 165 } break;
  705. jmp .1
  706. !BCC_EOS
  707. ! 166 default:
  708. ! 167 {
  709. .C:
  710. ! 168 print("Default case");
  711. ! Debug: list * char = .D+0 (used reg = )
  712. mov bx,#.D
  713. push bx
  714. ! Debug: func () void = print+0 (used reg = )
  715. call _print
  716. inc sp
  717. inc sp
  718. !BCC_EOS
  719. ! 169 }
  720. ! 170 }
  721. ! 171
  722. ! 172 return 0;
  723. jmp .1
  724. .3:
  725. sub ax,*1
  726. beq .4
  727. sub ax,*1
  728. beq .6
  729. sub ax,*1
  730. je .8
  731. sub ax,*1
  732. je .A
  733. jmp .C
  734. .1:
  735. ..FFFF = -$2320
  736. xor ax,ax
  737. lea sp,-4[bp]
  738. pop si
  739. pop di
  740. pop bp
  741. ret
  742. !BCC_EOS
  743. ! 173
  744. ! 174 }
  745. ! 175
  746. ! Register BX used in function main
  747. .D:
  748. .E:
  749. .ascii "Default case"
  750. .byte 0
  751. .B:
  752. .F:
  753. .ascii "Hit WRITE case"
  754. .byte 0
  755. .9:
  756. .10:
  757. .ascii "Hit READ case"
  758. .byte 0
  759. .7:
  760. .11:
  761. .ascii "Current table: "
  762. .byte 0
  763. .5:
  764. .12:
  765. .ascii "File System has been loaded: "
  766. .byte 0
  767. .bss
  768. ! 0 errors detected