Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/22/01 06:35
Read: times


 
#11808 - RE: an efficient parity generation schem
Hi Steve,

yes, it is.
C is wonderful self documenting:

The function name "parity" describe exactly, what it should do.
The input and output parameters are complete described by its type definitions: "char" and "bit".
So no need for any additional comments.
Only complex functions should be commented moreover.

Following the generated code. But its not wise, to build a function for such small code (waste of LCALL and RET). Better, use a macro:

#define parity( x ) ( ACC = x, P )



Peter



; FUNCTION _parity (BEGIN)
;---- Variable 'b' assigned to Register 'R7' ----
; SOURCE LINE # 4
; SOURCE LINE # 5
; SOURCE LINE # 6
0000 EF MOV A,R7
; SOURCE LINE # 7
0001 A2D0 MOV C,P
; SOURCE LINE # 8
0003 ?C0001:
0003 22 RET
; FUNCTION _parity (END)


List of 13 messages in thread
TopicAuthorDate
an efficient parity generation scheme ?            01/01/70 00:00      
RE: an efficient parity generation scheme ?            01/01/70 00:00      
RE: an efficient parity generation scheme ?            01/01/70 00:00      
RE: an efficient parity generation schem            01/01/70 00:00      
RE: an efficient parity generation schem            01/01/70 00:00      
RE: an efficient parity generation schem            01/01/70 00:00      
RE: an efficient parity generation schem            01/01/70 00:00      
RE: an efficient parity generation schem            01/01/70 00:00      
RE: an efficient parity generation schem            01/01/70 00:00      
RE: an efficient parity generation schem            01/01/70 00:00      
RE: an efficient parity generation schem            01/01/70 00:00      
Re: mysterious bit named "P"            01/01/70 00:00      
RE: an efficient parity generation scheme ?            01/01/70 00:00      

Back to Subject List