1 /*
2  * sys-emu - A system emulator for tutorials
3  * Copyright (C) 2018 - 2019 osdevelopment-info
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Affero General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Affero General Public License for more details.
14  *
15  * You should have received a copy of the GNU Affero General Public License
16  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
17  */
18 package info.osdevelopment.sysemu.processor.x86.i86
19 
20 import info.osdevelopment.sysemu.processor.{ProcessorDescriptor, Register}
21 import info.osdevelopment.sysemu.processor.x86.ProcessorX86
22 import scala.collection.mutable
23 import scala.util.{Failure, Success, Try}
24 
25 /**
26   * A concrete 8086 processor.
27   * @param descriptor the descriptor of the processor.
28   */
29 class Processor8086(override val descriptor: ProcessorDescriptor) extends ProcessorX86 (descriptor) {
30 
31   /**
32     * Thr registers of the 8086 processor.
33     */
34   private val _registers = mutable.Map[String, Int](
35     "AX" -> 0,
36     "BX" -> 0,
37     "CX" -> 0,
38     "DX" -> 0,
39     "DI" -> 0,
40     "SI" -> 0,
41     "BP" -> 0,
42     "SP" -> 0,
43     "FLAGS" -> 0,
44     "IP" -> 0,
45     "CS" -> 0xffff,
46     "DS" -> 0,
47     "ES" -> 0,
48     "SS" -> 0
49   )
50 
51   /**
52     * All registers of all cores when the cores are stopped.
53     *
54     * The result is Success if the cores can return the registers. When Failure is returned then the cores
55     * cannot return the registers at the moment, e.g. because any is running at the moment.
56     *
57     * The key of the map is the register name.
58     *
59     * @return A Try containing a Map with the core as key and a Map with the register name as key and the register as
60     *         value.
61     */
62   override def registers: Try[Map[Int, Map[String, Register]]] = {
63     Success(Map(0 -> internalRegisters))
64   }
65 
66   /**
67     * All registers of a core when the core is stopped.
68     *
69     * The result is Success if the core can return the registers. When Failure is returned then the core
70     * cannot return the registers at the moment, e.g. because it is running at the moment.
71     *
72     * The key of the map is the register name.
73     *
74     * @param core the core for which the registers should be queried. This parameter is ignored by this processor.
75     * @return A Try containing a Map with the register name as key and the register as value.
76     */
77   override def registers(core: Int): Try[Map[String, Register]] = {
78     Success(internalRegisters)
79   }
80 
81   /**
82     * Maps the internal registers to a register Map structure.
83     *
84     * @return a Map containing the register name as key and the register as value.
85     */
86   private def internalRegisters: Map[String, Register] = {
87     _registers.toMap.transform((name, content) => new Register(0, name, content, 16))
88   }
89 
90   /**
91     * Return the register with the given name of the given core, e.g. "AX".
92     *
93     * @param core the core for which the register should be returned. This parameter is ignored by this processor.
94     * @param name the name of the register to return
95     * @return the register named by name. Failure if the register does not exist or cannot be returned.
96     */
97   override def register(core: Int, name: String): Try[Register] = {
98     name match {
99       // first check for the 8bit-aliases
100       case "AH" | "AL" | "BH" | "BL" | "CH" | "CL" | "DH" | "DL" =>
101         get8BitRegister(name)
102       case _ =>
103         if (_registers.contains(name)) {
104           Success(new Register(0, name, BigInt(_registers(name).toShort), 16))
105         } else {
106           Failure(new IllegalArgumentException("The register " + name + " is not known by this processor."))
107         }
108     }
109   }
110 
111   /**
112     * Returns the content of an 8 bit register (AH, AL, BH, BL, CH, CL, DH or DL). This registers are part of the 16 bit
113     * registers AX, BX, CX or DX.
114     *
115     * @param name the 8 bit name of a register.
116     * @return the register addressed by name.
117     */
118   private def get8BitRegister(name: String): Try[Register] = {
119     val _16bitName = name.substring(0, 1) + "X"
120     name.charAt(1) match {
121       case 'H' =>
122         Success(new Register(0, name, BigInt(((_registers(_16bitName) >> 8) & 0xff).toShort), 8))
123       case 'L' =>
124         Success(new Register(0, name, BigInt((_registers(_16bitName) & 0xff).toShort), 8))
125       case _ =>
126         Failure(new IllegalArgumentException("The register " + name + " is not known by this processor."))
127     }
128   }
129 
130   /**
131     * Sets the register of the processor to the given content.
132     *
133     * The returned register (in case of Success(_)) contains the new register content. Failure is returned in case that
134     *  - the processor is running and therefore the register cannot be set
135     *  - the register is unknown to the processor
136     *  - the value of the register is invalid
137     *
138     * @param register the register to set
139     * @return Success with the new register value or Failure if the register cannot be set.
140     */
141   override def register(register: Register): Try[Register] = {
142     register.name match {
143       case "AH" | "AL" | "BH" | "BL" | "CH" | "CL" | "DH" | "DL" =>
144         set8BitRegister(register)
145       case _ =>
146         if (_registers.contains(register.name)) {
147           set16BitRegister(register)
148         } else {
149           Failure(new IllegalArgumentException("The register " + name + " is not known by the processor."))
150         }
151     }
152   }
153 
154   /**
155     * Sets the contents of the 8 bit register (AH, AL, BH, BL, CH, CL, DH or DL) to the value given in register. This
156     * registers are part of the 8 bit registers AX, BX, CX or DX.
157     *
158     * @param register the register to set.
159     * @return the new register.
160     */
161   private def set8BitRegister(register: Register): Try[Register] = {
162     if (register.content <= 255 & register.content >= -128) {
163       val _16bit = register.name.substring(0, 1) + "X"
164       register.name.charAt(1) match {
165         case 'H' =>
166           _registers(_16bit) = (_registers(_16bit) & 0x00ff) | ((register.content & 0xff) << 8).toShort
167         case 'L' =>
168           _registers(_16bit) = (_registers(_16bit) & 0xff00) | (register.content & 0xff).toShort
169       }
170       this.register(0, register.name)
171     } else {
172       Failure(new IllegalArgumentException("The register " + name + " is not known by this processor."))
173     }
174   }
175 
176   /**
177     * Sets the contents of the 16 bit register to the value given in register.
178     *
179     * @param register the register with the new content.
180     * @return the new register.
181     */
182   private def set16BitRegister(register: Register): Try[Register] = {
183     if (register.content <= 65535 & register.content >= -32768) {
184       _registers(register.name) = (register.content & 0xffff).toShort
185       this.register(0, register.name)
186     } else {
187       Failure(new IllegalArgumentException("The register " + name + " is not known by this processor."))
188     }
189   }
190 
191   /**
192     * Calculates the start address for a ROM/BIOS based on the size. The start address may be constant or dynamic
193     * depending on the size (e.g. for x86). The start address is not necessarily the start address for the processor.
194     * The start address is None if the ROM/BIOS is too large for the processor.
195     * @return the start address for the ROM/BIOS depending on the architecture
196     */
197   override def calculateRomStart(romSize: Long): Option[Long] = {
198     if (romSize < 16) {
199       Some(0xffff0)
200     } else if (romSize < maxMemory) {
201       Some(maxMemory - romSize)
202     } else {
203       None
204     }
205   }
206 
207   /**
208     * Resets the processor and starts it new.
209     */
210   override def reset(): Unit = {
211     _registers.mapValuesInPlace((name, _) => {
212       name match {
213         case "CS" => 0xffff
214         case _ => 0
215       }
216     })
217   }
218 
219   /**
220     * Do a single step of the processor (normally execute the next instruction).
221     */
222   override def step(): Unit = {
223   }
224 
225 }
Line Stmt Id Pos Tree Symbol Code
34 342 1315 - 1561 Apply scala.collection.MapFactory.Delegate.apply scala.collection.mutable.Map.apply[String, Int](scala.Predef.ArrowAssoc[String]("AX").->[Int](0), scala.Predef.ArrowAssoc[String]("BX").->[Int](0), scala.Predef.ArrowAssoc[String]("CX").->[Int](0), scala.Predef.ArrowAssoc[String]("DX").->[Int](0), scala.Predef.ArrowAssoc[String]("DI").->[Int](0), scala.Predef.ArrowAssoc[String]("SI").->[Int](0), scala.Predef.ArrowAssoc[String]("BP").->[Int](0), scala.Predef.ArrowAssoc[String]("SP").->[Int](0), scala.Predef.ArrowAssoc[String]("FLAGS").->[Int](0), scala.Predef.ArrowAssoc[String]("IP").->[Int](0), scala.Predef.ArrowAssoc[String]("CS").->[Int](65535), scala.Predef.ArrowAssoc[String]("DS").->[Int](0), scala.Predef.ArrowAssoc[String]("ES").->[Int](0), scala.Predef.ArrowAssoc[String]("SS").->[Int](0))
35 328 1345 - 1354 Apply scala.Predef.ArrowAssoc.-> scala.Predef.ArrowAssoc[String]("AX").->[Int](0)
36 329 1360 - 1369 Apply scala.Predef.ArrowAssoc.-> scala.Predef.ArrowAssoc[String]("BX").->[Int](0)
37 330 1375 - 1384 Apply scala.Predef.ArrowAssoc.-> scala.Predef.ArrowAssoc[String]("CX").->[Int](0)
38 331 1390 - 1399 Apply scala.Predef.ArrowAssoc.-> scala.Predef.ArrowAssoc[String]("DX").->[Int](0)
39 332 1405 - 1414 Apply scala.Predef.ArrowAssoc.-> scala.Predef.ArrowAssoc[String]("DI").->[Int](0)
40 333 1420 - 1429 Apply scala.Predef.ArrowAssoc.-> scala.Predef.ArrowAssoc[String]("SI").->[Int](0)
41 334 1435 - 1444 Apply scala.Predef.ArrowAssoc.-> scala.Predef.ArrowAssoc[String]("BP").->[Int](0)
42 335 1450 - 1459 Apply scala.Predef.ArrowAssoc.-> scala.Predef.ArrowAssoc[String]("SP").->[Int](0)
43 336 1465 - 1477 Apply scala.Predef.ArrowAssoc.-> scala.Predef.ArrowAssoc[String]("FLAGS").->[Int](0)
44 337 1483 - 1492 Apply scala.Predef.ArrowAssoc.-> scala.Predef.ArrowAssoc[String]("IP").->[Int](0)
45 338 1498 - 1512 Apply scala.Predef.ArrowAssoc.-> scala.Predef.ArrowAssoc[String]("CS").->[Int](65535)
46 339 1518 - 1527 Apply scala.Predef.ArrowAssoc.-> scala.Predef.ArrowAssoc[String]("DS").->[Int](0)
47 340 1533 - 1542 Apply scala.Predef.ArrowAssoc.-> scala.Predef.ArrowAssoc[String]("ES").->[Int](0)
48 341 1548 - 1557 Apply scala.Predef.ArrowAssoc.-> scala.Predef.ArrowAssoc[String]("SS").->[Int](0)
63 346 2119 - 2146 Apply scala.collection.MapFactory.apply scala.Predef.Map.apply[Int, Map[String,info.osdevelopment.sysemu.processor.Register]](scala.Predef.ArrowAssoc[Int](0).->[Map[String,info.osdevelopment.sysemu.processor.Register]](Processor8086.this.internalRegisters))
63 343 2123 - 2124 Literal <nosymbol> 0
63 345 2123 - 2145 Apply scala.Predef.ArrowAssoc.-> scala.Predef.ArrowAssoc[Int](0).->[Map[String,info.osdevelopment.sysemu.processor.Register]](Processor8086.this.internalRegisters)
63 344 2128 - 2145 Select info.osdevelopment.sysemu.processor.x86.i86.Processor8086.internalRegisters Processor8086.this.internalRegisters
63 347 2111 - 2147 Apply scala.util.Success.apply scala.util.Success.apply[scala.collection.immutable.Map[Int,Map[String,info.osdevelopment.sysemu.processor.Register]]](scala.Predef.Map.apply[Int, Map[String,info.osdevelopment.sysemu.processor.Register]](scala.Predef.ArrowAssoc[Int](0).->[Map[String,info.osdevelopment.sysemu.processor.Register]](Processor8086.this.internalRegisters)))
78 349 2764 - 2790 Apply scala.util.Success.apply scala.util.Success.apply[Map[String,info.osdevelopment.sysemu.processor.Register]](Processor8086.this.internalRegisters)
78 348 2772 - 2789 Select info.osdevelopment.sysemu.processor.x86.i86.Processor8086.internalRegisters Processor8086.this.internalRegisters
87 355 3024 - 3105 Apply scala.collection.immutable.MapOps.transform Processor8086.this._registers.toMap[String, Int](scala.this.<:<.refl[(String, Int)]).transform[info.osdevelopment.sysemu.processor.Register](((name: String, content: Int) => new info.osdevelopment.sysemu.processor.Register(0, name, math.this.BigInt.int2bigInt(content), 16)))
87 352 3092 - 3099 ApplyImplicitView scala.math.BigInt.int2bigInt math.this.BigInt.int2bigInt(content)
87 354 3070 - 3104 Apply info.osdevelopment.sysemu.processor.Register.<init> new info.osdevelopment.sysemu.processor.Register(0, name, math.this.BigInt.int2bigInt(content), 16)
87 351 3083 - 3084 Literal <nosymbol> 0
87 350 3035 - 3035 TypeApply scala.<:<.refl scala.this.<:<.refl[(String, Int)]
87 353 3101 - 3103 Literal <nosymbol> 16
101 356 3681 - 3702 Apply info.osdevelopment.sysemu.processor.x86.i86.Processor8086.get8BitRegister Processor8086.this.get8BitRegister(name)
103 357 3731 - 3756 Apply scala.collection.MapOps.contains Processor8086.this._registers.contains(name)
104 364 3770 - 3838 Block scala.util.Success.apply scala.util.Success.apply[info.osdevelopment.sysemu.processor.Register](new info.osdevelopment.sysemu.processor.Register(0, name, scala.`package`.BigInt.apply(Processor8086.this._registers.apply(name).toShort.toInt), 16))
104 358 3791 - 3792 Literal <nosymbol> 0
104 361 3834 - 3836 Literal <nosymbol> 16
104 360 3800 - 3832 Apply scala.math.BigInt.apply scala.`package`.BigInt.apply(Processor8086.this._registers.apply(name).toShort.toInt)
104 363 3770 - 3838 Apply scala.util.Success.apply scala.util.Success.apply[info.osdevelopment.sysemu.processor.Register](new info.osdevelopment.sysemu.processor.Register(0, name, scala.`package`.BigInt.apply(Processor8086.this._registers.apply(name).toShort.toInt), 16))
104 359 3807 - 3831 Select scala.Short.toInt Processor8086.this._registers.apply(name).toShort.toInt
104 362 3778 - 3837 Apply info.osdevelopment.sysemu.processor.Register.<init> new info.osdevelopment.sysemu.processor.Register(0, name, scala.`package`.BigInt.apply(Processor8086.this._registers.apply(name).toShort.toInt), 16)
106 367 3866 - 3964 Apply scala.util.Failure.apply scala.util.Failure.apply[Nothing](new scala.`package`.IllegalArgumentException("The register ".+(name).+(" is not known by this processor.")))
106 366 3874 - 3963 Apply java.lang.IllegalArgumentException.<init> new scala.`package`.IllegalArgumentException("The register ".+(name).+(" is not known by this processor."))
106 368 3866 - 3964 Block scala.util.Failure.apply scala.util.Failure.apply[Nothing](new scala.`package`.IllegalArgumentException("The register ".+(name).+(" is not known by this processor.")))
106 365 3903 - 3962 Apply java.lang.String.+ "The register ".+(name).+(" is not known by this processor.")
119 369 4338 - 4364 Apply java.lang.String.+ name.substring(0, 1).+("X")
120 370 4369 - 4383 Apply java.lang.String.charAt name.charAt(1)
122 373 4488 - 4492 Literal <nosymbol> 255
122 376 4504 - 4505 Literal <nosymbol> 8
122 378 4418 - 4507 Apply scala.util.Success.apply scala.util.Success.apply[info.osdevelopment.sysemu.processor.Register](new info.osdevelopment.sysemu.processor.Register(0, name, scala.`package`.BigInt.apply(Processor8086.this._registers.apply(_16bitName).>>(8).&(255).toShort.toInt), 8))
122 372 4483 - 4484 Literal <nosymbol> 8
122 375 4448 - 4502 Apply scala.math.BigInt.apply scala.`package`.BigInt.apply(Processor8086.this._registers.apply(_16bitName).>>(8).&(255).toShort.toInt)
122 377 4426 - 4506 Apply info.osdevelopment.sysemu.processor.Register.<init> new info.osdevelopment.sysemu.processor.Register(0, name, scala.`package`.BigInt.apply(Processor8086.this._registers.apply(_16bitName).>>(8).&(255).toShort.toInt), 8)
122 371 4439 - 4440 Literal <nosymbol> 0
122 374 4456 - 4501 Select scala.Short.toInt Processor8086.this._registers.apply(_16bitName).>>(8).&(255).toShort.toInt
124 382 4564 - 4611 Apply scala.math.BigInt.apply scala.`package`.BigInt.apply(Processor8086.this._registers.apply(_16bitName).&(255).toShort.toInt)
124 385 4534 - 4616 Apply scala.util.Success.apply scala.util.Success.apply[info.osdevelopment.sysemu.processor.Register](new info.osdevelopment.sysemu.processor.Register(0, name, scala.`package`.BigInt.apply(Processor8086.this._registers.apply(_16bitName).&(255).toShort.toInt), 8))
124 379 4555 - 4556 Literal <nosymbol> 0
124 381 4572 - 4610 Select scala.Short.toInt Processor8086.this._registers.apply(_16bitName).&(255).toShort.toInt
124 384 4542 - 4615 Apply info.osdevelopment.sysemu.processor.Register.<init> new info.osdevelopment.sysemu.processor.Register(0, name, scala.`package`.BigInt.apply(Processor8086.this._registers.apply(_16bitName).&(255).toShort.toInt), 8)
124 383 4613 - 4614 Literal <nosymbol> 8
124 380 4597 - 4601 Literal <nosymbol> 255
126 388 4641 - 4739 Apply scala.util.Failure.apply scala.util.Failure.apply[Nothing](new scala.`package`.IllegalArgumentException("The register ".+(name).+(" is not known by this processor.")))
126 387 4649 - 4738 Apply java.lang.IllegalArgumentException.<init> new scala.`package`.IllegalArgumentException("The register ".+(name).+(" is not known by this processor."))
126 386 4678 - 4737 Apply java.lang.String.+ "The register ".+(name).+(" is not known by this processor.")
142 389 5331 - 5344 Select info.osdevelopment.sysemu.processor.Register.name register.name
144 390 5429 - 5454 Apply info.osdevelopment.sysemu.processor.x86.i86.Processor8086.set8BitRegister Processor8086.this.set8BitRegister(register)
146 391 5503 - 5516 Select info.osdevelopment.sysemu.processor.Register.name register.name
146 392 5483 - 5517 Apply scala.collection.MapOps.contains Processor8086.this._registers.contains(register.name)
147 394 5531 - 5557 Block info.osdevelopment.sysemu.processor.x86.i86.Processor8086.set16BitRegister Processor8086.this.set16BitRegister(register)
147 393 5531 - 5557 Apply info.osdevelopment.sysemu.processor.x86.i86.Processor8086.set16BitRegister Processor8086.this.set16BitRegister(register)
149 397 5585 - 5682 Apply scala.util.Failure.apply scala.util.Failure.apply[Nothing](new scala.`package`.IllegalArgumentException("The register ".+(Processor8086.this.name).+(" is not known by the processor.")))
149 396 5593 - 5681 Apply java.lang.IllegalArgumentException.<init> new scala.`package`.IllegalArgumentException("The register ".+(Processor8086.this.name).+(" is not known by the processor."))
149 395 5622 - 5680 Apply java.lang.String.+ "The register ".+(Processor8086.this.name).+(" is not known by the processor.")
149 398 5585 - 5682 Block scala.util.Failure.apply scala.util.Failure.apply[Nothing](new scala.`package`.IllegalArgumentException("The register ".+(Processor8086.this.name).+(" is not known by the processor.")))
162 400 6105 - 6109 ApplyImplicitView scala.math.BigInt.int2bigInt math.this.BigInt.int2bigInt(-128)
162 399 6079 - 6082 ApplyImplicitView scala.math.BigInt.int2bigInt math.this.BigInt.int2bigInt(255)
162 402 6059 - 6109 Apply scala.Boolean.& register.content.<=(math.this.BigInt.int2bigInt(255)).&(register.content.>=(math.this.BigInt.int2bigInt(-128)))
162 419 6111 - 6498 Block <nosymbol> { val _16bit: String = register.name.substring(0, 1).+("X"); register.name.charAt(1) match { case 'H' => Processor8086.this._registers.update(_16bit, Processor8086.this._registers.apply(_16bit).&(255).|(register.content.&(math.this.BigInt.int2bigInt(255)).<<(8).toShort)) case 'L' => Processor8086.this._registers.update(_16bit, Processor8086.this._registers.apply(_16bit).&(65280).|(register.content.&(math.this.BigInt.int2bigInt(255)).toShort)) }; this.register(0, register.name) }
162 401 6085 - 6109 Apply scala.math.Ordered.>= register.content.>=(math.this.BigInt.int2bigInt(-128))
163 403 6132 - 6167 Apply java.lang.String.+ register.name.substring(0, 1).+("X")
164 404 6174 - 6197 Apply java.lang.String.charAt register.name.charAt(1)
166 406 6310 - 6314 ApplyImplicitView scala.math.BigInt.int2bigInt math.this.BigInt.int2bigInt(255)
166 409 6257 - 6329 Apply scala.Int.| Processor8086.this._registers.apply(_16bit).&(255).|(register.content.&(math.this.BigInt.int2bigInt(255)).<<(8).toShort)
166 405 6279 - 6285 Literal <nosymbol> 255
166 408 6290 - 6329 Select scala.math.ScalaNumericAnyConversions.toShort register.content.&(math.this.BigInt.int2bigInt(255)).<<(8).toShort
166 410 6236 - 6329 Apply scala.collection.mutable.MapOps.update Processor8086.this._registers.update(_16bit, Processor8086.this._registers.apply(_16bit).&(255).|(register.content.&(math.this.BigInt.int2bigInt(255)).<<(8).toShort))
166 407 6319 - 6320 Literal <nosymbol> 8
168 415 6360 - 6446 Apply scala.collection.mutable.MapOps.update Processor8086.this._registers.update(_16bit, Processor8086.this._registers.apply(_16bit).&(65280).|(register.content.&(math.this.BigInt.int2bigInt(255)).toShort))
168 412 6433 - 6437 ApplyImplicitView scala.math.BigInt.int2bigInt math.this.BigInt.int2bigInt(255)
168 414 6381 - 6446 Apply scala.Int.| Processor8086.this._registers.apply(_16bit).&(65280).|(register.content.&(math.this.BigInt.int2bigInt(255)).toShort)
168 411 6403 - 6409 Literal <nosymbol> 65280
168 413 6414 - 6446 Select scala.math.ScalaNumericAnyConversions.toShort register.content.&(math.this.BigInt.int2bigInt(255)).toShort
170 418 6461 - 6492 Apply info.osdevelopment.sysemu.processor.x86.i86.Processor8086.register this.register(0, register.name)
170 417 6478 - 6491 Select info.osdevelopment.sysemu.processor.Register.name register.name
170 416 6475 - 6476 Literal <nosymbol> 0
172 421 6520 - 6609 Apply java.lang.IllegalArgumentException.<init> new scala.`package`.IllegalArgumentException("The register ".+(Processor8086.this.name).+(" is not known by this processor."))
172 420 6549 - 6608 Apply java.lang.String.+ "The register ".+(Processor8086.this.name).+(" is not known by this processor.")
172 423 6512 - 6610 Block scala.util.Failure.apply scala.util.Failure.apply[Nothing](new scala.`package`.IllegalArgumentException("The register ".+(Processor8086.this.name).+(" is not known by this processor.")))
172 422 6512 - 6610 Apply scala.util.Failure.apply scala.util.Failure.apply[Nothing](new scala.`package`.IllegalArgumentException("The register ".+(Processor8086.this.name).+(" is not known by this processor.")))
183 424 6907 - 6912 ApplyImplicitView scala.math.BigInt.int2bigInt math.this.BigInt.int2bigInt(65535)
183 427 6887 - 6941 Apply scala.Boolean.& register.content.<=(math.this.BigInt.int2bigInt(65535)).&(register.content.>=(math.this.BigInt.int2bigInt(-32768)))
183 426 6915 - 6941 Apply scala.math.Ordered.>= register.content.>=(math.this.BigInt.int2bigInt(-32768))
183 435 6943 - 7058 Block <nosymbol> { Processor8086.this._registers.update(register.name, register.content.&(math.this.BigInt.int2bigInt(65535)).toShort.toInt); this.register(0, register.name) }
183 425 6935 - 6941 ApplyImplicitView scala.math.BigInt.int2bigInt math.this.BigInt.int2bigInt(-32768)
184 430 6980 - 7014 Select scala.Short.toInt register.content.&(math.this.BigInt.int2bigInt(65535)).toShort.toInt
184 429 6999 - 7005 ApplyImplicitView scala.math.BigInt.int2bigInt math.this.BigInt.int2bigInt(65535)
184 428 6962 - 6975 Select info.osdevelopment.sysemu.processor.Register.name register.name
184 431 6951 - 7014 Apply scala.collection.mutable.MapOps.update Processor8086.this._registers.update(register.name, register.content.&(math.this.BigInt.int2bigInt(65535)).toShort.toInt)
185 433 7038 - 7051 Select info.osdevelopment.sysemu.processor.Register.name register.name
185 432 7035 - 7036 Literal <nosymbol> 0
185 434 7021 - 7052 Apply info.osdevelopment.sysemu.processor.x86.i86.Processor8086.register this.register(0, register.name)
187 436 7109 - 7168 Apply java.lang.String.+ "The register ".+(Processor8086.this.name).+(" is not known by this processor.")
187 439 7072 - 7170 Block scala.util.Failure.apply scala.util.Failure.apply[Nothing](new scala.`package`.IllegalArgumentException("The register ".+(Processor8086.this.name).+(" is not known by this processor.")))
187 438 7072 - 7170 Apply scala.util.Failure.apply scala.util.Failure.apply[Nothing](new scala.`package`.IllegalArgumentException("The register ".+(Processor8086.this.name).+(" is not known by this processor.")))
187 437 7080 - 7169 Apply java.lang.IllegalArgumentException.<init> new scala.`package`.IllegalArgumentException("The register ".+(Processor8086.this.name).+(" is not known by this processor."))
198 440 7660 - 7672 Apply scala.Long.< romSize.<(16)
199 442 7682 - 7695 Block scala.Some.apply scala.Some.apply[Long](1048560L)
199 441 7682 - 7695 Apply scala.Some.apply scala.Some.apply[Long](1048560L)
200 450 7707 - 7795 If <nosymbol> if (romSize.<(Processor8086.this.maxMemory)) scala.Some.apply[Long](Processor8086.this.maxMemory.-(romSize)) else scala.None
200 444 7711 - 7730 Apply scala.Long.< romSize.<(Processor8086.this.maxMemory)
200 443 7721 - 7730 Select info.osdevelopment.sysemu.processor.Processor.maxMemory Processor8086.this.maxMemory
201 445 7745 - 7764 Apply scala.Long.- Processor8086.this.maxMemory.-(romSize)
201 447 7740 - 7765 Block scala.Some.apply scala.Some.apply[Long](Processor8086.this.maxMemory.-(romSize))
201 446 7740 - 7765 Apply scala.Some.apply scala.Some.apply[Long](Processor8086.this.maxMemory.-(romSize))
203 448 7785 - 7789 Select scala.None scala.None
203 449 7785 - 7789 Block scala.None scala.None
211 454 7924 - 7924 Literal <nosymbol> ()
211 453 7897 - 8021 Apply scala.collection.mutable.MapOps.mapValuesInPlace Processor8086.this._registers.mapValuesInPlace(((name: String, x$1: Int) => name match { case "CS" => 65535 case _ => 0 }))
213 451 7980 - 7986 Literal <nosymbol> 65535
214 452 8005 - 8006 Literal <nosymbol> 0
222 455 8151 - 8156 Literal <nosymbol> ()