I previously asked about running the IDE on Linux, but this time I'm just interested in the Assembler...
I've struggled with getting the IDE working on Linux, attempting both Wine and a Virtual Machine. I'd no joy so I had to resort to using an old laptop which I still had a windows partition on, so I can dual boot it into Windows. Not the best solution but better then going and buying a new computer with Windows 10 on it. Given the number of computers I already have, another one for a single function is hard to justify.
So I then hit on a thought... A portion of the IDE's functionality is taking a source text file and running an assembler on it to generate a binary hex file. That's the only bit, of the IDE, that I'm really interested in. The rest of the IDE's functionality is for organising projects, communicating with the target dev board, writing the resulting binary hex file to the EEPROM, of the Dev board. I'm not too bothered about that part at all. So I thought that given the limited functionality of the Assembler, mainly parsing text files it might easily be compiled for a Linux target architecture. I don't want the source code.
Actually given the limited scope of the FV-1's instruction set, (perhaps 30 instructions), I wonder would it be possible to write a quick assembler in Python. Hmmm, there might be better options rather then Python but you know what I mean.
Linux just the Assembler?
Moderator: frank
Re: Linux just the Assembler?
Thanks a million potul, that's exactly what I was looking for and undoubtedly better then what I would have implemented Thanks again that will make my Linux/Spin life easier
Re: Linux just the Assembler?
I hope user 'potul' is checking in now and again.
I've been working on Hardware, so only now getting back to testing the python assembler. It installed without issue and kinda works, but doesn't like my assembley code. Specifically it doesn't like my first line:
radx ADCL, 1.0
which results in:
parse error: Expected EQU or MEM but saw LABEL ADCL on line 20
that's on line 20 in the above error because I went through the documentation on github and looked at the examples. I copied a "useless" example program from github page for the assembler and pasted that into my test file which results in a longer source file. However the label which is causing the problem "ADCL" occurs earlier in the file, (the 3rd line), and is not causing an issue, so I can't understand why it's a problem with my code later in the file.
Any insight would be gratefully received.
I've been working on Hardware, so only now getting back to testing the python assembler. It installed without issue and kinda works, but doesn't like my assembley code. Specifically it doesn't like my first line:
radx ADCL, 1.0
which results in:
parse error: Expected EQU or MEM but saw LABEL ADCL on line 20
that's on line 20 in the above error because I went through the documentation on github and looked at the examples. I copied a "useless" example program from github page for the assembler and pasted that into my test file which results in a longer source file. However the label which is causing the problem "ADCL" occurs earlier in the file, (the 3rd line), and is not causing an issue, so I can't understand why it's a problem with my code later in the file.
Any insight would be gratefully received.
Code: Select all
; A complete, but useless FV-1 assembly program
MEM delay int(32767*3/5) ; ~0.6 sec delay
EQU input ADCL ; use ADCL for input
EQU output DACL ; use DACL for output
EQU vol REG0 ; use REG0 for volume
start: skp RUN,main ; skip to main after first sample
ldax POT0 ; read from POT0
wrax vol,0.0 ; write volume to register
main: ldax input ; read from input
mulx vol ; scale by volume
wra delay,0.0 ; write to delay
rda delay^,0.5 ; read from delay midpoint
rda delay#,0.5 ; read from delay end
wrax output,0.0 ; write to output
clr ; clear ACC
wrax DACL,0.0 ; Write to DACL
;; My code
radx ADCL, 1.0 ;; parse error: Expected EQU or MEM but saw LABEL ADCL on line 20
wrax DACL, 0
; radx ADCR, 1.0
; wrax DACR, 0
Re: Linux just the Assembler?
You have a typo, It is RDAX not RADX so the assembler thinks it is a label
Frank Thomson
Experimental Noize
Experimental Noize
Re: Linux just the Assembler?
How embarrassing, totally misread what the problem was.
Thanks a million for taking the time to point that out Frank.
Thanks a million for taking the time to point that out Frank.