Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: [AVR-Chat] Negarive numbers in .db statements

2012-03-21 by STEVEN HOLDER

David,
 
If you need to change the sign, you could cast the signbit as a signed char and xor with 0x80, which is the sign bit, would that do the trick as not quiet sure what you are trying to do.
 
Regards
 


________________________________
From: David V <microbrix@gmail.com>
To: AVR-Chat@yahoogroups.com 
Sent: Wednesday, 21 March 2012, 5:56
Subject: [AVR-Chat] Negarive numbers in .db statements


  

All this time working with the AVR, and I've never had to do this...

I need a way to change the sign on a term in a .db statement.

Something like this: (which does not work..)

.equ SignBit = -1;

.db Thing,(Thing + (3*SignBit)), (Thing - (3*SignBit)), Thing
.and so on..

Otherwise, I'm going to be forced to do an annoyingly large amount of hand editing data files. :P

Any pointers?




[Non-text portions of this message have been removed]

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.