Yahoo Groups archive

AVR-Chat

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

Message

AVR Assembler idea

2004-01-31 by Dave VanHorn

I have a suggestion, to make something very tedious, and yet very 
important, much less of a problem..

Frequently, you end up with a register (or ram location) filled with bit 
flags doing inter-task signalling.
So, you end up with something like this in your comments:

;
;Burn Flags (register) Definitions
;00XX XXXX Unused
;XX1X XXXX Head loaded
;XXX1 XXXX Head latched
;XXXX 0XXX Unused
;0000 01XX 1= Four-Burn, 0 = two-burn
;XXXX XXYY Burn state 0-3 or 0-1
;
.equ	Head_Loaded	= 5	;
.equ	Head_Latched	= 4 	;		
.equ	Four_Burn	= 2	;
;
;Step Flags (register) Definitions:	
;0XXX XXXX Disabled
;X1XX XXXX 1 = Burn in progress
;XX0X XXXX Unused
;XXX0 XXXX 1 = too cold
;XXXX 1XXX Step in progress
;XXXX X1XX Step enabled (by Latch)
;XXXX XX00 Unused
;
.equ	Step_Disabled		= 7	;Head/Paper sensors
.equ	Step_BIP		= 6 	;T2 running
.equ	Step_Cold		= 4	;Temperature
.equ	Step_In_Progress	= 3	;Start_Step
.equ	Step_Enabled		= 2	;By Latch

This, by itself, isn't a problem.
However, by their very nature, these flags are used anywhere and everywhere.
So you end up having a bunch of copies of the definitions everywhere.
Now the problem begins.

What happens when I need a new flag, or need to change the definition of a 
flag?
I have to go hunt down every copy of this comment block, everywhere in the 
code (multiple files) and update them.
This is very tedious, and very error prone.

What I would like to see, is "hover help" where I can select register/ram 
bytes to include in this help.
What happens is that I define a master comment block somewhere, and assign 
that to a variable name.
Now any time that I hover over this variable name, the comment field pops up.
If I right click on an active variable, then I can edit the master comment 
field, without having to go open the file over there.

This is an html-like kind of thing and requires a little thought to 
implement, but I think it will make everyone's lives easier.

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.