Skip to content

Commit

Permalink
2.36.03
Browse files Browse the repository at this point in the history
  • Loading branch information
nidud committed Nov 3, 2024
1 parent 7dda9a1 commit f589c02
Show file tree
Hide file tree
Showing 17 changed files with 5,452 additions and 816 deletions.
Binary file modified bin/asmc.exe
Binary file not shown.
Binary file modified bin/asmc64.exe
Binary file not shown.
67 changes: 66 additions & 1 deletion source/asmc/inc/qfloat.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,73 @@
;
ifndef __QFLOAT_INC
define __QFLOAT_INC
include fltintrn.inc

include expreval.inc

define _ST_SIGN 0x000001
define _ST_NEGNUM 0x000002
define _ST_NEGEXP 0x000004
define _ST_ISZERO 0x000008
define _ST_ISHEX 0x000010
define _ST_ISNAN 0x000020
define _ST_ISINF 0x000040
define _ST_INVALID 0x000080
define _ST_UNDERFLOW 0x000100
define _ST_OVERFLOW 0x000200
define _ST_DIGITS 0x000400
define _ST_DOT 0x000800
define _ST_E 0x001000 ; 'E' format
define _ST_F 0x002000 ; 'F' format
define _ST_G 0x004000 ; 'G' format
define _ST_CVT 0x008000 ; cvt routine format rules
define _ST_CAPEXP 0x010000 ; 1.0E-10
define _ST_NO_TRUNC 0x020000 ; always provide ndigits in buffer
define _ST_FLOAT 0x040000 ; REAL4
define _ST_DOUBLE 0x080000 ; REAL8
define _ST_LONGDOUBLE 0x100000 ; REAL10
define _ST_QUADFLOAT 0x200000 ; REAL16
define _ST_ALTERNATE 0x400000 ; alternate form requested
define _ST_UNICODE 0x800000

.template FLTINFO
ndigits int_t ?
scale int_t ?
flags int_t ?
expchar int_t ?
expwidth int_t ?
sign int_t ?
dec_place int_t ?
n1 int_t ?
nz1 int_t ?
n2 int_t ?
nz2 int_t ?
bufsize int_t ?
.ends

; 128-bit unsigned integer functions

__mulo proto __ccall :ptr uint128_t, :ptr uint128_t, :ptr uint128_t
__divo proto __ccall :ptr uint128_t, :ptr uint128_t, :ptr uint128_t
__shlo proto __ccall :ptr uint128_t, :int_t, :int_t
__shro proto __ccall :ptr uint128_t, :int_t, :int_t
__saro proto __ccall :ptr uint128_t, :int_t, :int_t

; Convert float, double, long double

__cvtq_ss proto __ccall :ptr float_t, :ptr qfloat_t
__cvtq_sd proto __ccall :ptr double_t, :ptr qfloat_t
__cvtq_ld proto __ccall :ptr ldouble_t, :ptr qfloat_t

; */+-

__mulq proto __ccall A:ptr qfloat_t, B:ptr qfloat_t
__divq proto __ccall A:ptr qfloat_t, B:ptr qfloat_t
__addq proto __ccall A:ptr qfloat_t, B:ptr qfloat_t
__subq proto __ccall A:ptr qfloat_t, B:ptr qfloat_t
__cmpq proto __ccall A:ptr qfloat_t, B:ptr qfloat_t

__sqrtq proto __ccall A:ptr qfloat_t

