I'm having some trouble getting this program to compile. I am using the DCS toolchain (the one in the sdk) to compile it. I get this error when I try to compile: could not parse expression 'PushGUIStacks' <invalid number>. [zztemp.asm:24]
Any ideas?

Code:
; Program Name: GUI Test
; Author: Tanner Hobson
; Version: 0.0
; Date: 7/10/2010
; Written for Doors CS 6.0 and higher (http://dcs.cemetech.net)

.nolist
#include "dcs6.inc"
.list
   .org 9D95h
   .db $BB,$6D
Init:
   xor d
   ret
   jr Start
   
   .dw Description         ;or .dw $0000 if you don't have a description
   .db $05,$00         ;always this string
   .dw Icon         ;or .dw $0000 if you don't have an icon
   .dw 00         ;usually .dw $0000 if you don't have or know what an ALE is
Start:                             ;main routines
   ld hl, myWindowStuff
   call PushGUIStacks
   ld hl, 0
   call GUIMouse
Explode:
   ret
   
myWindowStuff:
myGUIRLargeWin:
   .dw myGUIRButtonImg-myGUIRLargeWin
   .db 1
   .db 0FFh,88h,88h,88h,0FFh
   .db "I am a test window!",0
myGUIRButtonImg:
   .dw myGUIRTextLineIn-myGUIRButtonImg
   .db 8
   .db 2,2
   .dw Explode
   .db 1
   .db 6
   .db 0FFh,0FFh,0FFh,0FFh,0FFh
myGUIRTextLineIn:
   .dw myGUIRByteInt-myGUIRTextLineIn
   .db 9
   .db 10
   .db 5
   .db 10
   .dw 12
   .dw 00
   .db "Enter Text!",0
myGUIRByteInt:
   .dw myWindowStuffEnd-myGUIRByteInt
   .db 12
   .db 30
   .db 30
   .db 122
   .db 5
   .db 200
myWindowStuffEnd:
   .db 0FFh,0FFh

Description:
   .db "A random test of the GUI",0   ;can be omitted if .dw Description is .dw 0000 above
Icon:            ;a 16x16 icon (can be omitted if .dw Icon is .dw 0000 above)
   .db %11111111,%11111000
   .db %10000000,%00001100
   .db %10111100,%00001010
   .db %10010010,%00001111
   .db %10010010,%01010001
   .db %10010010,%10101001
   .db %10111100,%01010101
   .db %10000000,%00000001
   .db %10101010,%10101001
   .db %10010101,%01010101
   .db %10101010,%10101001
   .db %10000000,%00000001
   .db %10010101,%01010101
   .db %10101010,%10101001
   .db %10000000,%00000001
   .db %11111111,%11111111
The main problem is that you're #include'ing dcs6.inc instead of dcs7.inc. Smile
KermMartian wrote:
The main problem is that you're #include'ing dcs6.inc instead of dcs7.inc. Smile


Facepalm
Oh, I just copied it from the wiki page. Can you update that maybe?
But now I get two more errors... Could not assign value 'plotsscreen' to label gbuf <invalid number>. [dcs7.inc:277]
(oh, the second one is _delmem and _deletemem respectivly)
_player1537 wrote:
Oh, I just copied it from the wiki page. Can you update that maybe?
But now I get two more errors... Could not assign value 'plotsscreen' to label gbuf <invalid number>. [dcs7.inc:277]
(oh, the second one is _delmem and _deletemem respectivly)
Wait, could you just paste the errors? And I'm updating the wiki presently.

Edit: What page in the wiki did you get that from?
I had to type the errors out by hand. I'll check for the page.
http://dcs.cemetech.net/index.php?title=ASM_Header
_player1537 wrote:
I had to type the errors out by hand. I'll check for the page.
http://dcs.cemetech.net/index.php?title=ASM_Header
Actually, you don't need to. Pro-tip for everyone: how to copy out of a Windows Cmd window:

1) Right-click, choose Mark.
2) Click and hold the left mouse button, drag out a rectangle
3) RIGHT-CLICK to perform the actual copy
4) Paste wherever.
KermMartian wrote:
_player1537 wrote:
I had to type the errors out by hand. I'll check for the page.
http://dcs.cemetech.net/index.php?title=ASM_Header
Actually, you don't need to. Pro-tip for everyone: how to copy out of a Windows Cmd window:

1) Right-click, choose Mark.
2) Click and hold the left mouse button, drag out a rectangle
3) RIGHT-CLICK to perform the actual copy
4) Paste wherever.


Cool tip Very Happy But what about the random errors?

Code:
Error: Could not assign value 'plotsscreen' to label 'gbuf' (Invalid number). [dcs7.inc:277]
Error: Could not assign value '_delmem' to label '_deletemem' (Invalid number).[dcs7.inc:279]
[/code]
Oh, that's another fail on my part to fix in the ASM Header section. Either #include "ti83plus.inc" right above dcs7.inc, or just re-copy the initial part of the header out of this page:

