From 8e4be680651d53764e6454ca0b5254ae6c723f85 Mon Sep 17 00:00:00 2001 From: sverx Date: Wed, 29 Apr 2020 15:57:43 +0100 Subject: [PATCH 01/10] dstruct --- .../src/org/efry/z80editor/Z80.xtext | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/org.efry.z80editor/src/org/efry/z80editor/Z80.xtext b/org.efry.z80editor/src/org/efry/z80editor/Z80.xtext index f095134..fc24cb7 100644 --- a/org.efry.z80editor/src/org/efry/z80editor/Z80.xtext +++ b/org.efry.z80editor/src/org/efry/z80editor/Z80.xtext @@ -28,15 +28,15 @@ Z80Model: REGISTER_IXL: 'ixl'; REGISTER_IYH: 'iyh'; REGISTER_IYL: 'iyl'; - + DOT: '.'; terminal NEWLINE: // New line on DOS or Unix '\r'? '\n'; - - -VarName: '_sizeof_' | 'a' | 'adc' | 'add' | 'af' | 'align' | 'and' | 'args' | 'asc' | 'asciitable' | 'asctable' | 'asm' | 'b' | 'bank' | 'banks' | 'banksize' | 'bankstotal' | 'bc' | 'bit' | 'byt' | 'c' | 'call' | 'ccf' | 'cp' | 'cpd' | 'cpdr' | 'cpi' | 'cpir' | 'cpl' | 'd' | 'daa' | 'db' | 'de' | 'dec' | 'def' | 'defaultslot' | 'define' | 'desc' | 'di' | 'djnz' | 'ds' | 'dsb' | 'dsw' | 'dw' | 'e' | 'ei' | 'else' | 'emptyfill' | 'enda' | 'endasm' | 'ende' | 'endif' | 'endm' | 'endme' | 'endr' | 'endro' | 'ends' | 'endst' | 'enum' | 'equ' | 'ex' | 'export' | 'exx' | 'filter' | 'force' | 'free' | 'fsize' | 'h' | 'halt' | 'hl' | 'i' | 'if' | 'ifdef' | 'ifdefm' | 'ifeq' | 'ifexists' | 'ifgr' | 'ifgreq' | 'ifle' | 'ifleeq' | 'ifndef' | 'ifndefm' | 'ifneq' | 'im' | 'in' | 'inc' | 'incbin' | 'include' | 'ind' | 'indr' | 'ini' | 'inir' | 'instanceof' | 'ix' | 'iy' | 'jp' | 'jr' | 'l' | 'ld' | 'ldd' | 'lddr' | 'ldi' | 'ldir' | 'm' | 'macro' | 'map' | 'memorymap' | 'nargs' | 'nc' | 'neg' | 'nop' | 'nz' | 'or' | 'org' | 'otdr' | 'otir' | 'out' | 'outd' | 'outi' | 'overwrite' | 'p' | 'pe' | 'po' | 'pop' | 'push' | 'r' | 'ramsection' | 'read' | 'redef' | 'redefine' | 'repeat' | 'rept' | 'res' | 'ret' | 'reti' | 'retn' | 'rl' | 'rla' | 'rlc' | 'rlca' | 'rld' | 'rombankmap' | 'rr' | 'rra' | 'rrc' | 'rrca' | 'rrd' | 'rst' | 'sbc' | 'scf' | 'sdsctag' | 'section' | 'semifree' | 'set' | 'skip' | 'sla' | 'slot' | 'slotsize' | 'smstag' | 'sp' | 'sra' | 'srl' | 'struct' | 'sub' | 'superfree' | 'swap' | 'to' | 'undef' | 'undefine' | 'xor' | 'z' | ID; + + +VarName: '_sizeof_' | 'a' | 'adc' | 'add' | 'af' | 'align' | 'and' | 'args' | 'asc' | 'asciitable' | 'asctable' | 'asm' | 'b' | 'bank' | 'banks' | 'banksize' | 'bankstotal' | 'bc' | 'bit' | 'byt' | 'c' | 'call' | 'ccf' | 'cp' | 'cpd' | 'cpdr' | 'cpi' | 'cpir' | 'cpl' | 'd' | 'daa' | 'db' | 'de' | 'dec' | 'def' | 'defaultslot' | 'define' | 'desc' | 'di' | 'djnz' | 'ds' | 'dsb' | 'dstruct' | 'dsw' | 'dw' | 'e' | 'ei' | 'else' | 'emptyfill' | 'enda' | 'endasm' | 'ende' | 'endif' | 'endm' | 'endme' | 'endr' | 'endro' | 'ends' | 'endst' | 'enum' | 'equ' | 'ex' | 'export' | 'exx' | 'filter' | 'force' | 'free' | 'fsize' | 'h' | 'halt' | 'hl' | 'i' | 'if' | 'ifdef' | 'ifdefm' | 'ifeq' | 'ifexists' | 'ifgr' | 'ifgreq' | 'ifle' | 'ifleeq' | 'ifndef' | 'ifndefm' | 'ifneq' | 'im' | 'in' | 'inc' | 'incbin' | 'include' | 'ind' | 'indr' | 'ini' | 'inir' | 'instanceof' | 'ix' | 'iy' | 'jp' | 'jr' | 'l' | 'ld' | 'ldd' | 'lddr' | 'ldi' | 'ldir' | 'm' | 'macro' | 'map' | 'memorymap' | 'nargs' | 'nc' | 'neg' | 'nop' | 'nz' | 'or' | 'org' | 'otdr' | 'otir' | 'out' | 'outd' | 'outi' | 'overwrite' | 'p' | 'pe' | 'po' | 'pop' | 'push' | 'r' | 'ramsection' | 'read' | 'redef' | 'redefine' | 'repeat' | 'rept' | 'res' | 'ret' | 'reti' | 'retn' | 'rl' | 'rla' | 'rlc' | 'rlca' | 'rld' | 'rombankmap' | 'rr' | 'rra' | 'rrc' | 'rrca' | 'rrd' | 'rst' | 'sbc' | 'scf' | 'sdsctag' | 'section' | 'semifree' | 'set' | 'skip' | 'sla' | 'slot' | 'slotsize' | 'smstag' | 'sp' | 'sra' | 'srl' | 'struct' | 'sub' | 'superfree' | 'swap' | 'to' | 'undef' | 'undefine' | 'xor' | 'z' | ID; AsciiTableTag hidden(): DOT 'asciitable'; AscTableTag hidden(): DOT 'asctable'; @@ -49,6 +49,7 @@ DefineTag hidden(): DOT 'define'; DefTag hidden(): DOT 'def'; DsbTag hidden(): DOT 'dsb'; DsTag hidden(): DOT 'ds'; +DstructTag hidden(): DOT 'dstruct'; DswTag hidden(): DOT 'dsw'; DwTag hidden(): DOT 'dw'; ElseTag hidden(): DOT 'else'; @@ -100,10 +101,10 @@ UndefineTag hidden(): DOT 'undefine'; UndefTag hidden(): DOT 'undef'; Line: - (Macro | MacroUsage | Sms | EmptyFill | Asm | EndAsm | Define | Redefine | Undefine | MemoryMap | RomBankMap | SdscTagCmd | Bank | Org | Orga | Section | Slot | Struct | EnumCmd | RamSection | Rept | Asc | Dsb | Dsw | Db | Dw | IncludeType | - IfCommands | Label | Asciitable | Command) NEWLINE - | (Labels (c=(Command | Asc | Dsb | Dsw | Db | Dw)) NEWLINE) - | {EmptyLine} NEWLINE; + (Macro | MacroUsage | Sms | EmptyFill | Asm | EndAsm | Define | Redefine | Undefine | MemoryMap | RomBankMap | SdscTagCmd | Bank | Org | Orga | Section | Slot | Struct | Dstruct | EnumCmd | RamSection | Rept | Asc | Dsb | Dsw | Db | Dw | IncludeType | + IfCommands | Label | Asciitable | Command) NEWLINE + | (Labels (c=(Command | Asc | Dsb | Dsw | Db | Dw)) NEWLINE) + | {EmptyLine} NEWLINE; IfCommands: IfCmd | IfDefCmd | IfnDefCmd | IfDefMCmd | IfnDefMCmd | IExistsCmd | IfEqCmd | IfnEqCmd | IfLeCmd | IfLeeqCmd | IfGrCmd | IfGreqCmd; Labels: labels+=Label+; @@ -143,14 +144,14 @@ IfGreqCmd: IfGreqTag lhs=Expression rhs=NumericLiteral NEWLINE block+=Line* else MemoryMap: MemoryMapTag NEWLINE cmds+=MemoryMapCommands+ END_ME_TAG; MemoryMapCommands: {MemoryMapCommands} ('defaultslot' defaultSlot=INT NEWLINE) | - ('slotsize' size=NUMBER NEWLINE) | - ('slot' slotNumber=INT startKeyword=ID? startAddress=NUMBER 'size'? size=NUMBER? NEWLINE) + ('slotsize' size=NUMBER NEWLINE) | + ('slot' slotNumber=INT startKeyword=ID? startAddress=NUMBER 'size'? size=NUMBER? NEWLINE) ; RomBankMap: RomBankMapTag NEWLINE cmds+=RomBankCommands+ EndRoTag; RomBankCommands: ('bankstotal' (INT|HEX) NEWLINE) | - ('banksize' (INT|HEX) NEWLINE) | - ('banks' (INT|HEX) NEWLINE) + ('banksize' (INT|HEX) NEWLINE) | + ('banks' (INT|HEX) NEWLINE) ; Rept: (RepeatTag|ReptTag) repeatCount=NumericLiteral NEWLINE block+=Line+ EndRTag; @@ -165,6 +166,7 @@ Slot: SlotTag value=(NUMBER); Struct: StructTag name=LabelType definitions+=VarDefinitionStruct* NEWLINE END_ST_TAG; +Dstruct: DstructTag name=LabelType definitions+=VarDefinitionDstruct* ('values')? NEWLINE END_ST_TAG; EnumCmd: EnumTag startAddress=Expression order=('asc'|'desc')? 'export'? NEWLINE (definitions+=(VarDefinitionEnum)|NEWLINE)* EndETag; @@ -176,6 +178,7 @@ VarDefinitionEnum: EnumType NEWLINE; EnumType: (VarByte|VarWord|VarByteString|VarWordString|VarStruct); +VarDefinitionDstruct: {VarDefinitionDstruct} NEWLINE ( name=ID type=(VarTypeByte|VarTypeWord|VarTypeByteString|VarTypeWordString))?; VarDefinitionStruct: {VarDefinitionStruct} NEWLINE ( name=ID type=(VarTypeByte|VarTypeWord|VarTypeByteString|VarTypeWordString))?; VarDefinition: (VarByte|VarWord|VarByteString|VarWordString|VarStruct) NEWLINE; @@ -236,7 +239,7 @@ DotExpression returns Ref hidden(): EntityRef returns Ref hidden(): {EntityRef} entity=[LabelType] (DOT structArrayIndex=INT)? -; +; Expression returns Expr: BitwiseOp; @@ -244,7 +247,7 @@ Expression returns Expr: BitwiseOp returns Expr: BitshiftOp ({BinaryExpr.left=current} op1=('|' | '&' | '~') right=Addition)*; - + BitshiftOp returns Expr: Addition ({BinaryExpr.left=current} op1=('<<' | '>>') right=Addition)*; @@ -265,7 +268,7 @@ UnaryMinus returns Expr: PrimaryExpression returns Expr: '(' Expression ')' | {NumLiteral} nibbleOp=('<'|'>')? value=NumericLiteral; - + Command: (Adc|Add|And|Bit|Call|Ccf|Cp|Cpd|Cpdr|Cpi|Cpir|Cpl|Daa|Dec|Di|Djnz|Ei|Ex|Exx|Halt|Im|In|Inc|Ind|Indr|Ini|Inir|Jp|Jr|Ld|Ldd|Lddr|Ldi|Ldir|Neg|Nop|Or|Otdr|Otir|Out|Outi|Outd|Pop|Push|Res|Ret|Reti|Retn|Rl|Rla|Rlc|Rlca|Rld|RrCmd|Rra|Rrc|Rrca|Rrd|Rst|Sbc|Scf|Set|Sla|Sra|Srl|Sub|Xor) ; @@ -380,7 +383,7 @@ dst returns Operand: =>indirectOp=NumericLiteralIndirect|op=(s|ss)|indirectOp=(B e returns Operand: (expr=Expression|anonLabel=(PLUS|PLUSPLUS|MINUS|MINUSMINUS|'_b'|'_f')); //fixme -126 to +129 m returns Operand: op=(r)|indirectOp=(HLIndirect|IndexIndirectPlusOffset); -p returns Operand: intType=NUMBER; //FIXME need to restrict to $0000, $0008, $0010, $0018, $0020, $0028, $0030 or $0038 +p returns Operand: intType=NUMBER; //FIXME need to restrict to $0000, $0008, $0010, $0018, $0020, $0028, $0030 or $0038 pp returns Operand: reg=(REGISTER_BC|REGISTER_DE|REGISTER_IX|REGISTER_SP); r returns Operand: reg=(REGISTER_A|REGISTER_B|REGISTER_C|REGISTER_D|REGISTER_E|REGISTER_H|REGISTER_L); rr returns Operand: reg=(REGISTER_BC|REGISTER_DE|REGISTER_IY|REGISTER_SP); From 2e4849e634a4e0536bc8b0a4c9748d5aac0c6a89 Mon Sep 17 00:00:00 2001 From: sverx Date: Thu, 7 May 2020 15:24:20 +0100 Subject: [PATCH 02/10] fixing documentation on opcodes CP, JR, RL --- org.efry.z80editor.ui/resources/z80opCodes/cp.html | 1 + org.efry.z80editor.ui/resources/z80opCodes/jr.html | 8 ++++---- org.efry.z80editor.ui/resources/z80opCodes/rl.html | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/org.efry.z80editor.ui/resources/z80opCodes/cp.html b/org.efry.z80editor.ui/resources/z80opCodes/cp.html index f8b29d1..63d624e 100644 --- a/org.efry.z80editor.ui/resources/z80opCodes/cp.html +++ b/org.efry.z80editor.ui/resources/z80opCodes/cp.html @@ -20,6 +20,7 @@

