From: Hugo Villeneuve Date: Sun, 17 Nov 2013 21:19:52 +0000 (-0500) Subject: Simplify carry bit set/clr functions X-Git-Tag: v2.0.0~87 X-Git-Url: http://gitweb.hugovil.com/?a=commitdiff_plain;h=eff770859b67224a711339b0fa61033d977d03b6;p=emu8051.git Simplify carry bit set/clr functions --- 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 */