1 ; **************************************************************************** 2 ; fptest1.s (TRDOS 386, TRDOS v2.0 - sample binary file, 'fptest1.prg') 3 ; ---------------------------------------------------------------------------- 4 ; FPTEST1.PRG ! TEST program ! TRDOS 386 Floating Point test ! 5 ; 6 ; 07/09/2016 7 ; 8 ; [ Last Modification: 07/09/2016 ] 9 ; 10 ; **************************************************************************** 11 12 ; 19/05/2016 13 ; 29/04/2016 14 ; TRDOS 386 system calls (temporary list!) 15 _ver equ 0 16 _exit equ 1 17 _fork equ 2 18 _read equ 3 19 _write equ 4 20 _open equ 5 21 _close equ 6 22 _wait equ 7 23 _creat equ 8 24 _link equ 9 25 _unlink equ 10 26 _exec equ 11 27 _chdir equ 12 28 _time equ 13 29 _mkdir equ 14 30 _chmod equ 15 31 _chown equ 16 32 _break equ 17 33 _stat equ 18 34 _seek equ 19 35 _tell equ 20 36 _mount equ 21 37 _umount equ 22 38 _setuid equ 23 39 _getuid equ 24 40 _stime equ 25 41 _quit equ 26 42 _intr equ 27 43 _fstat equ 28 44 _emt equ 29 45 _mdate equ 30 46 _video equ 31 47 _audio equ 32 48 _timer equ 33 49 _sleep equ 34 50 _msg equ 35 51 _geterr equ 36 52 _rsrvd1 equ 37 53 _pri equ 38 54 _rele equ 39 55 56 %macro sys 1-4 57 ; 29/04/2016 - TRDOS 386 (TRDOS v2.0) 58 ; 03/09/2015 59 ; 13/04/2015 60 ; Retro UNIX 386 v1 system call. 61 %if %0 >= 2 62 mov ebx, %2 63 %if %0 >= 3 64 mov ecx, %3 65 %if %0 = 4 66 mov edx, %4 67 %endif 68 %endif 69 %endif 70 mov eax, %1 71 ;int 30h 72 int 40h ; TRDOS 386 (TRDOS v2.0) 73 %endmacro 74 75 ; TRDOS 386 (and Retro UNIX 386 v1) system call format: 76 ; sys systemcall (eax) , , 77 78 79 [BITS 32] ; 80386 Protected Mode (32 bit) intructions 80 81 [ORG 0] ; (Start at Virtual Address 0) 82 83 start: 84 00000000 D905[50000000] fld dword [f1] 85 00000006 D905[54000000] fld dword [f2] 86 0000000C DFF1 fcomip 87 0000000E DDD8 fstp st0 88 00000010 760A jna short terminate 89 90 00000012 BE[34000000] mov esi, msg 91 00000017 E809000000 call print_msg 92 93 terminate: 94 sys _exit ; INT 40h 94 <1> 94 <1> 94 <1> 94 <1> 94 <1> %if %0 >= 2 94 <1> mov ebx, %2 94 <1> %if %0 >= 3 94 <1> mov ecx, %3 94 <1> %if %0 = 4 94 <1> mov edx, %4 94 <1> %endif 94 <1> %endif 94 <1> %endif 94 0000001C B801000000 <1> mov eax, %1 94 <1> 94 00000021 CD40 <1> int 40h 95 here: 96 00000023 EBFE jmp short here 97 98 print_msg: 99 00000025 66BB0700 mov bx, 7 100 00000029 B40E mov ah, 0Eh 101 pmsg_loop: 102 0000002B AC lodsb 103 0000002C 20C0 and al, al 104 0000002E 74EC jz short terminate 105 00000030 CD31 int 31h ; TRDOS 386 video interrupt 106 00000032 EBF7 jmp short pmsg_loop 107 108 msg: 109 00000034 0D0A07 db 0Dh, 0Ah, 07h 110 00000037 663220283D31302E30- db "f2 (=10.0) > f1 (=9.0)" 110 00000040 29203E20663120283D- 110 00000049 392E3029 111 0000004D 0D0A00 db 0Dh, 0Ah, 0 112 f1: 113 00000050 00001041 dd 9.0 114 f2: 115 00000054 00002041 dd 10.0 116 _end: