def test_abs_x(self): "Test absolute X addressing mode" instruction = 'adc $4400, x' expected = {'label': None, 'mneumonic': 'adc', 'operands': '$4400, x'} result = oddball.parse_line(instruction) self.assertEqual(expected, result) # Now test with a label instruction = 'test_label:' + ' ' + instruction expected['label'] = 'test_label' result = oddball.parse_line(instruction) self.assertEqual(expected, result)
def test_accumulator(self): "Test accumulator addressing mode" instruction = 'rol a' expected = {'label': None, 'mneumonic': 'rol', 'operands': 'a'} result = oddball.parse_line(instruction) self.assertEqual(expected, result) # Now test with a label instruction = 'test_label:' + ' ' + instruction expected['label'] = 'test_label' result = oddball.parse_line(instruction) self.assertEqual(expected, result)
def test_implied(self): "Test implied addressing mode" instruction = 'brk' expected = {'label': None, 'mneumonic': 'brk', 'operands': None} result = oddball.parse_line(instruction) self.assertEqual(expected, result) # Now test with a label instruction = 'test_label:' + ' ' + instruction expected['label'] = 'test_label' result = oddball.parse_line(instruction) self.assertEqual(expected, result)
def test_immediate(self): "Test immediate addressing mode" instruction = 'adc #$44' expected = {'label': None, 'mneumonic': 'adc', 'operands': '#$44'} result = oddball.parse_line(instruction) self.assertEqual(expected, result) # Now test with a label instruction = 'test_label:' + ' ' + instruction expected['label'] = 'test_label' result = oddball.parse_line(instruction) self.assertEqual(expected, result)
def test_ind_y(self): "Test indirect Y addressing mode" instruction = 'adc ($44), y' expected = {'label': None, 'mneumonic': 'adc', 'operands': '($44), y'} result = oddball.parse_line(instruction) self.assertEqual(expected, result) # Now test with a label instruction = 'test_label:' + ' ' + instruction expected['label'] = 'test_label' result = oddball.parse_line(instruction) self.assertEqual(expected, result)