Syntax

cp ixl cp iyh cp iyl +cp (hl) cp (ix+n) cp (iy+n) cp n ;8 bit constant diff --git a/org.efry.z80editor.ui/resources/z80opCodes/jr.html b/org.efry.z80editor.ui/resources/z80opCodes/jr.html index aca7054..a1fbe52 100644 --- a/org.efry.z80editor.ui/resources/z80opCodes/jr.html +++ b/org.efry.z80editor.ui/resources/z80opCodes/jr.html @@ -2,14 +2,14 @@

Syntax

-JP NN            ;unconditional jump
-JP cond.,NN        ;conditional jump
+JR NN            ;unconditional jump
+JR cond.,NN        ;conditional jump
 

Allowed Instructions

 ;Constants
-JP NN        ;no contition
+JR NN        ;no contition
 JR C,NN        ;jumps if C is set
 JR NC,NN        ;jumps if C is reset
 JR Z,NN        ;jumps if Z is set
@@ -19,7 +19,7 @@ 

Effects

All flags preserved.

Uses

T-States

-

cc is condition: NZ, Z, NC, C, PO, PE, P, M

+

cc is condition: NZ, Z, NC, C

diff --git a/org.efry.z80editor.ui/resources/z80opCodes/rl.html b/org.efry.z80editor.ui/resources/z80opCodes/rl.html index da7a1d2..1ae398d 100644 --- a/org.efry.z80editor.ui/resources/z80opCodes/rl.html +++ b/org.efry.z80editor.ui/resources/z80opCodes/rl.html @@ -11,6 +11,7 @@

