<tp>
I use py.sphinx which is very easy and produces all the usual formats as output
<tp>
but good doc is a art and I don't have it
<tp>
Im a tech
<tp>
Mecrisp-Stellaris comes with a few text files, better than nothing but fairly minimal, just hand formatted text which is pretty ordinary
<tabemann>
my documentation is essentially vary bare comments - lol
<tabemann>
a lot of my assembly doesn't even have stack comments
<tp>
for shame!
<tp>
;-)
<tabemann>
but it all goes by very consistent conventions
<tp>
all programmers could say that tho
<tp>
a programmer has to be consistent
<tabemann>
like 0 6 0 lsl-imm, means take register r6, apply an lsl of #0 to it, and put the reseult in register r0
<tabemann>
*result
<tabemann>
or more like compile the code that does this
<tp>
this is why programmers should never write doc "good code is self documenting" a comment by a really smart programmer jerk I once knew
<tp>
"0 6 0 lsl-imm" ?
<tp>
thats not assembly tho ?
<tp>
is that your Forth to assembly generator ?
<tabemann>
that compiles an lsls instruction
<tabemann>
-imm means that the logical shift left is by an immediate amount
<tabemann>
, means that it is compiling, not executing
<tp>
matthias uses pretty much the same syntax as actual assembly, but of course couldnt resist changing it (or couldnt be bothered making it the same) so I cant feed it into gas without preprocessing
<tp>
hmm, ok, all that was wrong
<tp>
please disregard
<tabemann>
?
<tp>
Mecrisp-Stellaris generates machine code
<tp>
it doesnt generate assembly
<tp>
there is no assembler contained in Mecrisp-Stellaris
<tp>
there is a non core dissasembler Word
<tp>
and it's this one that doesnt produce 100% compatible assembly
<tp>
as an mcu has no idea what assembly source means
<tp>
a mcu only understands machine code
<tabemann>
zeptoforth also generates machine code and has no assembler, but it has a minimalistic mini-assembler in it so the compiler can compile instructions
<tabemann>
with instructions being indicated by words like lsl-imm, cmp-imm, bx, blx, and so on
<tp>
ah!
<tp>
that is what I'd do if I ever tried to write my own forth, but doesnt it make the kernel much larger ?
<tabemann>
in many cases I use these words where if I reall felt like being compact I could just hardcode instructions (which I do do in a few places where I didn't feel I needed the flexibility)
<tabemann>
and it does make the kernel bigger
<tp>
but far easier to use
<tabemann>
probably why zeptoforth is bigger than mecrisp-stellaris
<tp>
matthias thinks in assembler so he has a major advantage
<tabemann>
I've gotten thumb-2 assembly down pretty well - whereas I know very few thumb-2 opcodes
<tp>
yeah, it's a pain, Ive written tons of machine code by hand
<tp>
and that was for the 8085 which is pretty horrible
<tp>
(in comparison to the 6800 machine code)
<tp>
tabemann, do you use a 'utility assembly to machine code generator" at all
<tp>
ie something you can enter in a isolated assembly code and get the machine code to plug into zeptoforth ?
<tabemann>
no I haven't
<tp>
As of yesterday, 18th March 2020, the Australian and NSW Government has banned all non-essential indoor gatherings of 100 people or more.
<tp>
lol, way too little way too late I think
<tp>
I was doing the reverse to test Forth words on Mecrisp-Stellaris
<tp>
Ive made up a word that pulls out the machine code on a word by word basis and dumps it as ihex into the terminal
<tabemann>
here everything is shutting down or has shut down
<tp>
i was then putting the de-ihexed data into a binary, addeing the preamble needed and running it in Cutter2
<tabemann>
surprisingly my work is still open... but half the people didn't show
<tabemann>
I had very poor luck with getting cutter2 to work
<tp>
I went to the supermarket yesterday and was walking to a checkout when a old unwell guy came in coughing everywhere
<tp>
no mask, no attempt to even block his cough
<tabemann>
when I first ran my code on my DISCOVERY board it ran far better than it ever did on cutter2
<tp>
in this town it takes a appointment then a week to even see a doctor
<tp>
yeah, that's the advantage of using real hardware
<tp>
I never use simulators except with machine code
<tabemann>
there were glaring mistakes in the emulation of Thumb-2 with cutter2
<tabemann>
I mean mistakes
<tabemann>
not just minor incompatibilities
<tabemann>
like
<tabemann>
for instance
<tp>
and GDB has made using a simulator fairly pointless if your mcu has jtag or swd
<tabemann>
instruction vectors on Thumb-2 must point to odd addresses
<tabemann>
*exception
<tp>
youre saying that 'mistakes were made' ?
<tabemann>
likewise, addresses fed into bx and blx must be at odd addresses
<tp>
did you see my comment here regarding using radare2 from the cli ?
<tabemann>
because the lower bit of Thumb-2 code addresses indicates that the code is Thumb
<tp>
it's a world away from cutter as regards automating and configuration
<tabemann>
and this is required on Cortex-M4, because Cortex-M4 only executes Thumb-2 code
<tp>
yeah, thats well known I think
<tp>
it's the same with thumb1 isnt it ?
<tabemann>
yep
<tabemann>
so basically I had to make changes to my code to get it to run at all under Cutter2
<tabemann>
but that wasn't enough
<tabemann>
because Thumb2 instructions weren't being properly decoded in places
<tabemann>
for reasons that were beyond me
<tabemann>
I just had to give up with Cutter2
<tp>
I was running my extracted words on cutter no problem
<tp>
but the address was always wrong
<tp>
I was only interested in seeing that the word behaved as expected, ie jumping to loops etc
<tp>
cutter is just a gui on top of radare2 which is a lot like gdb
<tp>
be nice to have a word that allows single stepping thru a words machine code for debugging ON the target ...
<tabemann>
you can do that with gdb
<tabemann>
unfortunately gdb sucks at debugging forth code
<tabemann>
but it's still very handy for debugging assembly code
<tp>
I was only running a binary
<tp>
can gdb run a binary without source on the target ?
<tp>
I cant remember
<tabemann>
gdb doesn't like it when there's not an .elf file
<tp>
yeah
<tp>
wheras ra2 (radare2) is fine with that
<tabemann>
okay, I'm gonna go have dinner in a sec, so I'll bbl
<tp>
I'm still undecided on my previous method tho
<tp>
no problemo
jsoft has quit [Ping timeout: 250 seconds]
<tabemann>
back
<tabemann>
okay, updated my scheduler so that it uses systick
<tp>
nice!
<tabemann>
the scheduler is dependent on the multitasker though if one wants to be able to use the prompt simultaneously
<tp>
I was confused for a while with mine, initially Id run task1 every 100ms, that was fine
<tp>
then when I ran the 2nd task at 110 ms, it would slowly increase so all I had was a lovely slowly changing duty cycle with the same 100ms timing!
<tp>
eventually I had to sync task2 to task1 to keep the same 10ms seperation
boru` has joined #forth
boru has quit [Disconnected by services]
boru` is now known as boru
<tp>
I only need one variable per task tho, so it's very light
<tp>
anyway, bbl
tp has quit [Remote host closed the connection]
tp has joined #forth
<tabemann>
wb
* tabemann
had his forth code scattered in a bunch of files, so he made one meant for e4thcom to load everything (using the #include directive) and then set a cornerstone to enable deleting everything added afterwards
<tabemann>
it was getting to be a pain to manually load each of the files separately