cpuinfo: Fix scf check logic
authorAlan Cox <alan@linux.intel.com>
Mon, 3 Sep 2018 20:16:26 +0000 (21:16 +0100)
committerAlan Cox <alan@linux.intel.com>
Mon, 3 Sep 2018 20:16:26 +0000 (21:16 +0100)
Applications/util/cpuinfo.c

index d1867d1..26fe417 100644 (file)
@@ -98,12 +98,11 @@ no_port_idwork:
         bit 3,c
         ld a, #CPU_Z80_BM1
         jr z, set_id
-        ld bc,#0xffff
+        ld bc,#0x00ff
         push bc
-        pop af
-        xor a
-        scf
-        nop
+        pop af         /* Flags is now 0xFF A is 0. Now play with XF and YF */
+        scf            /* Will give us 0 for NEC clones, 28 for Zilog */
+        nop            /* (Turbo R will also show 28) */
         push af
         pop bc
         ld a,c