# Converts an integer in the decimal range 0..9 into the corresponding ASCII character value.
# Verify that operand < 10
# Call subtract subroutine
# TODO: Put Return PC on TOS
# This requires a guarantee that I copy the PC in the 'correct' word, not too early. Will need NOP padding in nedasm.
# Make sure PC points to NEXT word, not to CURRENT word. Increment immediately after fetching a new word.
# Maybe define a JSR and RTS mnemonic pair that expands to the correct, real assembly in nedasm?
# Probably need to add a field to instruction_struct specifying that it should be the start of a new word. This also involves the code generation function.
# 0x04 0x8000000 register
TEST # Set PSW according to difference.
# Branch if non-negative:
# Verify that operand > -1
TEST # Set PSW according to operand.
BRZ>itoahalt # Branch if operand was negative.
# Convert the integer to its ASCII representation and return to caller.
RTS # Implement as unconditional jump since Return PC is already on TOS.