http://dcs.cemetech.net/index.php?title=ASM_Header
Yay! That fixed it Very Happy Now to see if my program works Razz
_player1537 wrote:
Yay! That fixed it Very Happy Now to see if my program works Razz
Good deal, keep me update, and thanks for helping me find those problems! That should help plenty of other people who would otherwise have been confused. One question: are you using #define TASM at the moment? If you are, what happens if you remove that?
I was using #define TASM, but removing that still lets it compile correctly Very Happy Oh, and my program crashed x.x *facepalm* stupid program start confusion!
_player1537 wrote:
I was using #define TASM, but removing that still lets it compile correctly Very Happy Oh, and my program crashed x.x *facepalm* stupid program start confusion!
That's good to hear. Errr, what do you mean, want to paste in some code?
Earlier up, I had ".org 9D95h" followed by .db 0BBh,6Dh, so it messed up on that. Anyways, it just about works. I'll post code in a minute. Do I have to call something to clean the GUI stack?

Edit: Oops, I think I know what's wrong.
EditEdit: I forgot to add the WinButtons, so it crashed. Anyways, I still need to know if I have to clean the stack before exiting, and if dp, how?
You can run it without any WinButtons and it should be fine; you just won't be able to exit probably. And for cleaning the stack, CloseGUIStack works. If you want to clean it and put other stuff on top, PopGUIStacks.

Code:
; Program Name: GUI Test
; Author: Tanner Hobson
; Version: 0.0
; Date: 7/10/2010
; Written for Doors CS 6.0 and higher (http://dcs.cemetech.net)

.nolist
;#define TASM
#include "ti83plus.inc"
#include "dcs7.inc"
.list
   .org 9D93h
   .db $BB,$6D
Init:
   xor d
   ret
   jr Start
   
   .dw Description         ;or .dw $0000 if you don't have a description
   .db $05,$00         ;always this string
   .dw Icon         ;or .dw $0000 if you don't have an icon
   .dw 00         ;usually .dw $0000 if you don't have or know what an ALE is
Start:                             ;main routines
   ld hl, myWindowStuff
   call PushGUIStacks
   ld hl, 0
   call GUIMouse
Explode:
   call CloseGUIStack
   ret
Exit:
   call CloseGUIStack
   ret
   
myWindowStuff:
myGUIRLargeWin:
   .dw myGUIRButtonImg-myGUIRLargeWin
   .db 1
   .db 0FFh,88h,88h,88h,0FFh
   .db "I am a test window!",0
myGUIRButtonImg:
   .dw myGUIRTextLineIn-myGUIRButtonImg
   .db 8
   .db 2,2
   .dw Explode
   .db 1
   .db 6
   .db 0FFh,0FFh,0FFh,0FFh,0FFh
myGUIRTextLineIn:
   .dw myGUIRByteInt-myGUIRTextLineIn
   .db 9
   .db 10
   .db 5
   .db 10
   .dw 12
   .dw 00
   .db "Enter Text!",0
myGUIRByteInt:
   .dw myGUIRWinButtons-myGUIRByteInt
   .db 12
   .db 30
   .db 30
   .db 122
   .db 5
   .db 200
myGUIRWinButtons:
   .dw myWindowStuffEnd-myGUIRWinButtons
   .db 5
   .db %00100000
   .dw 0
   .dw 0
   .dw Exit
myWindowStuffEnd:
   .db 0FFh,0FFh

Description:
   .db "A random test of the GUI",0   ;can be omitted if .dw Description is .dw 0000 above
Icon:            ;a 16x16 icon (can be omitted if .dw Icon is .dw 0000 above)
   .db %11111111,%11111000
   .db %10000000,%00001100
   .db %10111100,%00001010
   .db %10010010,%00001111
   .db %10010010,%01010001
   .db %10010010,%10101001
   .db %10111100,%01010101
   .db %10000000,%00000001
   .db %10101010,%10101001
   .db %10010101,%01010101
   .db %10101010,%10101001
   .db %10000000,%00000001
   .db %10010101,%01010101
   .db %10101010,%10101001
   .db %10000000,%00000001
   .db %11111111,%11111111


Here is my code, for whatever reason it crashes as soon as you click either close, or the button that's in the top left corner. I'll need to space everything out in a while, but first I want it to work.
If you read the documentation on GUIMouse carefully, either on the wiki or on page 111 of the SDK:


Code:
Technical Details
Please note three issues when calling GUIMouse:
[blah blah]
3. You must call ResetAppPage as the VERY FIRST instruction anywhere in your program to which GUIMouse might jump


tl;dr: RTFM. Laughing
x.x I had even read that part... at least 3 times. Oh well I guess Razz It works now, so now I need to set it up to actually do something when you click Razz
_player1537 wrote:
x.x I had even read that part... at least 3 times. Oh well I guess Razz It works now, so now I need to set it up to actually do something when you click Razz
Awesome. Hopefully you're finding it fairly straightforward and well-documented so far?
Yep Very Happy
  
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
Page 1 of 2
» All times are UTC - 5 Hours
 
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

 

Advertisement