Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is no folding for the assembly language - Microsoft Macro Assembler #123

Closed
UnlimitedChild opened this issue Dec 28, 2022 · 2 comments
Labels
asm Caused by the asm lexer invalid This doesn't seem right

Comments

@UnlimitedChild
Copy link

UnlimitedChild commented Dec 28, 2022

Hello,

Description of the Issue
There is no folding of procedures and data structures for the assembly language - Microsoft Macro Assembler reference

Steps to Reproduce the Issue
See the picture ....
118847210

Folding should work on all types of control transfers and on all data structures:

JA rel8
JAE rel8
JB rel8
JBE rel8
JC rel8
JCXZ rel8
JECXZ rel8
JRCXZ rel8
JE rel8
JG rel8
JGE rel8
JL rel8
JLE rel8
JNA rel8
JNAE rel8
JNB rel8
JNBE rel8
JNC rel8
JNE rel8
JNG rel8
JNGE rel8
JNL rel8
JNLE rel8
JNO rel8
JNP rel8
JNS rel8
JNZ rel8
JO rel8
JP rel8
JPE rel8
JPO rel8
JS rel8
JZ rel8
JA rel16
JA rel32
JAE rel16
Instruction
JAE rel32
JB rel16
JB rel32
JBE rel16
JBE rel32
JC rel16
JC rel32
JE rel16
JE rel32
JZ rel16
JZ rel32
JG rel16
JG rel32
JGE rel16
JGE rel32
JL rel16
JL rel32
JLE rel16
JLE rel32
JNA rel16
JNA rel32
JNAE rel16
JNAE rel32
JNB rel16
JNB rel32
JNBE rel16
JNBE rel32
JNC rel16
JNC rel32
Instruction
JNE rel16
JNE rel32
JNG rel16
JNG rel32
JNGE rel16
JNGE rel32
JNL rel16
JNL rel32
JNLE rel16
JNLE rel32
JNO rel16
JNO rel32
JNP rel16
JNP rel32
JNS rel16
JNS rel32
JNZ rel16
JNZ rel32
JO rel16
JO rel32
JP rel16
JP rel32
JPE rel16
JPE rel32
JPO rel16
JPO rel32
JS rel16
Instruction
JS rel32
JZ rel16
JZ rel32
Instruction
JMP rel8
JMP rel16
JMP rel32
JMP r/m16
JMP r/m32
JMP r/m64
JMP ptr16:16
JMP ptr16:32
JMP m16:16
JMP m16:32
JMP m16:64
CALL rel16
CALL rel32
CALL r/m16
CALL r/m32
CALL r/m64
CALL ptr16:16
CALL ptr16:32
CALL m16:16
CALL m16:32
CALL m16:64

struct
class
union
LABEL
macro

ELSE
ELSEIF
ELSEIF2
IF
IF2
IFB
IFNB
IFDEF
IFNDEF
IFDIF
IFDIF
IFE
IFIDN
IFIDN

;Conditional Control Flow
.BREAK
.CONTINUE
.ELSE
.ELSEIF
.ENDIF
.ENDW
.IF
.REPEAT
.UNTIL
.UNTILCXZ
.WHILE

;Conditional Error
.ERR
.ERR2
.ERRB
.ERRDEF
.ERRDIF
.ERRDIF
.ERRE
.ERRIDN
.ERRNB
.ERRNDEF
.ERRNZ

ENDM
EXITM
GOTO
LOCAL
MACRO

COMMENT
ECHO
ENDP
INVOKE
PROC
ENDM
FOR
FORC
GOTO
REPEAT
WHILE
END
ENDS
GROUP
SEGMENT

.CODE
.CONST
.DATA
.DATA?
.DOSSEG
.EXIT
.FARDATA
.FARDATA?
.MODEL
.STACK
.STARTUP

ENDS
RECORD
STRUCT
UNION
@UnlimitedChild UnlimitedChild changed the title There is no folding for the assembly language There is no folding for the assembly language - Microsoft Macro Assembler Dec 28, 2022
@nyamatongwe nyamatongwe added the asm Caused by the asm lexer label Dec 28, 2022
@nyamatongwe
Copy link
Member

Folding for the asm lexer responsible for MASM (and NASM...) is defined by keyword lists 6 Directives4Foldstart and 7 Directives4Foldend. Directives in these lists must also be in keyword list 3 Directives to be candidates for folding.
For SciTE, these properties (offset by 1 from API) are a starting point:

keywords4.$(file.patterns.asm)=$(directive_nasm) .switch .endsw proc endp
keywords7.$(file.patterns.asm)=.switch proc
keywords8.$(file.patterns.asm)=.endsw endp

@nyamatongwe nyamatongwe added the invalid This doesn't seem right label Jan 4, 2023
@nyamatongwe
Copy link
Member

Issue is invalid as folding is implemented for the asm lexer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
asm Caused by the asm lexer invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants