Skip to content

Commit

Permalink
2.36.11
Browse files Browse the repository at this point in the history
  • Loading branch information
nidud committed Dec 15, 2024
1 parent a4e47b5 commit ff936cc
Show file tree
Hide file tree
Showing 23 changed files with 72 additions and 73 deletions.
Binary file modified bin/asmc.exe
Binary file not shown.
Binary file modified bin/asmc64.exe
Binary file not shown.
2 changes: 2 additions & 0 deletions source/asmc/inc/condasm.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
;
; prototypes for conditional assembly and errors
;
.pragma list(push, 0)
ifndef __CONDASM_INC
define __CONDASM_INC

Expand Down Expand Up @@ -33,4 +34,5 @@ CondCheckOpen proto __ccall
CondInit proto __ccall

endif
.pragma list(pop)

2 changes: 2 additions & 0 deletions source/asmc/inc/directve.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
; Copyright (c) The Asmc Contributors. All rights reserved.
; Consult your license regarding permissions and restrictions.
;
.pragma list(push, 0)

ifndef ASMC64

Expand Down Expand Up @@ -307,3 +308,4 @@ res(OPTION, option, 0, DRT_OPTION, 0, P_86, 0)
res(POPCONTEXT, popcontext, 0, DRT_CONTEXT, 0, P_86, 0)
res(PUSHCONTEXT, pushcontext, 0, DRT_CONTEXT, 0, P_86, 0)

.pragma list(pop)
2 changes: 2 additions & 0 deletions source/asmc/inc/expreval.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
;
; interface to expression evaluator
;
.pragma list(push, 0)
ifndef __EXPREVAL_INC
define __EXPREVAL_INC

Expand Down Expand Up @@ -125,3 +126,4 @@ ExprEvalInit proto
EmitConstError proto
endif
.pragma list(pop)
2 changes: 2 additions & 0 deletions source/asmc/inc/fastpass.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
; Copyright (c) The Asmc Contributors. All rights reserved.
; Consult your license regarding permissions and restrictions.
;
.pragma list(push, 0)
ifndef __FASTPASS_INC
define __FASTPASS_INC

Expand Down Expand Up @@ -75,3 +76,4 @@ FStoreLine proto fastcall flags:abs {
}

endif
.pragma list(pop)
2 changes: 2 additions & 0 deletions source/asmc/inc/fixup.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
;
; fixup related variables and routines
;
.pragma list(push, 0)
ifndef __FIXUP_inc
define __FIXUP_inc

Expand Down Expand Up @@ -96,3 +97,4 @@ store_fixup proto __ccall :ptr fixup, :ptr dsym, :ptr int_t
BackPatch proto fastcall :ptr asym

endif
.pragma list(pop)
2 changes: 2 additions & 0 deletions source/asmc/inc/input.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
; Copyright (c) The Asmc Contributors. All rights reserved.
; Consult your license regarding permissions and restrictions.
;
.pragma list(push, 0)
ifndef __INPUT_INC
define __INPUT_INC

Expand Down Expand Up @@ -69,3 +70,4 @@ GetAlignedPointer proto watcall p:ptr, size:int_t {
}

endif
.pragma list(pop)
3 changes: 2 additions & 1 deletion source/asmc/inc/instruct.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
;
; Description: table of instructions. Other reserved words see special.h
;
.pragma list(push, 0)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; The order of items for an opcode (ins + insn) is IMPORTANT!
Expand Down Expand Up @@ -2177,4 +2178,4 @@ avxins(PDPBUSDS, VPDPBUSDS, vpdpbusds, RWF_EVEX, VX_RW0 )
avxins(PDPWSSD, VPDPWSSD, vpdpwssd, RWF_EVEX, VX_RW0 )
avxins(PDPWSSDS, VPDPWSSDS, vpdpwssds, RWF_EVEX, VX_RW0 )


.pragma list(pop)
2 changes: 2 additions & 0 deletions source/asmc/inc/listing.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
;
; listing interface.
;
.pragma list(push, 0)
ifndef __LISTING_INC
define __LISTING_INC

Expand All @@ -29,3 +30,4 @@ LstNL proto __ccall
LstWrite proto __ccall :int_t, :uint_t, :ptr

endif
.pragma list(pop)
2 changes: 2 additions & 0 deletions source/asmc/inc/macro.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
;
; prototypes for macro stuff
;
.pragma list(push, 0)
ifndef __MACRO_INC
define __MACRO_INC

Expand Down Expand Up @@ -42,3 +43,4 @@ StringInit proto __ccall
MacroLineQueue proto __ccall

endif
.pragma list(pop)
2 changes: 2 additions & 0 deletions source/asmc/inc/operands.inc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
; parser/code generator operand definitions.
; This file is included by parser.inc
;
.pragma list(push, 0)
ifndef OPERANDS_H
define OPERANDS_H

Expand Down Expand Up @@ -103,3 +104,4 @@ OP3_R_MS equ OP3_XMM0
OP3_XMM_M128 equ OP3_XMM0

