View unanswered posts | View active topics It is currently Thu Apr 18, 2024 6:59 pm



Reply to topic  [ 18 posts ]  Go to page Previous  1, 2
 DIP-8: 8-bit TTL computer 
Author Message
User avatar

Joined: Sat Nov 19, 2022 7:42 pm
Posts: 10
Location: Europe/London
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.

_________________
-Kyle
dip16.com


Thu Jan 19, 2023 12:50 pm
Profile

Joined: Wed Nov 20, 2019 12:56 pm
Posts: 92
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?


Thu Jan 19, 2023 1:05 pm
Profile

Joined: Mon Oct 07, 2019 2:41 am
Posts: 591
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.


Thu Jan 19, 2023 4:14 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 18 posts ]  Go to page Previous  1, 2

Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software