mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2024-11-28 08:50:22 +00:00
20 lines
257 B
C
20 lines
257 B
C
|
|
#ifndef _BCD_H
|
|
#define _BCD_H
|
|
|
|
#define BCD_ADD(a,b) { \
|
|
int _temp = (b); \
|
|
asm("sed"); \
|
|
(a) += _temp; \
|
|
asm("cld"); \
|
|
}
|
|
|
|
#define BCD_SUB(a,b) { \
|
|
int _temp = (b); \
|
|
asm("sed"); \
|
|
(a) -= _temp; \
|
|
asm("cld"); \
|
|
}
|
|
|
|
#endif
|