endif
.pragma list(pop)
2 changes: 2 additions & 0 deletions source/asmc/inc/parser.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
;
; Parser items
;
.pragma list(push, 0)
ifndef __PARSER_INC
define __PARSER_INC

Expand Down Expand Up @@ -429,3 +430,4 @@ WritePreprocessedLine proto __ccall :string_t
parsevex proto fastcall :string_t, :ptr uchar_t

endif
.pragma list(pop)
2 changes: 2 additions & 0 deletions source/asmc/inc/reswords.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
;
; interface to instruction hash table.
;
.pragma list(push, 0)
ifndef __RESWORDS_INC
define __RESWORDS_INC

Expand Down Expand Up @@ -44,3 +45,4 @@ ResWordsInit proto __ccall
ResWordsFini proto __ccall

endif
.pragma list(pop)
4 changes: 4 additions & 0 deletions source/asmc/inc/special.inc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.pragma list(push, 0)
;
;
; Description: table of non-instruction reserved words:
Expand Down Expand Up @@ -370,3 +371,6 @@ res(FASTCALL, fastcall, RWT_RES_ID, 0, LANG_FASTCALL, 0, P_86, 0)
res(VECTORCALL, vectorcall, RWT_RES_ID, 0, LANG_VECTORCALL, 0, P_86, 0)
res(WATCALL, watcall, RWT_RES_ID, 0, LANG_WATCALL, 0, P_86, 0)
res(ASMCALL, asmcall, RWT_RES_ID, 0, LANG_ASMCALL, 0, P_86, 0)

.pragma list(pop)

2 changes: 2 additions & 0 deletions source/asmc/inc/types.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
; Copyright (c) The Asmc Contributors. All rights reserved.
; Consult your license regarding permissions and restrictions.
;
.pragma list(push, 0)
ifndef __TYPES_INC
define __TYPES_INC

Expand Down Expand Up @@ -36,3 +37,4 @@ DeleteType macro t
endm

endif
.pragma list(pop)
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 10
define ASMC_SUBMINOR_VER 11

endif
26 changes: 7 additions & 19 deletions source/asmc/src/assume.asm
Original file line number Diff line number Diff line change
Expand Up @@ -223,35 +223,25 @@ ModelAssumeInit proc
; Generates codes for assume

mov al,ModuleInfo._model
and eax,7

.switch jmp rax

.case MODEL_FLAT
.if ( al == MODEL_FLAT )

lea rdx,szError
mov rcx,rdx
.if ( ModuleInfo.fctype == FCT_WIN64 || ModuleInfo.fctype == FCT_VEC64 )
lea rcx,szNothing
.endif
AddLineQueueX( "assume cs:flat,ds:flat,ss:flat,es:flat,fs:%s,gs:%s", rdx, rcx )
.endc

.case MODEL_TINY
.case MODEL_SMALL
.case MODEL_COMPACT
.case MODEL_MEDIUM
.case MODEL_LARGE
.case MODEL_HUGE

ifndef ASMC64

; v2.03: no DGROUP for COFF/ELF
.elseif ( al >= MODEL_TINY && al <= MODEL_HUGE &&
Options.output_format != OFORMAT_COFF &&
Options.output_format != OFORMAT_ELF )

.endc .if ( Options.output_format == OFORMAT_COFF || Options.output_format == OFORMAT_ELF )
; v2.03: no DGROUP for COFF/ELF

lea rdx,szDgroup
.if ( ModuleInfo._model != MODEL_TINY )
.if ( al != MODEL_TINY )
mov rdx,SimGetSegName( SIM_CODE )
.endif
lea rcx,@CStr("assume cs:%s,ds:%s,ss:%s")
Expand All @@ -260,10 +250,8 @@ ifndef ASMC64
.endif
lea rax,szDgroup
AddLineQueueX( rcx, rdx, rax, rax )
.endc
endif
.case MODEL_NONE
.endsw
.endif
ret

ModelAssumeInit endp
Expand Down
6 changes: 3 additions & 3 deletions source/asmc/src/condasm.asm
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,10 @@ check_blank endp

check_dif proc __ccall private string1:string_t, string2:string_t, sensitive:int_t

.if ( sensitive )
tstrcmp( string1, string2 )
.if ( ldr(sensitive) != 0 )
tstrcmp( ldr(string1), ldr(string2) )
.else
tstricmp( string1, string2 )
tstricmp( ldr(string1), ldr(string2) )
.endif
ret

Expand Down
28 changes: 27 additions & 1 deletion source/asmc/src/expans.asm
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ include listing.inc
include qfloat.inc
include lqueue.inc
include types.inc
include reswords.inc

public MacroLocals

Expand Down Expand Up @@ -1845,6 +1846,31 @@ ExpandToken proc __ccall private uses rsi rdi rbx line:string_t, pi:ptr int_t, t
.return
.endif
mov rc,STRING_EXPANDED

.elseif ( [rsi].asym.state == SYM_STACK && i > 2 &&
[rbx-asm_tok].token == T_OP_BRACKET && [rbx-asm_tok*2].tokval == T_LDR )

