calcman wrote:
I was talking about the HotDogs's asm tutorial.
Oh, those are Word documents? I guess they were when I read them when they were still in progress, but I was assuming he had concatenated into a PDF when he finished. Based on your question, I suppose not.
KermMartian wrote:
Oh, those are Word documents? I guess they were when I read them when they were still in progress, but I was assuming he had concatenated into a PDF when he finished. Based on your question, I suppose not.
They are in PDF format now, but they aren't concatenated.
Now... is there an easy/relatively simple way to ask for input from within an assembly program? I'm assuming it will require some trickery, but what are some methods I could use for it?
Well in Day 12 and day 22 in Learn asm in 28 days it explains it, also what input?
Numbers, low level key input, letters?
calcman wrote:
Well in Day 12 and day 22 in Learn asm in 28 days it explains it, also what input?
Numbers, low level key input, letters?
I'd need mainly letters and numbers with on-screen display as you type.
I don't know how helpful this would be, but this is a disassembly of Axe's input command:
Code: res 6,(iy+1C)
set 7,(iy+09)
xor a
ld (865Fh),a
B_CALL($4E5E)
B_CALL($41C5)
ld hl,2D04h
ld (8478h),hl
B_CALL(42F1h)
inc de
inc de
ex de,hl
ret
I _think_ it outputs a pointer to the start of the data that was inputted in HL.
First thing know these commands:
Code:
bcall Getkey ; pauses and waits for any key to be pushed
bcall Getcsc ;continues program without waiting
;good for loops
These get any key input, getkey use s(name of key)
and getcsc uses sk(name of key)
example:
using getkey
Code:
Loop:
bcall getkey ;pauses
cp kenter ;returns key in a register
jr z,enter
cp kclear
jr z,clear
jr Loop
enter:
ld hl,text
bcall puts
jr Loop
clear:
ret
text:
db "you pushed enter",0
hope that helps, will give an example of getcsc later
You could also use _getKey or _getCSC for manual input, as calcman said. It can be a pain to implement that though, since you have to check for almost all of the keys on the calculator's keypad using CP and JR or JP.
technomonkey76 wrote:
calcman wrote:
Well in Day 12 and day 22 in Learn asm in 28 days it explains it, also what input?
Numbers, low level key input, letters?
I'd need mainly letters and numbers with on-screen display as you type. If you want to really make life trivial for yourself, have you considered using the Doors CS GUI routines, namely:
http://dcs.cemetech.net/index.php?title=GUIRTextLineIn
Alternatively, and less recommended, you can use the MirageOS routines gettext/gettextv:
http://dcs.cemetech.net/index.php?title=Developers%27_SDK
But what if you wanted to give this program to anyone who wanted it but they didn't want Doors CS7 (I know a few people)
calcman wrote:
But what if you wanted to give this program to anyone who wanted it but they didn't want Doors CS7 (I know a few people)
Forcibly transfer it to their calculator?
calcman wrote:
But what if you wanted to give this program to anyone who wanted it but they didn't want Doors CS7 (I know a few people)
Then say screw them, they should have DCS7
But, if they don't, make a no-stub program, and just rewrite the routines to be attached to the program -- which will make the program much bigger though.
Not to mention, you have to get permission to do so, because you are basically stealing those routines.
Urgh, the routines are long and complex. You can do a trivial version that's just pressing letters (or just pressing numbers), slightly less trivial if you add backspace, and much harder if you want a moveable cursor (inserting or removing intermediate characters) and switching between more than one alpha mode.
http://pastebin.com/4GMGeB5U
What's the best way to optimize this? Also, how would I store this to an area of memory? What SafeRAM area should I write to? What's the best way to add a "backspace" keypress?
I know it's a lot of questions, but I need help with getting answers.
Your strings aren't zero-terminated, that can be a problem. A good chunk of SafeRAM you can write to is appbackupscreen, which is 768 bytes (iirc), but you'll probably want something smaller for this.
souvik1997 wrote:
Your strings aren't zero-terminated, that can be a problem. A good chunk of SafeRAM you can write to is appbackupscreen, which is 768 bytes (iirc), but you'll probably want something smaller for this.
I literally fixed the 0-terminated issue RIGHT while you were posting. xD But what's smaller then? I was going for a max of 16 characters BTW.
You could use textShadow, which is 128 bytes large.
Or, you could even use OP1 - OP2 -- that's 22 bytes right there that you normally wouldn't use
There's SafeRAM1-5, which are of varying sizes, but I like the idea of using one of the eleven-byte OpN areas, or two of them together, because it's better to save the larger SafeRAM areas for when you need them.
KermMartian wrote:
There's SafeRAM1-5, which are of varying sizes, but I like the idea of using one of the eleven-byte OpN areas, or two of them together, because it's better to save the larger SafeRAM areas for when you need them.
How would I store each value to (Op1+[number]) as I go?
Would it be like:
Code: [...] ;header
Number .equ Op1
Start:
xor a
[...] ;misc. things
KEY0:
ld hl,TEXT0
ld hl,Number+a
add a,1
cp a,11
jr z,Done
jr DispText
[...] ;misc. things
?
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.
»
Go to Registration page
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum