Alright, I've been trying forever to do these commands and need
serious help.Please tell me what I'm doing wrong...

Turning off the power:When I use these commands, my calc crashes when it turns back on...

DI
LD A,001h
OUT (003),A
LD A,000h
OUT (004),A
EX AF,AF'
EXX
EI

Storing to ans:I can't get my value to store to OP1...

LD HL,25
LD DE,OP1
LDIR
BCALL STOANS

Creating Programs:This always crashes...

LD HL,prgmname
LD DE,OP1
LD BC,5
LDIR
BCALL CHKFINDSYM
BCALL CREATEPROG
RET
prgmname:
.db PROGOBJ,"PRGM",0

It would be nice also if anyone who uses ONCALC COMPILER BETA 8 could tell me how to use these on it too.
xenonparadox wrote:
Alright, I've been trying forever to do these commands and need
serious help.Please tell me what I'm doing wrong...

Turning off the power:When I use these commands, my calc crashes when it turns back on...


Code:
DI
LD A,001h
OUT (003),A
LD A,000h
OUT (004),A
EX AF,AF'
EXX
EI
Here's how I usually do it:

Code:
   ld a,2
   out ($10),a ;turn off screen
   res OnInterrupt,(iy+OnFlags)
   res curAble,(iy+curFlags)
   call debounceon
   im 1
    eI         ; disable interrupts
   ld   a,1
   out   (3),a
   halt
   di
   res OnInterrupt,(iy+OnFlags)
   ld a,3
   out ($10),a ;turn off screen
   call debounceon
   ret
debounceon:
 in a,(4)
 bit 3,a
 jr z,debounceon
 ret


xenonparadox wrote:
Creating Programs:This always crashes...


Code:
LD HL,prgmname
LD DE,OP1
LD BC,5
LDIR
BCALL CHKFINDSYM
BCALL CREATEPROG
RET
prgmname:
.db PROGOBJ,"PRGM",0
Try this instead:
Code:
LD HL,prgmname
LD DE,OP1
LD BC,6  ;notice that PROGOBJ, "PRGM", 0 is SIX bytes, not 5
LDIR
BCALL CHKFINDSYM
BCALL CREATEPROG
RET
prgmname:
.db PROGOBJ,"PRGM",0
TANK OO TANK OO TANK OO...

However I still rest with the problem that I can't store to Op1 on the Oncalc compiler beta 8...Any suggestions?

Most of my work is done on the go and it would help alot when most all ASM commands are op1 based.

when I store values to op1 I use code like this...

LD HL,5
LD DE,Op1
LDIR

Last time I tried this my calc crashed so bad my OS was erased and everything on my calc disapeared
you forgot to set bc to how many bytes to move
and what you wanted to move probably wasn't at $0005, which is where you told it.

Code:
ld hl,address
rst mov9toOp1

it puts what is at address in OP1
You've inadvertently revealed the problem that xenonparadox is running into: Op1 can only hold **9 bytes**. You have to put your Ans string into something (hint: how about a temporary String variable?) and then point Op1 at that.
I always assumed ans was stored in OP format.
Will_W wrote:
I always assumed ans was stored in OP format.
Nope. Smile Note that little mov9toop1? Smile
KermMartian wrote:
You've inadvertently revealed the problem that xenonparadox is running into: Op1 can only hold **9 bytes**. You have to put your Ans string into something (hint: how about a temporary String variable?) and then point Op1 at that.
The OPn variables are 11 bytes each, not nine, for what it's worth.
but 2 of them are only used to get more precision when doing FP math
benryves wrote:
KermMartian wrote:
You've inadvertently revealed the problem that xenonparadox is running into: Op1 can only hold **9 bytes**. You have to put your Ans string into something (hint: how about a temporary String variable?) and then point Op1 at that.
The OPn variables are 11 bytes each, not nine, for what it's worth.
Sorry, yeah, that. Of course, they have to be to hold the 11 bytes of a real during use as temp reals for calculation.
I think the problem is using CREATEPROG the wrong way. Razz
calc84maniac wrote:
I think the problem is using CREATEPROG the wrong way. Razz
Oh yeah, that too. Very Happy I just assumed he was not failing at something that obvious. Wink
All three look like he wasn't really sure what the commands did when he wrote it. for example, the swap with the shadow registers in the first one. Why did you do that, xenon?
Will_W wrote:
All three look like he wasn't really sure what the commands did when he wrote it. for example, the swap with the shadow registers in the first one. Why did you do that, xenon?
Actually, that's kinda logical in this circumstance, since we're dealing with something interrupt-based (although completely wrong); I agree that the other ones are more trying to do BASIC-style cobbling of commands without understanding how the glue between them works. Smile
I used to write code like that, but I can't remember when or how I learned to write working z80.
I want to learn Z80 or ASM. Are there any good OnCalc assemblers, because I'm not an admin on my own laptop.
Xeno_Cre8or wrote:
I want to learn Z80 or ASM. Are there any good OnCalc assemblers, because I'm not an admin on my own laptop.
You don't have to be an admin to run assemblers like Brass or TASM. I usually use Brass and DevPac8x; my favorite tutorial is z80 ASM in 28 Days.
KermMartian wrote:
Xeno_Cre8or wrote:
I want to learn Z80 or ASM. Are there any good OnCalc assemblers, because I'm not an admin on my own laptop.
You don't have to be an admin to run assemblers like Brass or TASM. I usually use Brass and DevPac8x; my favorite tutorial is z80 ASM in 28 Days.

But u need to be an admin to install them.
Xeno_Cre8or wrote:
KermMartian wrote:
Xeno_Cre8or wrote:
I want to learn Z80 or ASM. Are there any good OnCalc assemblers, because I'm not an admin on my own laptop.
You don't have to be an admin to run assemblers like Brass or TASM. I usually use Brass and DevPac8x; my favorite tutorial is z80 ASM in 28 Days.

But u need to be an admin to install them.
No, they're both just executables. You just download them and run them to assemble stuff.
I blame my ignorance of the CREATPROG function on the creator of ASM Guru.About 96% of all his examples have crashed my calc.

So I was wondering, when calc84 made Beta Compiler 8, why didn't he combine the ZCOMPILE prgms into one asm prgm?

Or maybe capitalize all commands with the exception of the .db command?With only four ways to write .db (.db .DB .Db .dB) it takes little extra space and would allow lowercase characters.

Just as a quick add-in how do you use the DoorsCS library commands in Beta Compiler?This doesn't work...


Code:

xor d
ret
jr start
.dw 0
.db 6,0
.dw 0
.dw 0
start:
call largewindow
ld hl,title
call vputs
call guimouse
call pause
ret


I know this ones gonna give me more criticism than Britney Spear's haircut in 2000...

Just so no one thinks Kerm's paranoid, calc84 used to be Kerm... sorry...

Can someone tell me if there is a better compiler than Beta Compiler 8?
  
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