; v2.36.01 -- extension: pull register from ldr(param)
; v2.36.11 -- moved here

.if ( [rsi].asym.flags & S_REGPARAM )
movzx ecx,[rsi].asym.param_reg
GetResWName( ecx, buffer )
.else
tstrcpy( buffer, [rbx].string_ptr )
.endif
sub rbx,asm_tok*2
sub i,2
mov rcx,[rbx+asm_tok*4].tokpos
mov rdx,rcx
sub rdx,[rbx].tokpos
sub rcx,line
.ifd ( RebuildLine( buffer, i, tokenarray, edx, ecx, addbrackets ) == ERROR )
.return
.endif
mov rc,STRING_EXPANDED
mov TokenCount,Tokenize( line, 0, tokenarray, TOK_RESCAN )
mov max,eax
.endif
.endif
.endif
Expand Down Expand Up @@ -2395,7 +2421,7 @@ ExpandLine proc __ccall uses rsi rdi rbx string:string_t, tokenarray:token_t

tstrcpy(string, buffer)
mov TokenCount,Tokenize( string, 0, tokenarray, TOK_DEFAULT )
.if ( eax > 2 && rbx == tokenarray && [rbx].flags & T_ISPROC &&
.if ( eax > 2 && rbx == tokenarray && [rbx].flags & T_ISPROC &&
[rbx+asm_tok].token == T_OP_BRACKET )

tstrcat( tstrcpy( buffer, "invoke " ), [rbx].tokpos )
Expand Down
22 changes: 0 additions & 22 deletions source/asmc/src/expreval.asm
Original file line number Diff line number Diff line change
Expand Up @@ -3518,28 +3518,6 @@ EvalOperand proc __ccall uses rsi rbx start_tok:ptr int_t, tokenarray:token_t, e
.continue
.endif

; added v2.36.10

.if ( [rbx].tokval == T_LDR && [rbx+asm_tok].token == T_OP_BRACKET )

.if ( SymFind( [rbx+asm_tok*2].string_ptr ) && [rax].asym.state == SYM_STACK )

.if ( [rax].asym.flags & S_REGPARAM )

movzx ecx,[rax].asym.param_reg
mov [rbx].tokval,ecx
mov [rbx].token,T_REG
get_operand(result, start_tok, tokenarray, flags)
mov rdx,start_tok
add dword ptr [rdx],3
.else
mov rdx,start_tok
inc dword ptr [rdx]
.endif
.continue
.endif
.endif

; fall through. Other directives will end the expression

.case T_COMMA
Expand Down
26 changes: 2 additions & 24 deletions source/asmc/src/hll.asm
Original file line number Diff line number Diff line change
Expand Up @@ -1907,7 +1907,7 @@ LKRenderHllProc proc __ccall private uses rsi rdi rbx dst:string_t, i:uint_t, to
mov al,[rbx].token
.if ( al == T_CL_BRACKET )
dec brcount
.break .ifz
.break .ifz
.elseif ( al == T_OP_BRACKET )
inc brcount
.endif
Expand All @@ -1917,29 +1917,7 @@ LKRenderHllProc proc __ccall private uses rsi rdi rbx dst:string_t, i:uint_t, to
.elseif ( al == T_COMMA && [rbx+asm_tok].token == T_CL_BRACKET && brcount == 1 )
inc j
add rbx,asm_tok
.break

.elseif ( al == T_DIRECTIVE && [rbx].tokval == T_LDR )

; v2.36.01 -- extension: pull register from ldr(param)

add rbx,asm_tok*2

.if ( SymFind( [rbx].string_ptr ) && [rax].asym.state == SYM_STACK )

.if ( [rax].asym.flags & S_REGPARAM )

movzx ecx,[rax].asym.param_reg
mov rsi,GetResWName( ecx, NULL )
.for ( ecx = 0 : byte ptr [rsi+rcx] : ecx++ )
.endf
.else
mov rsi,[rax].asym.name
mov ecx,[rax].asym.name_size
.endif
add rbx,asm_tok
add j,3
.endif
.break
.else
mov rsi,[rbx].tokpos
mov rcx,[rbx+asm_tok].tokpos
Expand Down
4 changes: 2 additions & 2 deletions source/asmc/src/logo.asm
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ cp_usage \
ifdef ASMC64
char_t "64"
endif
char_t " [options] filename [ [options] filename] ... [/link link_options]",10
char_t " [options] filename [ [options] filename] ... [-link link_options]",10
ifdef __UNIX__
char_t "Use option -h for more info" ,10
else
Expand All @@ -47,7 +47,7 @@ cp_options \
ifdef ASMC64
char_t "64"
endif
char_t " [options] filename [ [options] filename] ... [/link link_options]",10
char_t " [options] filename [ [options] filename] ... [-link link_options]",10
char_t 10
ifndef ASMC64
char_t "-<0|1|..|10>[p] Set CPU: 0=8086 (default), 1=80186, 2=80286, 3=80386, 4=80486,",10
Expand Down

0 comments on commit ff936cc

Please sign in to comment.