# Path: MC6809/tests/test_base.py
# class BaseStackTestCase(BaseCPUTestCase):
#     INITIAL_SYSTEM_STACK_ADDR = 0x1000
#     INITIAL_USER_STACK_ADDR = 0x2000
# 
#     def setUp(self):
#         super().setUp()
#         self.cpu.system_stack_pointer.set(self.INITIAL_SYSTEM_STACK_ADDR)
#         self.cpu.user_stack_pointer.set(self.INITIAL_USER_STACK_ADDR)


import binascii
import logging
import sys
import unittest
from decimal import Decimal
from MC6809.tests.test_base import BaseStackTestCase
            quotient, remainder = self._division(dividend, divisor)
#             print quotient, remainder

            a = Decimal(dividend)
            b = Decimal(divisor)
            expected_quotient = int(a // b)
            expected_remainder = int(a % b)

            first = f"{dividend:d}/{divisor:d}={quotient:d} remainder: {remainder:d}"
            second = (
                f"{dividend:d}/{divisor:d}={expected_quotient:d} remainder: {expected_remainder:d}"
            )
            self.assertEqual(first, second)

        test(10, 5)
        test(10, 3)
        test(1000, 2000)
        test(0xffff, 0x80)
        test(0xfffff, 0x800)
        test(0xffffff, 0x8000)
        test(0xfffffff, 0x8000)
        test(1, 0x8000)

#         test(1, 0x8001) # Error: '1/32769=65534 remainder: 3' != '1/32769=0 remainder: 1'
#         test(1, 0x9000) # Error: '10/65535=65533 remainder: 7' != '10/65535=0 remainder: 10'
#         test(10, 0xffff) # Error: '10/65535=65533 remainder: 7' != '10/65535=0 remainder: 10'
# test(0xfffffff, 0xffff) # Error: '268435455/65535=57342 remainder:
# 57341' != '268435455/65535=4096 remainder: 4095'



# Path: MC6809/tests/test_base.py
# class BaseStackTestCase(BaseCPUTestCase):
#     INITIAL_SYSTEM_STACK_ADDR = 0x1000
#     INITIAL_USER_STACK_ADDR = 0x2000
# 
#     def setUp(self):
#         super().setUp()
#         self.cpu.system_stack_pointer.set(self.INITIAL_SYSTEM_STACK_ADDR)
#         self.cpu.user_stack_pointer.set(self.INITIAL_USER_STACK_ADDR)


# Path: MC6809/tests/test_6809_program.py
import binascii
import logging
import sys
import unittest
from decimal import Decimal
from MC6809.tests.test_base import BaseStackTestCase

            quotient, remainder = self._division(dividend, divisor)
#             print quotient, remainder

            a = Decimal(dividend)
            b = Decimal(divisor)
            expected_quotient = int(a // b)
            expected_remainder = int(a % b)

            first = f"{dividend:d}/{divisor:d}={quotient:d} remainder: {remainder:d}"
            second = (
                f"{dividend:d}/{divisor:d}={expected_quotient:d} remainder: {expected_remainder:d}"
            )
            self.assertEqual(first, second)

        test(10, 5)
        test(10, 3)
        test(1000, 2000)
        test(0xffff, 0x80)
        test(0xfffff, 0x800)
        test(0xffffff, 0x8000)
        test(0xfffffff, 0x8000)
        test(1, 0x8000)

#         test(1, 0x8001) # Error: '1/32769=65534 remainder: 3' != '1/32769=0 remainder: 1'
#         test(1, 0x9000) # Error: '10/65535=65533 remainder: 7' != '10/65535=0 remainder: 10'
#         test(10, 0xffff) # Error: '10/65535=65533 remainder: 7' != '10/65535=0 remainder: 10'
# test(0xfffffff, 0xffff) # Error: '268435455/65535=57342 remainder:
# 57341' != '268435455/65535=4096 remainder: 4095'



class Test6809_Program_Division2(BaseStackTestCase):