<lisbeths>
what I dont get is how you can get - without negate
<lisbeths>
I tend to prefer - becuase : negate 0 swap -; : + negate - ;
<lisbeths>
it takes more machine instructions but results in a smaller coreset of words
Zarutian_HTC has quit [Read error: Connection reset by peer]
Zarutian_HTC has joined #forth
boru` has joined #forth
boru has quit [Disconnected by services]
boru` is now known as boru
jedb has quit [Remote host closed the connection]
jedb has joined #forth
<crc>
:- [ #-1 + ] times ;
<crc>
Not efficient, but would work
<crc>
The question is why would you want this? I can see the rationale for a forth in a boot sector where space is crucial, or for a simple chip design, but it's not something that's needed in most cases I've encountered
<lisbeths>
I dunno just for fun I guess.
<proteusguy>
MrMobius, I don't recall using any of the extensions. This was with Microsoft's Macro Assembler so it didn't know it wasn't running on an Intel CPU.
WickedShell has quit [Remote host closed the connection]
<proteusguy>
never heard of it
jsoft has quit [Ping timeout: 256 seconds]
<lisbeths>
I have decided when I port my forth from c to assembler I am going to use the assembler for the lunar lander
<lisbeths>
I will also permit myself the same amount of ram roms and storage
jsoft has joined #forth
proteus-guy has joined #forth
proteusguy has quit [Ping timeout: 260 seconds]
proteusguy has joined #forth
<siraben>
proteusguy: seems to be quite popular among ASM developers, anyhow
jsoft has quit [Quit: Leaving]
jsoft has joined #forth
<boru>
Popular is a bit of a stretch; most programmers targetting intel or amd use nasm or gas. fasm is more popular with university students, ime.
<boru>
(gas with intel syntax, naturally)
<boru>
And for other relatively modern ISAs, I, myself, and most of the programmers I know use gas or equivalent assemblers from sdcc.
<lisbeths>
I think you guys often forget that most forth programmers tend to talk to embedded programmers and there is a whole world of bloated high level code which you might not interface with very much.
<boru>
Thank goodness for that.
<lisbeths>
I have heard forth programmers say things which are very true for embdedded but dont apply at all for other kinds of programming.
<boru>
That is tautological.
<MrMobius>
lisbeths, that is why i said you can synthesize - with + and XOR which is what you use to negate
<MrMobius>
0x3 XOR 0xFF = 0xFC = -3 for 8 bit number for example
<MrMobius>
5 - 3 = 5 + (3 XOR 0xFF) = 5 + 0xFC = 0x102 ie 2 with carry set meaning positive result
<lisbeths>
thanks I will try to remember that trick. What do you call this kind of math where logic gates are used for more than just truth tables?
<siraben>
lisbeths: Forth solves different kinds of problems. It makes sense to do everything by yourself on embedded but or something like a web server that has to integrate with graph databases, yeah I'd go with level code
<siraben>
s/or/on
<MrMobius>
actually 5 + 0xFC = 101 so make sure to set carry bit before addding
<MrMobius>
lisbeths, dunno if theres a name for it. the CPU is using logic gates internally for all this. other processors do the XOR 0xFF in hardware. this one just makes you do it yourself
<MrMobius>
same on the 8x305 iirc
f-a has joined #forth
Zarutian_HTC has quit [Remote host closed the connection]
f-a has quit [Quit: bb]
<cmtptr>
lisbeths, it's called two's compliment arithmetic
<lisbeths>
one thing which I have still failed to understand is why you need a second stack
<lisbeths>
I mean I guess I have two stacks, one being the call stack
f-a has joined #forth
<MrMobius>
lisbeths, if you put your return address on the same stack as your data, you would have to take that into account when you pass arguments on the stack
<MrMobius>
: sum + ; 5 6 sum
<MrMobius>
if you put the return address on the same stack with the 5 and 6 and + adds the first two items, it will add the return address to 6 instead of 5 to 6 unless you design the word to skip over the first thing (the return address) it finds on the stack
<MrMobius>
but then you would need two versions: one + that skips over the return address and one that doesn't since just 5 6 + should NOT skip the first thing it finds
Zarutian_HTC has joined #forth
dave0 has quit [Quit: dave's not here]
f-a has quit [Ping timeout: 265 seconds]
f-a has joined #forth
Zarutian_HTC has quit [Ping timeout: 256 seconds]
Zarutian_HTC has joined #forth
<crc>
siraben: re: flat assembler; I used it extensively in the past, when I was doing x86 assembly. (I was the maintainer/porter of the version using libc for i/o on various Unix systems at the time)