예제 #1
0
 def execute(self, processor):
     if processor.condition_passed():
         offset_addr = bits_add(processor.registers.get(self.n), self.imm32, 32) if self.add else bits_sub(
                 processor.registers.get(self.n), self.imm32, 32)
         address = offset_addr if self.index else processor.registers.get(self.n)
         processor.registers.set(self.t, zero_extend(processor.mem_u_get(address, 1), 32))
         if self.wback:
             processor.registers.set(self.n, offset_addr)
예제 #2
0
 def execute(self, processor):
     if processor.condition_passed():
         try:
             processor.null_check_if_thumbee(self.n)
         except EndOfInstruction:
             pass
         else:
             address = processor.registers.get(self.n)
             processor.set_exclusive_monitors(address, 2)
             processor.registers.set(
                 self.t, zero_extend(processor.mem_a_get(address, 2), 32))
예제 #3
0
 def execute(self, processor):
     if processor.condition_passed():
         offset_addr = bits_add(processor.registers.get(self.n), self.imm32, 32) if self.add else bits_sub(
             processor.registers.get(self.n), self.imm32, 32)
         address = offset_addr if self.index else processor.registers.get(self.n)
         data = processor.mem_u_get(address, 2)
         if self.wback:
             processor.registers.set(self.n, offset_addr)
         if processor.unaligned_support() or not address[31]:
             processor.registers.set(self.t, zero_extend(data, 32))
         else:
             processor.registers.set(self.t, BitArray(length=32))  # unknown
예제 #4
0
 def execute(self, processor):
     if processor.condition_passed():
         try:
             processor.null_check_if_thumbee(15)
         except EndOfInstruction:
             pass
         else:
             base = align(processor.registers.get_pc(), 4)
             address = bits_add(base, self.imm32,
                                32) if self.add else bits_sub(
                                    base, self.imm32, 32)
             processor.registers.set(
                 self.t, zero_extend(processor.mem_u_get(address, 1), 32))
예제 #5
0
 def execute(self, processor):
     if processor.condition_passed():
         try:
             processor.null_check_if_thumbee(self.n)
         except EndOfInstruction:
             pass
         else:
             offset_addr = bits_add(processor.registers.get(
                 self.n), self.imm32, 32) if self.add else bits_sub(
                     processor.registers.get(self.n), self.imm32, 32)
             address = offset_addr if self.index else processor.registers.get(
                 self.n)
             processor.registers.set(
                 self.t, zero_extend(processor.mem_u_get(address, 1), 32))
             if self.wback:
                 processor.registers.set(self.n, offset_addr)
예제 #6
0
 def execute(self, processor):
     if processor.condition_passed():
         try:
             processor.null_check_if_thumbee(self.n)
         except EndOfInstruction:
             pass
         else:
             offset_addr = bits_add(processor.registers.get(self.n), self.imm32, 32) if self.add else bits_sub(
                 processor.registers.get(self.n), self.imm32, 32)
             address = offset_addr if self.index else processor.registers.get(self.n)
             data = processor.mem_u_get(address, 2)
             if self.wback:
                 processor.registers.set(self.n, offset_addr)
             if processor.unaligned_support() or address[31:32] == "0b0":
                 processor.registers.set(self.t, zero_extend(data, 32))
             else:
                 processor.registers.set(self.t, BitArray(length=32))  # unknown
예제 #7
0
 def execute(self, processor):
     if processor.condition_passed():
         try:
             processor.null_check_if_thumbee(15)
         except EndOfInstruction:
             pass
         else:
             base = align(processor.registers.get_pc(), 4)
             address = bits_add(base, self.imm32,
                                32) if self.add else bits_sub(
                                    base, self.imm32, 32)
             data = processor.mem_u_get(address, 2)
             if processor.unaligned_support() or not address[31]:
                 processor.registers.set(self.t, zero_extend(data, 32))
             else:
                 processor.registers.set(self.t,
                                         BitArray(length=32))  # unknown
예제 #8
0
파일: ldrbt.py 프로젝트: doronz88/armulator
 def execute(self, processor):
     if processor.condition_passed():
         if processor.registers.current_mode_is_hyp():
             print "unpredictable"
         else:
             try:
                 processor.null_check_if_thumbee(self.n)
             except EndOfInstruction:
                 pass
             else:
                 offset = shift(processor.registers.get(self.m), self.shift_t, self.shift_n,
                                processor.registers.cpsr.get_c()) if self.register_form else self.imm32
                 offset_addr = bits_add(processor.registers.get(self.n), offset, 32) if self.add else bits_sub(
                     processor.registers.get(self.n), offset, 32)
                 address = processor.registers.get(self.n) if self.post_index else offset_addr
                 processor.registers.set(self.t, zero_extend(processor.mem_u_unpriv_get(address, 1), 32))
                 if self.post_index:
                     processor.registers.set(self.n, offset_addr)
예제 #9
0
파일: ldrht.py 프로젝트: doronz88/armulator
 def execute(self, processor):
     if processor.condition_passed():
         if processor.registers.current_mode_is_hyp():
             print "unpredictable"
         else:
             try:
                 processor.null_check_if_thumbee(self.n)
             except EndOfInstruction:
                 pass
             else:
                 offset = processor.registers.get(self.m) if self.register_form else self.imm32
                 offset_addr = bits_add(processor.registers.get(self.n), offset, 32) if self.add else bits_sub(
                     processor.registers.get(self.n), offset, 32)
                 address = processor.registers.get(self.n) if self.post_index else offset_addr
                 data = processor.mem_u_unpriv_get(address, 2)
                 if self.post_index:
                     processor.registers.set(self.n, offset_addr)
                 if processor.unaligned_support() or not address[31]:
                     processor.registers.set(self.t, zero_extend(data, 32))
                 else:
                     processor.registers.set(self.t, BitArray(length=32))  # unknown