]> gitweb.factorcode.org Git - factor.git/commitdiff
cpu.8080: Throw an error not a string.
authorDoug Coleman <doug.coleman@gmail.com>
Fri, 29 Mar 2013 16:46:34 +0000 (09:46 -0700)
committerDoug Coleman <doug.coleman@gmail.com>
Fri, 29 Mar 2013 16:51:26 +0000 (09:51 -0700)
extra/cpu/8080/emulator/emulator.factor

index 4e166a646dd8030ec829b96b13d6567de9a53c8e..f79a70c50f19ae5bb11f0ddc157f25c2d68a6a65 100644 (file)
@@ -499,13 +499,15 @@ SYMBOL: rom-root
   [ over 1 + swap pc<< ] keep
   read-byte ;
 
+ERROR: undefined-8080-opcode n ;
+
 : get-cycles ( n -- opcode )
   #! Returns the cycles for the given instruction value.
   #! If the opcode is not defined throw an error.
   dup instruction-cycles nth [ 
     nip  
   ] [
-    [ "Undefined 8080 opcode: " % number>string % ] "" make throw
+    undefined-8080-opcode
   ] if* ;
 
 : process-interrupts ( cpu -- )