Allowed Instructions

RL B RL C RL D +RL E RL H RL L RL (HL) From c950f53c7f54147e633e1c1465918980c6d94693 Mon Sep 17 00:00:00 2001 From: sverx Date: Thu, 7 May 2020 15:29:22 +0100 Subject: [PATCH 03/10] adding the repeat index feature --- org.efry.z80editor/src/org/efry/z80editor/Z80.xtext | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.efry.z80editor/src/org/efry/z80editor/Z80.xtext b/org.efry.z80editor/src/org/efry/z80editor/Z80.xtext index fc24cb7..c52f2e5 100644 --- a/org.efry.z80editor/src/org/efry/z80editor/Z80.xtext +++ b/org.efry.z80editor/src/org/efry/z80editor/Z80.xtext @@ -154,7 +154,7 @@ RomBankCommands: ('bankstotal' (INT|HEX) NEWLINE) | ('banks' (INT|HEX) NEWLINE) ; -Rept: (RepeatTag|ReptTag) repeatCount=NumericLiteral NEWLINE block+=Line+ EndRTag; +Rept: (RepeatTag|ReptTag) repeatCount=NumericLiteral ('index' index=LabelType)? NEWLINE block+=Line+ EndRTag; Bank: {BankCmd} BankTag INT ('slot' slot=INT)?; Org: OrgTag value=(NUMBER); From d7cf1fcdf6fed49459d583d1d01b6f715e0af3ee Mon Sep 17 00:00:00 2001 From: sverx Date: Wed, 13 May 2020 18:40:06 +0100 Subject: [PATCH 04/10] fixing documentation on opcodes EX, EXX --- org.efry.z80editor.ui/resources/z80opCodes/ex.html | 4 ++-- org.efry.z80editor.ui/resources/z80opCodes/exx.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/org.efry.z80editor.ui/resources/z80opCodes/ex.html b/org.efry.z80editor.ui/resources/z80opCodes/ex.html index 0ab8a2a..ca551ce 100644 --- a/org.efry.z80editor.ui/resources/z80opCodes/ex.html +++ b/org.efry.z80editor.ui/resources/z80opCodes/ex.html @@ -35,10 +35,10 @@

