Commit Graph

239 Commits

Author SHA1 Message Date
Kelvin Sherlock
fc62d0c9e7 'a' as an operand is ignored.
Based on testing with Merlin-16+ 4.12, this seems to apply in all cases

inc a -> equivalent to inc
lda a -> equivalent to lda (bad address mode error)

if you do have an 'a' label, you need to specify the address mode, eg

lda |a, lda >a, lda <a
2021-08-31 18:08:08 -04:00
Shawn Quick
3f090b7b67 github authentication 2021-08-20 08:35:37 -07:00
Lane Roathe
a7b040e182
Merge pull request #61 from ksherlock/qlink_ext
qlinkgs - link script ext support
2021-05-04 13:01:18 -07:00
Kelvin Sherlock
8d65e4c290 link script ext support
"label ext" should import label (an absolute ent from a .L file) into the local symbol table.
handled by setting the linkgeqbit.
2021-05-03 23:50:56 -04:00
Lane Roathe
ba7a68c1bc
Merge pull request #60 from ksherlock/len_pos
qlinkgs - implement the len/pos linker opcodes
2021-05-03 07:57:49 -07:00
Kelvin Sherlock
59925b3a08 qlinkgs - implement the len/pos linker opcodes
len [label]

sets label = size of most recently linked/imported file

  pos [label]

sets label = size of current segment.  If no label, resets the position variable to 0.

label is added to the symbol table as an absolute entry.

Testing in merlin 16+, these are absolute entry labels, not gequ labels
Merlin does not include any ds fill in the len/pos, but that decision
seems questionable. these do include a ds fill for both.
2021-05-01 12:37:26 -04:00
Lane Roathe
b6826d0df4
Merge pull request #59 from ksherlock/rel_ds
qlinkgs: Fix rel DS handling
2021-04-27 15:54:33 -07:00
Kelvin Sherlock
b92683ed43 REL DS calculation is based on the total segment size, not the current file.
additionally, it was block moving the size of the DS fill rather than the size of the relocation records.
2021-04-27 16:39:22 -04:00
Lane Roathe
b1867bb1e3
Merge pull request #58 from ksherlock/ovr_off
qlinkgs - OVR OFF was checking for 'F' instead of 'O'.
2021-04-26 08:59:35 -07:00
Lane Roathe
e7852a03a6
Merge pull request #57 from ksherlock/link_badlabel_error2
qlinkgs - fix a couple cosmetic issues with error display
2021-04-26 08:58:50 -07:00
Lane Roathe
1d23d8c76d
Merge pull request #56 from ksherlock/export-gequ
qlinkgs : make GEQU symbols available to the linker
2021-04-26 08:57:51 -07:00
Kelvin Sherlock
c12743b943 OVR OFF was checking for 'F' instead of 'O'. 2021-04-25 22:37:31 -04:00
Kelvin Sherlock
b0fbd610c9 1. some, not all, badlable errors have bit $80 set (fatal indicator I believe). this is missing from the error table so they generate an undefined error.
2. error code isn't reloaded when checking for constraint/not resolved errors (which are handled specially), which would result in a second undefined error for them.
2021-04-24 21:04:58 -04:00
Kelvin Sherlock
f35e76b682 In Merlin, link script GEQU (and KBD) values are available to the assembler and the linker, as absolute values.
This makes them available in the link phase (asm phase was already supported).
2021-04-23 23:38:25 -04:00
Lane Roathe
bdbf17024e
Merge pull request #55 from ksherlock/ext_abs
fix absolute external labels
2021-04-12 20:11:15 -07:00
Kelvin Sherlock
2b9f5856d8 add test files for external abs 2021-04-12 20:53:57 -04:00
Kelvin Sherlock
8216c6f489 linker was relocating absolute entries (ie xxx equ $1234 ; ent xxx).
$20 is the bit in the on-disk symbol table for an absolute entry, linkabsbit (%0000_0100_0000_0000) is the correct bit in memory.
2021-04-11 22:03:55 -04:00
Lane Roathe
c9d2c39b5c
Merge pull request #54 from ksherlock/new-test-cases
add missing test cases for recent qasm iigs fixes.
2020-10-13 13:38:35 -07:00
Kelvin Sherlock
7b8a81d605 add missing test cases for recent qasm iigs fixes. 2020-10-12 18:07:54 -04:00
Lane Roathe
bdbf62fe36
Merge pull request #53 from ksherlock/dw-star
qasm gs - update program counter w/in data operands
2020-10-12 08:46:02 -07:00
Lane Roathe
0fb0dc0cc1
Merge pull request #52 from marketideas/pea_bad_address_mode
qasm gs - allow comma in quoted string during address check
2020-10-12 08:26:43 -07:00
Kelvin Sherlock
4a380871cd ddb - update pcobjptr after each item. 2020-10-11 20:41:36 -04:00
Kelvin Sherlock
bc29319414 allow comma in quoted string during address check
example:

pea ',' or pea #',' previously generated a bad address mode error.

The addmode function expected an X,Y, or S after the , which is how it generated the error.

Changed to skip , search within the quoted string.

test case:

* previously caused an error
	pea #','
	pea ','
	pea #","
	pea ","
	pea ','+','

* still cause and error (as they should):
	pea ',',y
	pea #',',y
* unterminated string:
	pea  '
2020-10-10 22:52:56 -04:00
Lane Roathe
f7e30ea543
Merge pull request #50 from ksherlock/pass-1-errors
qasm iigs: print the line when an error is encountered on first pass
2020-06-08 09:44:50 -07:00
Lane Roathe
79a0748ede
Merge pull request #49 from ksherlock/asm-listing
qasm iigs: adjust listing label placement
2020-06-08 09:44:16 -07:00
Kelvin Sherlock
8c94aa51c3 when an error is encountered in the first pass, print the line for better debugging. Previously, errors only printed the line on the second pass. 2020-06-06 18:03:54 -04:00
Kelvin Sherlock
f6408be2c0 tab to label column instead of using a space. This results in nicer output when line numbers increment in size (9 -> 10, 99 -> 110, etc) 2020-06-06 16:13:05 -04:00
Kelvin Sherlock
0976282d81 update program counter (for eval purposes) after each argument in data statements.
db,dw,da,adr,adrl all allow multiple arguments.  In merlin, the value of * is updated after each argument.  in qasm, the value of * is not updated.

Encountered assembling marinetti.
2020-05-31 16:06:14 -04:00
marketideas
cacc4661ac
Merge pull request #48 from ksherlock/linker-3-char-opcode
qlink iigs - truncate opcodes to 3 characters
2020-05-30 11:09:07 -07:00
Kelvin Sherlock
5ba4d043e5 merlin linker truncates opcodes to 3-characters.
This allows for things like `TYPe` and `LINk`
2020-05-30 13:26:20 -04:00
Lane Roathe
300a0b7bcd
Merge pull request #47 from ksherlock/inappropriate_intersegs
QLink IIgs - inappropriate interseg OMF records
2020-05-26 21:38:18 -07:00
Kelvin Sherlock
ca29613395 external, shifted references were always generating an interseg OMF relocation record even when in the same OMF segment (in which case they would reference segment 0 which is wrong). 2020-05-26 22:48:47 -04:00
Lane Roathe
b5955278c3
Merge pull request #46 from ksherlock/label-15-2
qasm iigs: two more label length stragglers
2020-05-25 23:10:59 -07:00
Lane Roathe
34ec484c67
Merge pull request #45 from ksherlock/macro_quoted_strings
qasm iigs: fix to macro operand parsing for quoted strings
2020-05-25 20:51:56 -07:00
Kelvin Sherlock
f6e5812894 a couple more linker label size adjustments. 2020-05-25 23:08:15 -04:00
Kelvin Sherlock
f5f3846a6d two more label length straglers 2020-05-25 18:32:17 -04:00
Kelvin Sherlock
b4bf2c1611 fix to macro operand parsing for quoted strings
macro operand parsing code was a little too clever and had problems if both ' and " delimiters were present.

new code uses separate loops for handing delimited strings and raw strings, to keep things simpler and more correct.

```
xx	mac
	asc ]1
	eom

	xx '"hello"'
	xx "'hello'"
	xx 'hello'
	xx "hello"
	xx 'abc',00
	xx ff

 ```