ifdef _WIN64
__mul64 proto watcall multiplier:int64_t, multiplicand:int64_t {
mul rdx
Expand All @@ -21,6 +85,7 @@ __rem64 proto watcall :int64_t, :int64_t
quad_resize proto __ccall :ptr expr, :int_t
_atoqw proto fastcall :string_t
_atoow proto __ccall :string_t, :string_t, :int_t, :int_t
_flttostr proto __ccall :ptr, :ptr FLTINFO, :string_t, :uint_t
atofloat proto __ccall :ptr, :string_t, :uint_t, :int_t, :uchar_t
CreateFloat proto __ccall :int_t, :expr_t, :string_t

Expand Down
2 changes: 1 addition & 1 deletion source/asmc/inc/version.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ define ASMC_VERSION 236

define ASMC_MAJOR_VER 2
define ASMC_MINOR_VER 36
define ASMC_SUBMINOR_VER 2
define ASMC_SUBMINOR_VER 3

endif
13 changes: 7 additions & 6 deletions source/asmc/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
ifdef YACC

acc = asmc236
acc = asmcg
pic-default = yes
ifeq (yes,$(pic-default))
lpic = -Wl,-pie,-z,now,-z,noexecstack
Expand All @@ -16,7 +16,7 @@ flags = $(apic) -Zp8 -Cs -Iinc -I../../include
ifeq (asmc,$(acc))
flags += -elf64
endif
all: asmc236 asmc asmc64 clean
all: asmcg asmc asmc64 clean

else

Expand Down Expand Up @@ -47,22 +47,23 @@ file { *.obj }
del *.obj
endif

asmc236:
asmcg:
gcc -c src/gas/*.s && gcc -Wl,-pie -s -o $@ *.o
rm *.o

asmc:
$(CC) -c $(flags) ../libc/fltintrn/*.asm src/*.asm
$(CC) -c $(flags) src/*.asm
gcc $(lpic) -s -o $@ *.o

asmc64:
$(CC) -c -DASMC64 $(flags) ../libc/fltintrn/*.asm src/*.asm
$(CC) -c -DASMC64 $(flags) src/*.asm
gcc $(lpic) -s -o $@ *.o
# $(CC) -c -DASMC64 $(flags) src/*.asm
# gcc -static -nostdlib -Wl,-no-pie -s -o $@ *.o -l:libasmc.a

clean:
rm *.o
rm ./asmc236
rm ./asmcg

install:
sudo install ./asmc /usr/bin
Expand Down
2 changes: 1 addition & 1 deletion source/asmc/src/assemble.asm
Original file line number Diff line number Diff line change
Expand Up @@ -900,7 +900,7 @@ OnePass proc __ccall private uses rsi rdi
.while ( rsi && !ModuleInfo.EndDirFound )

if ( USELSLINE eq 0 )
strcpy( CurrSource, &[rsi].line_item.line )
tstrcpy( CurrSource, &[rsi].line_item.line )
endif
set_curr_srcfile([rsi].line_item.srcfile, [rsi].line_item.lineno)
mov ModuleInfo.line_flags,0
Expand Down
18 changes: 0 additions & 18 deletions source/asmc/src/gas/addo.s

This file was deleted.

28 changes: 0 additions & 28 deletions source/asmc/src/gas/cvti32_q.s

This file was deleted.

28 changes: 0 additions & 28 deletions source/asmc/src/gas/cvti64_q.s

This file was deleted.

26 changes: 0 additions & 26 deletions source/asmc/src/gas/cvtq_i32.s

This file was deleted.

26 changes: 0 additions & 26 deletions source/asmc/src/gas/cvtq_i64.s

This file was deleted.

48 changes: 0 additions & 48 deletions source/asmc/src/gas/flttoi.s

This file was deleted.

4 changes: 2 additions & 2 deletions source/asmc/src/gas/hll.s
Original file line number Diff line number Diff line change
Expand Up @@ -2633,12 +2633,12 @@ $$357: cmp al, 3
mov rsi, rax
xor ecx, ecx
$$358: cmp byte ptr [rsi+rcx], 0
jz $_358
jz $$361
inc ecx
jmp $$358
$$360: mov rsi, qword ptr [rax+0x8]
mov ecx, dword ptr [rax+0x10]
add rbx, 24
$$361: add rbx, 24
add dword ptr [rbp-0xA24], 3
jmp $_358

Expand Down
33 changes: 0 additions & 33 deletions source/asmc/src/gas/itoflt.s

This file was deleted.

18 changes: 0 additions & 18 deletions source/asmc/src/gas/subo.s

This file was deleted.

Loading

0 comments on commit f589c02

Please sign in to comment.