sehugg / 8bitworkshop

web-based IDE for 8-bit programming and Verilog development
http://8bitworkshop.com/
GNU General Public License v3.0
503 stars 82 forks source link

TypeError: s.startsWith is not a function #56

Open aouwt opened 3 years ago

aouwt commented 3 years ago

Hi! I was trying out this Pi calculator for the Atari 2600 and when I put it into 8bitworkshop (I copied and pasted pi.s and pimacros.m, added include "vcs.h", processor 6502, and .org $F000) and then it threw an error at line 1 (no matter what was actually on the line):

TypeError: s.startsWith is not a function

Most likely, it's because I probably didn't do something correctly (I'm not very experienced with assembly) but upon searching the error on Google and on the GitHub Issues page, I found nothing about it.

Here's what the log said:

exception thrown: TypeError: s.startsWith is not a function,match_fn@https://8bitworkshop.com/v3.7.0/gen/worker/workermain.js:723:20
abort@https://8bitworkshop.com/v3.7.0/src/worker/asmjs/dasm.js:17:3953
Ee@https://8bitworkshop.com/v3.7.0/src/worker/asmjs/dasm.js:10:23222
jb@https://8bitworkshop.com/v3.7.0/src/worker/asmjs/dasm.js:9:14467
Ja@https://8bitworkshop.com/v3.7.0/src/worker/asmjs/dasm.js:9:3469
vc@https://8bitworkshop.com/v3.7.0/src/worker/asmjs/dasm.js:9:68187
Cb@https://8bitworkshop.com/v3.7.0/src/worker/asmjs/dasm.js:9:36692
callMain@https://8bitworkshop.com/v3.7.0/src/worker/asmjs/dasm.js:17:2560
execMain@https://8bitworkshop.com/v3.7.0/gen/worker/workermain.js:416:8
assembleDASM@https://8bitworkshop.com/v3.7.0/gen/worker/workermain.js:744:13
executeBuildSteps@https://8bitworkshop.com/v3.7.0/gen/worker/workermain.js:2701:27
handleMessage@https://8bitworkshop.com/v3.7.0/gen/worker/workermain.js:2781:22
onmessage@https://8bitworkshop.com/v3.7.0/gen/worker/workermain.js:2790:35
EventHandlerNonNull*@https://8bitworkshop.com/v3.7.0/gen/worker/workermain.js:2789:5
@https://8bitworkshop.com/v3.7.0/src/worker/loader.js:4:14
dasm.js:5:56212

exception thrown: TypeError: s.startsWith is not a function,match_fn@https://8bitworkshop.com/v3.7.0/gen/worker/workermain.js:723:20
abort@https://8bitworkshop.com/v3.7.0/src/worker/asmjs/dasm.js:17:3953
Ee@https://8bitworkshop.com/v3.7.0/src/worker/asmjs/dasm.js:10:23222
jb@https://8bitworkshop.com/v3.7.0/src/worker/asmjs/dasm.js:9:14467
Ja@https://8bitworkshop.com/v3.7.0/src/worker/asmjs/dasm.js:9:3469
vc@https://8bitworkshop.com/v3.7.0/src/worker/asmjs/dasm.js:9:68187
Cb@https://8bitworkshop.com/v3.7.0/src/worker/asmjs/dasm.js:9:36692
callMain@https://8bitworkshop.com/v3.7.0/src/worker/asmjs/dasm.js:17:2560
execMain@https://8bitworkshop.com/v3.7.0/gen/worker/workermain.js:416:8
assembleDASM@https://8bitworkshop.com/v3.7.0/gen/worker/workermain.js:744:13
executeBuildSteps@https://8bitworkshop.com/v3.7.0/gen/worker/workermain.js:2701:27
handleMessage@https://8bitworkshop.com/v3.7.0/gen/worker/workermain.js:2781:22
onmessage@https://8bitworkshop.com/v3.7.0/gen/worker/workermain.js:2790:35
EventHandlerNonNull*@https://8bitworkshop.com/v3.7.0/gen/worker/workermain.js:2789:5
@https://8bitworkshop.com/v3.7.0/src/worker/loader.js:4:14
dasm.js:5:56212

EXCEPTION match_fn@https://8bitworkshop.com/v3.7.0/gen/worker/workermain.js:723:20
abort@https://8bitworkshop.com/v3.7.0/src/worker/asmjs/dasm.js:17:3953
Ee@https://8bitworkshop.com/v3.7.0/src/worker/asmjs/dasm.js:10:23222
jb@https://8bitworkshop.com/v3.7.0/src/worker/asmjs/dasm.js:9:14467
Ja@https://8bitworkshop.com/v3.7.0/src/worker/asmjs/dasm.js:9:3469
vc@https://8bitworkshop.com/v3.7.0/src/worker/asmjs/dasm.js:9:68187
Cb@https://8bitworkshop.com/v3.7.0/src/worker/asmjs/dasm.js:9:36692
callMain@https://8bitworkshop.com/v3.7.0/src/worker/asmjs/dasm.js:17:2560
execMain@https://8bitworkshop.com/v3.7.0/gen/worker/workermain.js:416:8
assembleDASM@https://8bitworkshop.com/v3.7.0/gen/worker/workermain.js:744:13
executeBuildSteps@https://8bitworkshop.com/v3.7.0/gen/worker/workermain.js:2701:27
handleMessage@https://8bitworkshop.com/v3.7.0/gen/worker/workermain.js:2781:22
onmessage@https://8bitworkshop.com/v3.7.0/gen/worker/workermain.js:2790:35
EventHandlerNonNull*@https://8bitworkshop.com/v3.7.0/gen/worker/workermain.js:2789:5
@https://8bitworkshop.com/v3.7.0/src/worker/loader.js:4:14
workermain.ts:2743:14

EXCEPTION match_fn@https://8bitworkshop.com/v3.7.0/gen/worker/workermain.js:723:20
abort@https://8bitworkshop.com/v3.7.0/src/worker/asmjs/dasm.js:17:3953
Ee@https://8bitworkshop.com/v3.7.0/src/worker/asmjs/dasm.js:10:23222
jb@https://8bitworkshop.com/v3.7.0/src/worker/asmjs/dasm.js:9:14467
Ja@https://8bitworkshop.com/v3.7.0/src/worker/asmjs/dasm.js:9:3469
vc@https://8bitworkshop.com/v3.7.0/src/worker/asmjs/dasm.js:9:68187
Cb@https://8bitworkshop.com/v3.7.0/src/worker/asmjs/dasm.js:9:36692
callMain@https://8bitworkshop.com/v3.7.0/src/worker/asmjs/dasm.js:17:2560
execMain@https://8bitworkshop.com/v3.7.0/gen/worker/workermain.js:416:8
assembleDASM@https://8bitworkshop.com/v3.7.0/gen/worker/workermain.js:744:13
executeBuildSteps@https://8bitworkshop.com/v3.7.0/gen/worker/workermain.js:2701:27
handleMessage@https://8bitworkshop.com/v3.7.0/gen/worker/workermain.js:2781:22
onmessage@https://8bitworkshop.com/v3.7.0/gen/worker/workermain.js:2790:35
EventHandlerNonNull*@https://8bitworkshop.com/v3.7.0/gen/worker/workermain.js:2789:5
@https://8bitworkshop.com/v3.7.0/src/worker/loader.js:4:14
workermain.ts:2743:14

Sorry in advance if this is a problem on my end!

sehugg commented 3 years ago

Are you using MSIE?

aouwt commented 3 years ago

No, I'm using Firefox (84.0) on Ubuntu.

sehugg commented 3 years ago

I can't reproduce your stack trace, seems to be some sort of compilation problem with the DASM assembler. In any case, the Atari 2600/VCS target doesn't support the ca65 assembler dialect, just the DASM dialect. So you'd have to port this code to DASM, which might be tricky given all the macros.