AnyCPU
http://anycpu.org/forum/

DIP-8: 8-bit TTL computer
http://anycpu.org/forum/viewtopic.php?f=23&t=978
Page 2 of 2

Author:  dip16 [ Thu Jan 19, 2023 12:50 pm ]
Post subject:  Re: DIP-8: 8-bit TTL computer

Yes, I agree - and I forgot that in C, "char" on its own can be signed or unsigned. If I pass -unsigned-char to vbcc, then char is unsigned by default, as it should be, and my string code isn't trying to sign-extend all the time.

Author:  robinsonb5 [ Thu Jan 19, 2023 1:05 pm ]
Post subject:  Re: DIP-8: 8-bit TTL computer

dip16 wrote:
(As well as making comparisons signed, I realised that "sig" could more generally act as a "signal" to modify the behaviour of other instructions - but I've not found another use for it yet.)


One thing I used my "sgn" modifier for is making my right-shift instruction copy the msb instead of shifting in zeroes - avoiding the need for both "lsr" and "asr" instructions - maybe something worth applying to your "ror" instruction?

Also the sig modifier might be useful for "sub" as well as "cmp" - assuming sub modifies the flags?

Author:  oldben [ Thu Jan 19, 2023 4:14 pm ]
Post subject:  Re: DIP-8: 8-bit TTL computer

robinsonb5 wrote:
dip16 wrote:
(As well as making comparisons signed, I realised that "sig" could more generally act as a "signal" to modify the behaviour of other instructions - but I've not found another use for it yet.)


One thing I used my "sgn" modifier for is making my right-shift instruction copy the msb instead of shifting in zeroes - avoiding the need for both "lsr" and "asr" instructions - maybe something worth applying to your "ror" instruction?

Also the sig modifier might be useful for "sub" as well as "cmp" - assuming sub modifies the flags?


I still use 1960's computing ideas, no flags just Link/Carry bit. Branches test a register for a + - or zero.
I have no CMP instruction, but have adx,sbx ( add index , subtract index ) that does not affect the carry bit.
I my case adding a real flag register, and a CMP is more pain than it is worth.

Page 2 of 2 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/