develop/libraries/utils: Post-SVN tidy

- Move source code from `trunk` into root directory.
- Update ASM include paths.
- Note: Line endings standardised from `CRLF` > `LF`, so best to view diffs with whitespace changes hidden.
This commit is contained in:
2025-05-25 15:06:16 +01:00
parent 728248f8d0
commit 9ab8d4e49a
7 changed files with 66 additions and 64 deletions

View File

@@ -1,64 +1,66 @@
;-----------------------------------------------------------------------------+ ; SPDX-License-Identifier: NOASSERTION
; Library "utils" (c) Sergei Steshin (Akyltist) | ;
;-----------------------------------------------------------------------------+
; Charset:DOS-866 Font:Courier New Size:9pt | ;-----------------------------------------------------------------------------+
; compiler: FASM 1.69.31 | ; Library "utils" (c) Sergei Steshin (Akyltist) |
; version: 0.1.0 | ;-----------------------------------------------------------------------------+
; last update: 31/03/2014 | ; Charset:DOS-866 Font:Courier New Size:9pt |
; e-mail: dr.steshin@gmail.com | ; compiler: FASM 1.69.31 |
; license: BSD | ; version: 0.1.0 |
;-----------------------------------------------------------------------------+ ; last update: 31/03/2014 |
; e-mail: dr.steshin@gmail.com |
format MS COFF ; license: BSD |
;-----------------------------------------------------------------------------+
public EXPORTS
format MS COFF
section '.flat' code readable writable align 16
public EXPORTS
include '../../../../proc32.inc'
include '_ftoa.inc' section '.flat' code readable writable align 16
include '_atof.inc'
include '_rand.inc' include '../../../proc32.inc'
include '_ftoa.inc'
include '_atof.inc'
;-----------------------------------------------------------------------------+ include '_rand.inc'
; float to ascii string |
;-----------------------------------------------------------------------------+
ftoa: ; ;-----------------------------------------------------------------------------+
mov ebx, dword [esp+4] ; out string ; float to ascii string |
mov eax, dword [esp+8] ; in value ;-----------------------------------------------------------------------------+
stdcall FloatToString,eax,ebx ; ftoa: ;
ret 8 ; mov ebx, dword [esp+4] ; out string
mov eax, dword [esp+8] ; in value
stdcall FloatToString,eax,ebx ;
;-----------------------------------------------------------------------------+ ret 8 ;
; ascii string to float |
;-----------------------------------------------------------------------------+
atof: ; ;-----------------------------------------------------------------------------+
mov ebx, dword [esp+4] ; out <- value ; ascii string to float |
mov eax, dword [esp+8] ; in -> string ;-----------------------------------------------------------------------------+
stdcall string2float,eax,ebx ; atof: ;
ret 8 ; mov ebx, dword [esp+4] ; out <- value
mov eax, dword [esp+8] ; in -> string
stdcall string2float,eax,ebx ;
;-----------------------------------------------------------------------------+ ret 8 ;
; returns a random integer in the range [ 0...99999 ] |
;-----------------------------------------------------------------------------+
random: ; ;-----------------------------------------------------------------------------+
call _random ; out <- eax random ; returns a random integer in the range [ 0...99999 ] |
ret ; ;-----------------------------------------------------------------------------+
random: ;
;=============================================================================; call _random ; out <- eax random
align 16 ret ;
EXPORTS:
dd szFtoa , ftoa ;=============================================================================;
dd szAtof , atof align 16
dd szRandom , random EXPORTS:
dd 0 , 0 dd szFtoa , ftoa
dd szAtof , atof
szFtoa db 'ftoa' ,0 dd szRandom , random
szAtof db 'atof' ,0 dd 0 , 0
szRandom db 'random' ,0
szFtoa db 'ftoa' ,0
section '.data' data readable writable align 16 szAtof db 'atof' ,0
szRandom db 'random' ,0
section '.data' data readable writable align 16