Repository navigation
Releases: zhihao1021/PIC18-Assembly-VSC-Extension
Release list
Release 0.2.1
Added
-
Memory inspector: command
PIC18 Assembly: Open Memory Inspectoropens a read-only
memory view as a tab in the editor area. Memory is fetched from the active debug session
with the standard DAPreadMemoryrequest, so it works with the MPLAB debug adapter
(mplab-core-da) without depending on how that adapter is implemented.- Memory space selector (
ram/program, configurable) that builds
a<space>:<address>memory reference, plus a raw mode for typing a reference directly.
Switching space adopts that space's MAU size, grouping and length, soprogramlands on
2-byte (instruction word) groups over 4096 bytes. - Configurable start address (hex) and length, row width (Auto or a fixed byte count),
MAU size, MAU per group, byte order, and display format (hex / dec / oct / bin). - MPLAB X style layout: rows aligned to the row width with a hex address column (
0x0000,
0x0010, …) and column headers giving the byte offset within the row. - Optional ASCII column, and optional highlighting of values that changed since the
previous read. - Re-reads automatically when the target stops; format changes re-render without touching
the target again.
- Memory space selector (
-
SFR view: command
PIC18 Assembly: Open SFR Viewopens a read-only table of the
device's Special Function Registers (address, name, value) as a tab in the editor area.- The first read evaluates each register name once and keeps the
memoryReferencethe
adapter answers with (e.g.sfr:0xFD8), so the addresses come from the adapter rather
than from this extension. Every refresh afterwards is a single blockreadMemory, with
each register's value rebuilt from the response's own base address — fast, and portable
to other devices. - Registers with named bits (e.g.
STATUS→ N, OV, Z, DC, C) expand into sub-rows; a bit
row shows its bit number in the address column and bit rows always keep bit order, no
matter how the parent registers are sorted. - Click the Address or Register column header to sort by it; click again to reverse.
- Every value is shown in hex, decimal and binary at once, in their own columns.
- Search box matching a register name, a bit name, or an address (
F80or0xF80); an
"Only changed" filter that keeps just the registers whose value moved since the previous
read; highlighting of changed values.
- The first read evaluates each register name once and keeps the
-
SFR table generated by
scripts/generateSfrMap.js. Bit positions are derived from the
BANKMASK(<register>), <bit>form of the xc8 defines and cross-checked against the
datasheet bit layout already shipped inregister.json; the generator reports any
disagreement rather than silently picking one source. -
Setting
pic18-assembly.memoryInspector.memorySpacesfor the memory space list,
pic18-assembly.memoryInspector.spaceDefaultsfor the per-space presets, and
pic18-assembly.memoryInspector.debugTypesfor the debug session types to read from. -
Setting
pic18-assembly.projectScope(folder/workspace) to choose whether each
workspace folder is its own project or all folders share a single index. -
Output channel "PIC18 Assembly" (command
PIC18 Assembly: Show Log) logging every Debug
Adapter Protocol exchange the memory and SFR views make — the request arguments, the
resolved address, how many bytes were readable, and the adapter's error text — so a failing
read can be diagnosed and exported.
Fixed
- The memory view mis-drew the unreadable region: per the DAP specification
dataholds the
bytes that were read andunreadableBytescounts further bytes after them, but the view
treated the unreadable run as overlapping the returned data. The grid is now built from the
address the adapter reports for its data and stops at the last byte it returned;
unreadable addresses are left out entirely and the status line says where they start. - Switching the memory view to another memory space no longer marks every cell as changed.
Addresses only mean the same thing within one space, so a read is now compared against the
previous one only when both came from the same space. - The memory view's column headers no longer widen with the display format (they showed three
digits in decimal mode). They are sized from the largest byte offset in a row instead, which
never needs more than two hex digits. - Decimal values in the memory view are no longer zero padded, matching the SFR view.
- Both views now scroll inside themselves instead of scrolling the whole tab, and their
column header row stays pinned to the top while the rows scroll under it. - The memory view treated the MAU size as a grouping width rather than as the size of an
addressable unit. Setting the MAU to 2 bytes now means one address covers two bytes, so
eight bytes of data span the addresses 0x00–0x03 instead of 0x00–0x07. The row length is
counted in addressable units accordingly (mausPerRowin
pic18-assembly.memoryInspector.spaceDefaults, renamed frombytesPerRow), which keeps
the address column stepping by 0x10 per row at any MAU size. - A group in the memory view is now one column holding one uninterrupted value, the way a
multi-byte addressable unit already was. On a little-endian target its highest address is
the most significant part, soF6at 0x00 and6Aat 0x01 read as6AF6with two units
per group; big-endian keeps plain address order. Each column header carries the lowest
address of its group (00 02 04 …at two units per group). A group is only drawn when
every unit of it was read, and the ASCII column stays in plain address order, being a
rendering of the raw bytes. - The SFR view no longer assumes one memory reference syntax. It reads the block from the
space origin the adapter itself reported, falling back to the lowest register address and
then a bare address, remembers whichever form was accepted, and lists every form it tried
when they all fail. - Multi-root workspaces are no longer indexed as a single project. Each workspace folder now
has its own symbol index, so identically named labels, variables or macros in unrelated
folders no longer report asDuplicate label/Duplicate macro name, and completions,
go-to-definition, find-references, hovers and semantic highlighting stay inside the folder
the file belongs to. - Include paths that fall back to a basename match no longer resolve to a file in a different
workspace folder. - A folder's
.gitignoreno longer excludes files of a sibling workspace folder from indexing. - Adding or removing a workspace folder, or changing
pic18-assembly.exclude, now reindexes
the workspace instead of leaving stale entries behind.
Release 0.2.0
Added
- Assembler dialect setting
pic18-assembly.assembler(mpasm/xc8): directive completions,
SFR definition values and hover documentation now follow the selected assembler. - Compatibility diagnostics: warn when a directive of the other assembler dialect is used
(can be disabled withpic18-assembly.diagnostics.assemblerCompatibility). - Directive completions with descriptions at the opcode position, and hover documentation for directives.
- Preprocessor directive completions after typing
#(dialect aware). - Hover documentation for SFR / standard include definitions (including register bit layouts).
- Support for
EXTERN(MPASM spelling),SET,CBLOCK/ENDCmembers,name RES n/name DS n
and value-less#definewhen indexing symbols. - Comma-separated name lists in
EXTRN/GLOBALare now fully indexed (previously only the first name). LOCALsymbols inside macros are recognized and scoped to the macro.- Labels defined in included files are now valid branch targets (textual inclusion).
- Setting
pic18-assembly.excludefor additional indexing exclusions, and
pic18-assembly.documentation.includeTraditionalChineseto toggle the zh-TW instruction docs. - When accepting a not-yet-imported label completion with the
xc8dialect selected, a
GLOBALdeclaration is also added to the file that defines the label (pic-as requires the
defining module to export the symbol), in addition to theEXTRNinserted locally. - xc8-only diagnostic: warn when an
EXTRNsymbol is defined in another file without a
matchingGLOBALexport, with a Quick Fix that inserts the missingGLOBALdeclaration. - "Find All References" (Shift+F12) for labels, variables (EQU/#define/CBLOCK), macros,
macro parameters and EXTRN-only C symbols — works from the definition site and from any
usage, including symbols passed as macro invocation arguments. - Ctrl+Click on a definition site (label, variable, macro) now shows the reference list,
matching the behavior of other language extensions; Ctrl+Click on a C-symbol usage jumps
to itsEXTRNdeclaration. - Numeric literal diagnostics: digit-leading tokens in instruction operands that match no
supported number format (binary0101B, octal17Q, decimal10, hex22h/0FFh/0x1F)
are reported as errors — also inside the expansion of#definealiases and built-in
defines, and inEQU/SETvalues. The TextMate grammar's number rules were aligned
(lowercase binary suffixb, hex suffix without a leading zero like22h). - ISA operand-count diagnostics: report too few / too many operands per the PIC18 instruction
signatures (MOVFF fs, fd,BSF f, b {,a}, ...). Aliases are expanded before counting:
user#definesubstitutions that stand for several operands (e.g.#define LED LATA, 0, a)
and dialect-dependent built-ins (pic-asLATA0=BANKMASK(LATA), 0, a) are handled, and
instructions whose operands are macro parameters are skipped (caller-dependent). - Underscore-prefixed
EXTRNnames (C symbols such as_mainfrom linked C object files) are
treated as valid references: no error, an informational (blue underline) marker instead,
with label coloring, an explanatory hover, and auto-completion that behaves like regular
labels (including automaticEXTRNinsertion).
Fixed
- Language features now update live while typing; previously most data refreshed only on save.
- Removed catastrophic-backtracking-prone regular expressions; parsing is now a linear scan
(significantly better performance and stability on large files). - Label completion cache no longer serves stale results after edits.
- Hover / Go to Definition / Find References no longer misidentify parts of numeric or
character literals as symbols (e.g. the binary suffix in01010101Bbeing confused with
the assembler designatorb, hex0FFh, radix literalsB'0101', char literals'A'). .gitignoreentries are now converted to proper glob patterns instead of being used verbatim.- Fixed macro argument count validation messages and unclosed-macro detection.
Changed
- Complete architectural rewrite: single-pass parser + workspace index; all providers
(completion, hover, definition, semantic tokens, diagnostics) read from one shared model. - Macro definition snippet now includes the macro name placeholder (
name MACRO ... ENDM).
Removed
- Runtime dependency on
lru-cache.
Release 0.1.10
Added
- AI-translated instruction details in Traditional Chinese.
Fixed
- N/A
Changed
- N/A
Removed
- N/A
Release 0.1.9
Added
- N/A
Fixed
- Can use labels as variable names.
Changed
- N/A
Removed
- N/A
Release 0.1.8
Added
- Support use macro parameters as branch labels.
Fixed
- N/A
Changed
- N/A
Removed
- N/A
Release 0.1.7
Added
- Auto exclude files in
.gitignorefrom language features.
Fixed
- Hightlighting issue when use EQU with lowercase label.
- Hightlighting issue when use macro with prefix space before macro name.
Changed
- Add
.historyto the excluded files in the extension.
Removed
- N/A
Release 0.1.6
Added
- Hover documentation for instruction.
- Hover documentation for label.
- Hover documentation for variable.
- Hover documentation for macro.
Fixed
- Fix variable still exists after removing all variable definitions in a file.
Changed
- N/A
Removed
- N/A
Release 0.1.5
Added
- N/A
Fixed
- Fix variable still exists after removing all variable definitions in a file.
Changed
- N/A
Removed
- N/A