Closed fl215 closed 2 years ago
WTF! I found so much about execution modules in the reference manual, tho I still have 1 unanswered question: writing numbers without the cp437 characters appearing.
Glad the manual helped :)
Re 1.: what do you mean, exactly? Do you send the value 15 to the terminal and expect the text 15
to appear? You'll have to convert the digits to cp437 codes first. Otherwise, could you please try to reword the issue?
I would like to write a number to the screen, but because you quite literally have to use numbers to type into the terminal, they just appear as cp437 characters, and those are lower than 31 which means they will not appear. I want to put in a number after you type in the beats (since I am making a music program) which will represent how many times they used it. That key value is also used to modify the pitch in the other terminal, (setting it to 0 will result in pitch 1, etc) and I want the users to see what pitch they currently have. I will, of course change the pitch value to it's own value, for now it's the key for debugging purposes wink wink.
Still not quite sure I follow, but it sounds like you want to display values as readable text on the terminal module? In that case, as mentioned, you'll have to convert them (kinda like how in Java you'd have to do String.valueOf
). For example (note: untested, but should get the idea accross):
mov up acc # read value to convert, assuming it comes from the top
jez end: # ignore invalid input
mov 0 left # assuming there's a stack module on the left side
# convert digits to codepage 437 one by one
convert_loop:
sav
mod 10 # extract lowest base 10 digit
add 48 # digit to codepage 437
mov left # push to stack
swp
div 10 # move on to next digit
jnz convert_loop
# read back from stack, inverting order for printing
output_loop:
mov left acc
jez end # check for the 0 we pushed at the start, it marks the end
mov acc right
jmp convert_loop
end:
Okay, now, I got a lot of questions but I will shorten them. Let's start with my most "question-ed" questions.
Someone please answer these questions.