Truly shocking code (z80 asm)

A General Discussion forum for TI calculators

Moderator: MaxCoderz Staff

User avatar
Dwedit
Maxcoderz Staff
Posts: 579
Joined: Wed 15 Dec, 2004 6:06 am
Location: Chicago!
Contact:

Post by Dwedit »

Technically, the NEG instruction isn't needed either, since you can just compliment and increment, but I think those instructions may possibly affect the flags differently.
You know your hexadecimal output routine is broken when it displays the character 'G'.
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

It affects the S, P/V and Z flags differently, and imo NEG should have been a 1byte instruction to be useful, or if it has to be 2 bytes then an operant is useful. As it stands now, NEG is even less useful since it trashes the carry flag (it almost always sets it).
User avatar
calc84maniac
Regular Member
Posts: 112
Joined: Wed 18 Oct, 2006 7:34 pm
Location: The ex-planet Pluto
Contact:

Post by calc84maniac »

Well, cpl resets the carry flag, so it's an even tradeoff. :)
~calc84maniac has spoken.

Projects:
F-Zero 83+
Project M (Super Mario for 83+)
User avatar
DigiTan
Calc Master
Posts: 1069
Joined: Fri 04 Mar, 2005 12:52 am
Location: NW Wisconsin
Contact:

Post by DigiTan »

King Harold wrote:I never said one should use XOR A, it zero's A!.
Who's saying you said it? :?
My diet consists of nails, code-stealers, and HP fans.
Projects:

Robot War [TI-82, TI Flash App]
Sonic the Hedgehog [Multiplatform]
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

No one, but I thought you talked about XORing A?
It looked to me like you were saying I was defending XOR A.. though I could be mistaken. XOR A has it's uses, as do most instructions (the z80 is a RISC processor after all..) and can be used to reset the carry, but often you might want to preserve the contents of A..
(why am I talking about that?)

I'll go for that even tradeoff (but with NEG you have 1 in 255 change that the carry won't be set, when A was zero..)
Post Reply