before:
```
Assembling macstr.s

Bad operand in line: 5.

Bad operand in line: 6.
                     1 xx           mac
                     2              asc  ]1
                     3              eom
                     4
008000:              5              xx   '"hello"'
008000: 22 68 65 6C  5              asc  '"hello"'

008004: 6C 6F 22
                     5              eom
008007:              6              xx   "'hello'"
008007: A7 E8 E5 EC  6              asc  "'hello'"

00800B: EC EF A7
                     6              eom
00800E:              7              xx   'hello'
00800E: 68 65 6C 6C  7              asc  'hello'
008012: 6F
                     7              eom
008013:              8              xx   "hello"
008013: E8 E5 EC EC  8              asc  "hello"
008017: EF
                     8              eom
008018:              9              xx   'abc',00
008018: 61 62 63 00  9              asc  'abc',00
                     9              eom
00801C:              10             xx   ff
00801C: FF           10             asc  ff
                     10             eom

End of QuickASM assembly. 29 bytes, 2 errors, 22 lines, 1 symbols.

Elapsed time = < 1 second.
```

after:
```
Assembling macstr.s

                     1 xx           mac
                     2              asc  ]1
                     3              eom
                     4
008000:              5              xx   '"hello"'
008000: 22 68 65 6C  5              asc  '"hello"'
008004: 6C 6F 22
                     5              eom
008007:              6              xx   "'hello'"
008007: A7 E8 E5 EC  6              asc  "'hello'"
00800B: EC EF A7
                     6              eom
00800E:              7              xx   'hello'
00800E: 68 65 6C 6C  7              asc  'hello'
008012: 6F
                     7              eom
008013:              8              xx   "hello"
008013: E8 E5 EC EC  8              asc  "hello"
008017: EF
                     8              eom
008018:              9              xx   'abc',00
008018: 61 62 63 00  9              asc  'abc',00
                     9              eom
00801C:              10             xx   ff
00801C: FF           10             asc  ff
                     10             eom

End of QuickASM assembly. 29 bytes, 0 errors, 22 lines, 1 symbols.

Elapsed time = < 1 second.
```
2020-05-25 16:14:13 -04:00
Lane Roathe
e743e2a6c4
Merge pull request #44 from ksherlock/shell_fix_1
QAsm Shell fixes
2020-05-24 21:21:51 -07:00
Kelvin Sherlock
4b3caaf78f Don't try to do message center stuff when there was a message center error. 2020-05-24 22:45:17 -04:00
Kelvin Sherlock
1f241d42c8 infinite loop parsing the command table file
I don't remember the full details because it was a few months ago but there was an infinite loop on statup when parsing the command table.
2020-05-24 22:42:28 -04:00
Lane Roathe
fb12ad70f7
Merge pull request #43 from ksherlock/sym32
Update label/symbol size from 15 to 31.
2020-05-24 16:18:58 -07:00
Lane Roathe
80839b641c
Update src/data/sym.equates.S ds section with proper offset values 2020-05-24 16:18:51 -07:00
Lane Roathe
f8dd0bcc83
Merge pull request #42 from ksherlock/nocrossbank
symbol table needs to be no-cross-bank
2020-05-24 16:11:16 -07:00
Kelvin Sherlock
89b7308c15 Update labels/symbol size from 15 to 31.
Magic number offsets are also replaced with named constants.

Merlin 16+ increased the label size from 12 to 26 at some point and the 15-char limit causes duplicate label errors on some Merlin source code.
2020-05-24 18:37:21 -04:00
Kelvin Sherlock
8f7427d11d symbol table needs to be no-cross-bank since qasm uses mvn to copy entries into it (mvn won't cross banks) 2020-05-24 17:53:33 -04:00
Lane Roathe
13473d448b
Merge pull request #41 from ksherlock/ent-pass-two
(qasm iigs) ent label-list operand
2020-01-16 10:35:33 -08:00
Kelvin Sherlock
275f49e43e ent label-list operand should only execute on the second pass, after all labels are defined. 2020-01-15 21:00:16 -05:00
Lane Roathe
0dcd68a402
Merge pull request #40 from ksherlock/quicklink-xy
(qlink iigs) quick link was pulling x/y in the wrong order
2020-01-14 17:53:18 -08:00
Kelvin Sherlock
9c8abb1bb7 quick link was pulling x/y in the wrong order (when no subtype was specified). 2020-01-14 20:45:48 -05:00
Lane Roathe
938873e8f3
Merge pull request #39 from lroathe/master
Remove broken links in project file, fix run to use relocated test file
2020-01-14 16:50:42 -08:00