cpu.8080: Throw an error not a string.

db4
Doug Coleman 2013-03-29 09:46:34 -07:00
parent 58ee52e63b
commit 36b11c2ed1
1 changed files with 3 additions and 1 deletions

View 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 -- )