T-States

- + - +
X
(sp),ix1923
(sp),iy1923
diff --git a/org.efry.z80editor.ui/resources/z80opCodes/exx.html b/org.efry.z80editor.ui/resources/z80opCodes/exx.html index 8f7e1a4..f55e995 100644 --- a/org.efry.z80editor.ui/resources/z80opCodes/exx.html +++ b/org.efry.z80editor.ui/resources/z80opCodes/exx.html @@ -1,4 +1,4 @@ -

EXX exchanges BC, DE, and HL with shadow registers with BC', DE', and HL'.

+

EXX exchanges BC, DE, and HL with shadow registers BC', DE', and HL'.

Syntax


From 0093e0c9cfd799c855ab4e8a53863d8c86b0d5f0 Mon Sep 17 00:00:00 2001
From: sverx 
Date: Mon, 18 May 2020 12:02:10 +0100
Subject: [PATCH 05/10] ramsections additional attributes org/orga, returnorg,
 force, priority, appendto

---
 org.efry.z80editor/src/org/efry/z80editor/Z80.xtext | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/org.efry.z80editor/src/org/efry/z80editor/Z80.xtext b/org.efry.z80editor/src/org/efry/z80editor/Z80.xtext
index c52f2e5..ab5a469 100644
--- a/org.efry.z80editor/src/org/efry/z80editor/Z80.xtext
+++ b/org.efry.z80editor/src/org/efry/z80editor/Z80.xtext
@@ -170,7 +170,7 @@ Dstruct: DstructTag name=LabelType definitions+=VarDefinitionDstruct* ('values')
 
 EnumCmd: EnumTag startAddress=Expression order=('asc'|'desc')? 'export'? NEWLINE (definitions+=(VarDefinitionEnum)|NEWLINE)* EndETag;
 
-RamSection: RamSectionTag sectionName=STRING ('bank' bank=NUMBER)? ('slot' slot=NUMBER)? ('align' align=NUMBER)? NEWLINE (definitions+=VarDefinition|NEWLINE)* END_S_TAG;
+RamSection: RamSectionTag sectionName=STRING ('bank' bank=NUMBER)? ('slot' slot=NUMBER)? ('org'|'orga' addr=NUMBER)? ('returnorg')? ('priority' prio=NUMBER)? ('force')? ('align' align=NUMBER)? ('appendto' appto=LabelType)? NEWLINE (definitions+=VarDefinition|NEWLINE)* END_S_TAG;
 
 
 //VarDefinitionEnum: {VarDef} (varName=VarName ':'? type=(EnumType))? NEWLINE;

