From eff770859b67224a711339b0fa61033d977d03b6 Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Sun, 17 Nov 2013 16:19:52 -0500 Subject: [PATCH] Simplify carry bit set/clr functions --- src/psw.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/psw.c b/src/psw.c index bf75854..d2b9117 100644 --- a/src/psw.c +++ b/src/psw.c @@ -38,21 +38,13 @@ psw_write_cy(int cy) void psw_set_cy(void) { - u_int8_t psw = memory_read8(INT_MEM_ID, _PSW_); - - psw |= PSW_FLAG_CY; - - memory_write8(INT_MEM_ID, _PSW_, psw); /* Save updated value */ + psw_write_cy(1); } void psw_clr_cy(void) { - u_int8_t psw = memory_read8(INT_MEM_ID, _PSW_); - - psw &= ~PSW_FLAG_CY; - - memory_write8(INT_MEM_ID, _PSW_, psw); /* Save updated value */ + psw_write_cy(0); } /* Returns 0 or 1 */ -- 2.20.1