1 ; **************************************************************************** 2 ; emt.s - TRDOS 386 (TRDOS v2.0) Kernel - Enable Musti Tasking (CTRL+BRK) Test 3 ; ---------------------------------------------------------------------------- 4 ; 5 ; 21/08/2024 6 ; 7 ; [ Last Modification: 21/08/2024 ] 8 ; 9 ; **************************************************************************** 10 11 ; 20/08/2024 ; TRDOS 386 v2.0.9 (exit code) 12 ; 20/08/2017 13 ; 01/03/2017 14 ; 16/10/2016 15 ; 29/04/2016 16 ; TRDOS 386 system calls (temporary list!) 17 _ver equ 0 18 _exit equ 1 19 _fork equ 2 20 _read equ 3 21 _write equ 4 22 _open equ 5 23 _close equ 6 24 _wait equ 7 25 _creat equ 8 26 _link equ 9 27 _unlink equ 10 28 _exec equ 11 29 _chdir equ 12 30 _time equ 13 31 _mkdir equ 14 32 _chmod equ 15 33 _chown equ 16 34 _break equ 17 35 _stat equ 18 36 _seek equ 19 37 _tell equ 20 38 _mount equ 21 39 _umount equ 22 40 _setuid equ 23 41 _getuid equ 24 42 _stime equ 25 43 _quit equ 26 44 _intr equ 27 45 _fstat equ 28 46 _emt equ 29 47 _mdate equ 30 48 _video equ 31 49 _audio equ 32 50 _timer equ 33 51 _sleep equ 34 52 _msg equ 35 53 _geterr equ 36 54 _fpsave equ 37 55 _pri equ 38 56 _rele equ 39 57 _fff equ 40 58 _fnf equ 41 59 _alloc equ 42 60 _dalloc equ 43 61 _calbac equ 44 62 _dma equ 45 63 _stdio equ 46 ; TRDOS 386 v2.0.9 64 65 %macro sys 1-4 66 ; 29/04/2016 - TRDOS 386 (TRDOS v2.0) 67 ; 03/09/2015 68 ; 13/04/2015 69 ; Retro UNIX 386 v1 system call. 70 %if %0 >= 2 71 mov ebx, %2 72 %if %0 >= 3 73 mov ecx, %3 74 %if %0 = 4 75 mov edx, %4 76 %endif 77 %endif 78 %endif 79 mov eax, %1 80 ;int 30h 81 int 40h ; TRDOS 386 (TRDOS v2.0) 82 %endmacro 83 84 ; TRDOS 386 (and Retro UNIX 386 v1) system call format: 85 ; sys systemcall (eax) , , 86 87 ;======================================================================== 88 ; EXEC TEST - CODE 89 ;======================================================================== 90 91 [BITS 32] ; 32-bit intructions 92 93 [ORG 0] 94 95 START_CODE: 96 sys _emt, 1 66 <1> 67 <1> 68 <1> 69 <1> 70 <1> %if %0 >= 2 71 00000000 BB01000000 <1> mov ebx, %2 72 <1> %if %0 >= 3 73 <1> mov ecx, %3 74 <1> %if %0 = 4 75 <1> mov edx, %4 76 <1> %endif 77 <1> %endif 78 <1> %endif 79 00000005 B81D000000 <1> mov eax, %1 80 <1> 81 0000000A CD40 <1> int 40h 97 98 sys _msg, enabled, 255, 0Bh 66 <1> 67 <1> 68 <1> 69 <1> 70 <1> %if %0 >= 2 71 0000000C BB[30000000] <1> mov ebx, %2 72 <1> %if %0 >= 3 73 00000011 B9FF000000 <1> mov ecx, %3 74 <1> %if %0 = 4 75 00000016 BA0B000000 <1> mov edx, %4 76 <1> %endif 77 <1> %endif 78 <1> %endif 79 0000001B B823000000 <1> mov eax, %1 80 <1> 81 00000020 CD40 <1> int 40h 99 here: 100 sys _exit, 0 66 <1> 67 <1> 68 <1> 69 <1> 70 <1> %if %0 >= 2 71 00000022 BB00000000 <1> mov ebx, %2 72 <1> %if %0 >= 3 73 <1> mov ecx, %3 74 <1> %if %0 = 4 75 <1> mov edx, %4 76 <1> %endif 77 <1> %endif 78 <1> %endif 79 00000027 B801000000 <1> mov eax, %1 80 <1> 81 0000002C CD40 <1> int 40h 101 0000002E EBF2 jmp short here 102 103 ;----------------------------------------------------------------- 104 ; messages 105 ;----------------------------------------------------------------- 106 107 enabled: 108 00000030 0D0A db 0Dh, 0Ah 109 00000032 4D756C746920546173- db "Multi Tasking Enabled !" 109 0000003B 6B696E6720456E6162- 109 00000044 6C65642021 110 00000049 0D0A db 0Dh, 0Ah 111 0000004B 00 db 0