From f355dabd1b83a09170e75d80d0b34632037fe8c9 Mon Sep 17 00:00:00 2001
From: sverx 
Date: Mon, 18 May 2020 12:11:10 +0100
Subject: [PATCH 06/10] fixing documentation on opcode LD

(clarifying which instructions affects flags, removing double entries from cycles table)
---
 org.efry.z80editor.ui/resources/z80opCodes/ld.html | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/org.efry.z80editor.ui/resources/z80opCodes/ld.html b/org.efry.z80editor.ui/resources/z80opCodes/ld.html
index 937bafa..fd1c9ae 100644
--- a/org.efry.z80editor.ui/resources/z80opCodes/ld.html
+++ b/org.efry.z80editor.ui/resources/z80opCodes/ld.html
@@ -801,7 +801,7 @@ 

Syntax

Effects

-

No flags are altered except in the cases of the I or R registers.

+

No flags are altered except in the cases of loading the I or R registers into A.

In those cases, C is preserved, H and N are reset, and alters Z and S. P/V is set if interrupts are enabled, reset otherwise.

Uses

Use to load numbers into operands. They can either be numbers used in the code (usually 8-bits), or labels (usually 16-bits).

@@ -877,14 +877,6 @@

T-States

9 -a, (BC) -7 - - -(XX), a -13 - - rr,XX 10 From 86c2732cca6fcd16fde42c5f5af04913437cf34d Mon Sep 17 00:00:00 2001 From: sverx Date: Mon, 18 May 2020 16:04:10 +0100 Subject: [PATCH 07/10] some missing files added --- .../org/efry/z80editor/ide/Z80IdeModule.xtend | 11 ++++++ .../org/efry/z80editor/ide/Z80IdeSetup.xtend | 20 ++++++++++ .../org.efry.z80editor.target.target | 38 +++++++++++++++++++ org.efry.z80editor.target/pom.xml | 15 ++++++++ .../META-INF/MANIFEST.MF | 18 +++++++++ org.efry.z80editor.ui.tests/pom.xml | 28 ++++++++++++++ .../org/efry/z80editor/ui/Z80UiModule.xtend | 13 +++++++ .../contentassist/Z80ProposalProvider.xtend | 12 ++++++ .../Z80DescriptionLabelProvider.xtend | 24 ++++++++++++ .../ui/quickfix/Z80QuickfixProvider.xtend | 24 ++++++++++++ .../org/efry/z80editor/Z80RuntimeModule.xtend | 11 ++++++ .../efry/z80editor/Z80StandaloneSetup.xtend | 15 ++++++++ 12 files changed, 229 insertions(+) create mode 100644 org.efry.z80editor.ide/src/org/efry/z80editor/ide/Z80IdeModule.xtend create mode 100644 org.efry.z80editor.ide/src/org/efry/z80editor/ide/Z80IdeSetup.xtend create mode 100644 org.efry.z80editor.target/org.efry.z80editor.target.target create mode 100644 org.efry.z80editor.target/pom.xml create mode 100644 org.efry.z80editor.ui.tests/META-INF/MANIFEST.MF create mode 100644 org.efry.z80editor.ui.tests/pom.xml create mode 100644 org.efry.z80editor.ui/src/org/efry/z80editor/ui/Z80UiModule.xtend create mode 100644 org.efry.z80editor.ui/src/org/efry/z80editor/ui/contentassist/Z80ProposalProvider.xtend create mode 100644 org.efry.z80editor.ui/src/org/efry/z80editor/ui/labeling/Z80DescriptionLabelProvider.xtend create mode 100644 org.efry.z80editor.ui/src/org/efry/z80editor/ui/quickfix/Z80QuickfixProvider.xtend create mode 100644 org.efry.z80editor/src/org/efry/z80editor/Z80RuntimeModule.xtend create mode 100644 org.efry.z80editor/src/org/efry/z80editor/Z80StandaloneSetup.xtend diff --git a/org.efry.z80editor.ide/src/org/efry/z80editor/ide/Z80IdeModule.xtend b/org.efry.z80editor.ide/src/org/efry/z80editor/ide/Z80IdeModule.xtend new file mode 100644 index 0000000..340b9ca --- /dev/null +++ b/org.efry.z80editor.ide/src/org/efry/z80editor/ide/Z80IdeModule.xtend @@ -0,0 +1,11 @@ +/* + * generated by Xtext 2.20.0 + */ +package org.efry.z80editor.ide + + +/** + * Use this class to register ide components. + */ +class Z80IdeModule extends AbstractZ80IdeModule { +} diff --git a/org.efry.z80editor.ide/src/org/efry/z80editor/ide/Z80IdeSetup.xtend b/org.efry.z80editor.ide/src/org/efry/z80editor/ide/Z80IdeSetup.xtend new file mode 100644 index 0000000..396eea8 --- /dev/null +++ b/org.efry.z80editor.ide/src/org/efry/z80editor/ide/Z80IdeSetup.xtend @@ -0,0 +1,20 @@ +/* + * generated by Xtext 2.20.0 + */ +package org.efry.z80editor.ide + +import com.google.inject.Guice +import org.eclipse.xtext.util.Modules2 +import org.efry.z80editor.Z80RuntimeModule +import org.efry.z80editor.Z80StandaloneSetup + +/** + * Initialization support for running Xtext languages as language servers. + */ +class Z80IdeSetup extends Z80StandaloneSetup { + + override createInjector() { + Guice.createInjector(Modules2.mixin(new Z80RuntimeModule, new Z80IdeModule)) + } + +} diff --git a/org.efry.z80editor.target/org.efry.z80editor.target.target b/org.efry.z80editor.target/org.efry.z80editor.target.target new file mode 100644 index 0000000..e1e9580 --- /dev/null +++ b/org.efry.z80editor.target/org.efry.z80editor.target.target @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.efry.z80editor.target/pom.xml b/org.efry.z80editor.target/pom.xml new file mode 100644 index 0000000..d2db1f7 --- /dev/null +++ b/org.efry.z80editor.target/pom.xml @@ -0,0 +1,15 @@ + + 4.0.0 + + org.efry.z80editor + org.efry.z80editor.parent + 1.0.0-SNAPSHOT + + org.efry.z80editor.target + eclipse-target-definition + + + + + diff --git a/org.efry.z80editor.ui.tests/META-INF/MANIFEST.MF b/org.efry.z80editor.ui.tests/META-INF/MANIFEST.MF new file mode 100644 index 0000000..000ae58 --- /dev/null +++ b/org.efry.z80editor.ui.tests/META-INF/MANIFEST.MF @@ -0,0 +1,18 @@ +Manifest-Version: 1.0 +Automatic-Module-Name: org.efry.z80editor.ui.tests +Bundle-ManifestVersion: 2 +Bundle-Name: org.efry.z80editor.ui.tests +Bundle-Vendor: My Company +Bundle-Version: 1.0.0.qualifier +Bundle-SymbolicName: org.efry.z80editor.ui.tests; singleton:=true +Bundle-ActivationPolicy: lazy +Require-Bundle: org.efry.z80editor.ui, + org.junit.jupiter.api;bundle-version="[5.0.0,6.0.0)", + org.eclipse.xtext.testing, + org.eclipse.xtext.xbase.testing, + org.eclipse.xtext.xbase.junit, + org.eclipse.core.runtime, + org.eclipse.xtext.ui.testing, + org.eclipse.ui.workbench;resolution:=optional +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Export-Package: org.efry.z80editor.ui.tests;x-internal=true diff --git a/org.efry.z80editor.ui.tests/pom.xml b/org.efry.z80editor.ui.tests/pom.xml new file mode 100644 index 0000000..2600dcc --- /dev/null +++ b/org.efry.z80editor.ui.tests/pom.xml @@ -0,0 +1,28 @@ + + 4.0.0 + + org.efry.z80editor + org.efry.z80editor.parent + 1.0.0-SNAPSHOT + + org.efry.z80editor.ui.tests + eclipse-test-plugin + + + + + org.eclipse.xtend + xtend-maven-plugin + + + org.eclipse.tycho + tycho-surefire-plugin + + true + + + + + + diff --git a/org.efry.z80editor.ui/src/org/efry/z80editor/ui/Z80UiModule.xtend b/org.efry.z80editor.ui/src/org/efry/z80editor/ui/Z80UiModule.xtend new file mode 100644 index 0000000..e696a40 --- /dev/null +++ b/org.efry.z80editor.ui/src/org/efry/z80editor/ui/Z80UiModule.xtend @@ -0,0 +1,13 @@ +/* + * generated by Xtext 2.20.0 + */ +package org.efry.z80editor.ui + +import org.eclipse.xtend.lib.annotations.FinalFieldsConstructor + +/** + * Use this class to register components to be used within the Eclipse IDE. + */ +@FinalFieldsConstructor +class Z80UiModule extends AbstractZ80UiModule { +} diff --git a/org.efry.z80editor.ui/src/org/efry/z80editor/ui/contentassist/Z80ProposalProvider.xtend b/org.efry.z80editor.ui/src/org/efry/z80editor/ui/contentassist/Z80ProposalProvider.xtend new file mode 100644 index 0000000..792c9ea --- /dev/null +++ b/org.efry.z80editor.ui/src/org/efry/z80editor/ui/contentassist/Z80ProposalProvider.xtend @@ -0,0 +1,12 @@ +/* + * generated by Xtext 2.20.0 + */ +package org.efry.z80editor.ui.contentassist + + +/** + * See https://www.eclipse.org/Xtext/documentation/310_eclipse_support.html#content-assist + * on how to customize the content assistant. + */ +class Z80ProposalProvider extends AbstractZ80ProposalProvider { +} diff --git a/org.efry.z80editor.ui/src/org/efry/z80editor/ui/labeling/Z80DescriptionLabelProvider.xtend b/org.efry.z80editor.ui/src/org/efry/z80editor/ui/labeling/Z80DescriptionLabelProvider.xtend new file mode 100644 index 0000000..c639968 --- /dev/null +++ b/org.efry.z80editor.ui/src/org/efry/z80editor/ui/labeling/Z80DescriptionLabelProvider.xtend @@ -0,0 +1,24 @@ +/* + * generated by Xtext 2.20.0 + */ +package org.efry.z80editor.ui.labeling + +import org.eclipse.xtext.ui.label.DefaultDescriptionLabelProvider + +/** + * Provides labels for IEObjectDescriptions and IResourceDescriptions. + * + * https://www.eclipse.org/Xtext/documentation/310_eclipse_support.html#label-provider + */ +class Z80DescriptionLabelProvider extends DefaultDescriptionLabelProvider { + + // Labels and icons can be computed like this: + +// override text(IEObjectDescription ele) { +// ele.name.toString +// } +// +// override image(IEObjectDescription ele) { +// ele.EClass.name + '.gif' +// } +} diff --git a/org.efry.z80editor.ui/src/org/efry/z80editor/ui/quickfix/Z80QuickfixProvider.xtend b/org.efry.z80editor.ui/src/org/efry/z80editor/ui/quickfix/Z80QuickfixProvider.xtend new file mode 100644 index 0000000..b1cea62 --- /dev/null +++ b/org.efry.z80editor.ui/src/org/efry/z80editor/ui/quickfix/Z80QuickfixProvider.xtend @@ -0,0 +1,24 @@ +/* + * generated by Xtext 2.20.0 + */ +package org.efry.z80editor.ui.quickfix + +import org.eclipse.xtext.ui.editor.quickfix.DefaultQuickfixProvider + +/** + * Custom quickfixes. + * + * See https://www.eclipse.org/Xtext/documentation/310_eclipse_support.html#quick-fixes + */ +class Z80QuickfixProvider extends DefaultQuickfixProvider { + +// @Fix(Z80Validator.INVALID_NAME) +// def capitalizeName(Issue issue, IssueResolutionAcceptor acceptor) { +// acceptor.accept(issue, 'Capitalize name', 'Capitalize the name.', 'upcase.png') [ +// context | +// val xtextDocument = context.xtextDocument +// val firstLetter = xtextDocument.get(issue.offset, 1) +// xtextDocument.replace(issue.offset, 1, firstLetter.toUpperCase) +// ] +// } +} diff --git a/org.efry.z80editor/src/org/efry/z80editor/Z80RuntimeModule.xtend b/org.efry.z80editor/src/org/efry/z80editor/Z80RuntimeModule.xtend new file mode 100644 index 0000000..53559b5 --- /dev/null +++ b/org.efry.z80editor/src/org/efry/z80editor/Z80RuntimeModule.xtend @@ -0,0 +1,11 @@ +/* + * generated by Xtext 2.20.0 + */ +package org.efry.z80editor + + +/** + * Use this class to register components to be used at runtime / without the Equinox extension registry. + */ +class Z80RuntimeModule extends AbstractZ80RuntimeModule { +} diff --git a/org.efry.z80editor/src/org/efry/z80editor/Z80StandaloneSetup.xtend b/org.efry.z80editor/src/org/efry/z80editor/Z80StandaloneSetup.xtend new file mode 100644 index 0000000..fad2a77 --- /dev/null +++ b/org.efry.z80editor/src/org/efry/z80editor/Z80StandaloneSetup.xtend @@ -0,0 +1,15 @@ +/* + * generated by Xtext 2.20.0 + */ +package org.efry.z80editor + + +/** + * Initialization support for running Xtext languages without Equinox extension registry. + */ +class Z80StandaloneSetup extends Z80StandaloneSetupGenerated { + + def static void doSetup() { + new Z80StandaloneSetup().createInjectorAndDoEMFRegistration() + } +} From 039c395cbaf86c27cfd0e0eced0450440b10af56 Mon Sep 17 00:00:00 2001 From: sverx Date: Tue, 19 May 2020 12:11:26 +0100 Subject: [PATCH 08/10] fixing documentation on opcode LD (this time for real) --- .../resources/z80opCodes/ld.html | 95 +++++++++++++------ 1 file changed, 66 insertions(+), 29 deletions(-) diff --git a/org.efry.z80editor.ui/resources/z80opCodes/ld.html b/org.efry.z80editor.ui/resources/z80opCodes/ld.html index fd1c9ae..cf1126c 100644 --- a/org.efry.z80editor.ui/resources/z80opCodes/ld.html +++ b/org.efry.z80editor.ui/resources/z80opCodes/ld.html @@ -807,10 +807,10 @@

Uses

Use to load numbers into operands. They can either be numbers used in the code (usually 8-bits), or labels (usually 16-bits).

-ld b,$05    ;Counter
+ld b,$05     ;Counter
 
 ld hl,var    ;Variable label
-ld a,(var)    ;Write data to var
+ld (var),a   ;Write data to var
 

T-States

r denotes 8-bit register.
@@ -821,20 +821,20 @@

T-States

4 -r,X +r, X 7 -r,(hl) +r, (hl) 7 -r,(ix+X) -19 +(hl), r +7 -r,(iy+X) -19 +(hl), X +10 a, (bc) @@ -853,31 +853,15 @@

T-States

7 -(de),a +(de), a 7 -(XX),a +(XX), a 13 -a, i -9 - - -a, r -9 - - -i, a -9 - - -r, a -9 - - -rr,XX +rr, XX 10 @@ -890,7 +874,7 @@

T-States

hl, (XX) -20 +16 ix, (XX) @@ -902,7 +886,7 @@

T-States

(XX), hl -20 +16 (XX), rr @@ -917,6 +901,46 @@

T-States

20 +r, (ix+X) +19 + + +r, (iy+X) +19 + + +(ix+X), r +19 + + +(iy+X), r +19 + + +(ix+X), X +19 + + +(iy+X), X +19 + + +a, I +9 + + +a, R +9 + + +I, a +9 + + +R, a +9 + + sp, hl 6 @@ -928,4 +952,17 @@

T-States

sp, iy 10 + +sp, XX +10 + + +sp, (XX) +20 + + +(XX), sp +20 + + From feb79a313ca717673cb6b36624367531b111c146 Mon Sep 17 00:00:00 2001 From: sverx Date: Tue, 16 Jun 2020 18:04:23 +0100 Subject: [PATCH 09/10] another small change on documentation on opcode LD ld (ix+d),N *and* ld (iy+d),N are valid. Now marked as such --- org.efry.z80editor.ui/resources/z80opCodes/ld.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/org.efry.z80editor.ui/resources/z80opCodes/ld.html b/org.efry.z80editor.ui/resources/z80opCodes/ld.html index cf1126c..c769389 100644 --- a/org.efry.z80editor.ui/resources/z80opCodes/ld.html +++ b/org.efry.z80editor.ui/resources/z80opCodes/ld.html @@ -735,7 +735,7 @@

Syntax

- +x @@ -765,7 +765,7 @@

Syntax

- +x From 0e0f921482caafd6ecb0c52ef70d98c1f015bab6 Mon Sep 17 00:00:00 2001 From: sverx Date: Tue, 23 Jun 2020 18:31:02 +0100 Subject: [PATCH 10/10] sections and ramsections 'offset' attribute, Dstruct fix (hopefully) --- org.efry.z80editor/src/org/efry/z80editor/Z80.xtext | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/org.efry.z80editor/src/org/efry/z80editor/Z80.xtext b/org.efry.z80editor/src/org/efry/z80editor/Z80.xtext index ab5a469..a277d12 100644 --- a/org.efry.z80editor/src/org/efry/z80editor/Z80.xtext +++ b/org.efry.z80editor/src/org/efry/z80editor/Z80.xtext @@ -160,17 +160,17 @@ Bank: {BankCmd} BankTag INT ('slot' slot=INT)?; Org: OrgTag value=(NUMBER); Orga: OrgaTag value=(NUMBER); -Section: SectionTag sectionName=STRING? ('size' size=NUMBER)? ('align' align=NUMBER)? ('force'|'semifree'|'free'|'superfree'|'overwrite'|'semisubfree')? NEWLINE lines+=Line+ END_S_TAG; +Section: SectionTag sectionName=STRING? ('size' size=NUMBER)? ('align' align=NUMBER)? ('offset' offset=NUMBER)? ('force'|'semifree'|'free'|'superfree'|'overwrite'|'semisubfree')? NEWLINE lines+=Line+ END_S_TAG; Slot: SlotTag value=(NUMBER); Struct: StructTag name=LabelType definitions+=VarDefinitionStruct* NEWLINE END_ST_TAG; -Dstruct: DstructTag name=LabelType definitions+=VarDefinitionDstruct* ('values')? NEWLINE END_ST_TAG; +Dstruct: DstructTag name=LabelType ('values')? definitions+=VarDefinitionDstruct* NEWLINE END_ST_TAG; EnumCmd: EnumTag startAddress=Expression order=('asc'|'desc')? 'export'? NEWLINE (definitions+=(VarDefinitionEnum)|NEWLINE)* EndETag; -RamSection: RamSectionTag sectionName=STRING ('bank' bank=NUMBER)? ('slot' slot=NUMBER)? ('org'|'orga' addr=NUMBER)? ('returnorg')? ('priority' prio=NUMBER)? ('force')? ('align' align=NUMBER)? ('appendto' appto=LabelType)? NEWLINE (definitions+=VarDefinition|NEWLINE)* END_S_TAG; +RamSection: RamSectionTag sectionName=STRING ('bank' bank=NUMBER)? ('slot' slot=NUMBER)? ('org'|'orga' addr=NUMBER)? ('returnorg')? ('priority' prio=NUMBER)? ('force')? ('align' align=NUMBER)? ('offset' offset=NUMBER)? ('appendto' appto=LabelType)? NEWLINE (definitions+=VarDefinition|NEWLINE)* END_S_TAG; //VarDefinitionEnum: {VarDef} (varName=VarName ':'? type=(EnumType))? NEWLINE;