Click here to Skip to main content
15,887,477 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to make a program that I can control the stepper motor with virtual keyboard. I have to use "Microprocessor Simulator - Version 5.0 (GNU) (http://www.softwareforeducation.com/sms32v50/index.php). I have included a script[^]. I got it working with numbers 1-6 but when I try to add new numbers I get this error: Jump can not exceed -128..127 START. I'd like it to go up to 1-9 and zero. Is it possible to split the script or have I reached max that it can take in?

What I have tried:

I don't know if it's even possible to add more to it but maybe splitting the script somehow..
Posted
Updated 24-Nov-17 6:01am

1 solution

You need to use a long jump (if that exists in your assembler) or rework your code to use subroutine calls and ensure that all your jumps are within the limits mentioned.
 
Share this answer
 
Comments
Richard MacCutchan 24-Nov-17 12:24pm    
You will have to look in the documentation for whichever assembler you are using.
Richard MacCutchan 24-Nov-17 12:33pm    
I have just taken a look at your code and it could be much simpler. All you need to do is strip the ASCII base from your input number to get the output value, something like:

in 07
CMP AL,'0' ; Process the key press here
JL ??? ; if it is less than '0'
CMP AL,'9' ;
JG ??? ; or greater than 9 ignore
SUB AL,'0' ; remove the ASCII base of x30
OUT 05 ; output the number
JZ start ; not sure where that goes
Richard MacCutchan 24-Nov-17 14:21pm    
Well you should still be able to adapt my code above.
Richard MacCutchan 24-Nov-17 14:26pm    
You can use JS after a CMP instruction.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900