Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Xeda112358

Pages: 1 ... 204 205 [206] 207 208 ... 317
3076
Grammer / Re: Grammer
« on: October 13, 2011, 01:55:25 pm »
I love that part, yeong :D

Here is an update on the things that have been changed or added:

DispGraph can now have a pointer to tell it which buffer to display. For example, if you want to display appBackUpScreen as a buffer, you can do DispGraphπ9872. To display the normal graph screen, just do DispGraphπ9872 (remember that the pi symbol tells it to read the number as hex). If you omit the argument, it will just display the default buffer.

Disp will let you change the default buffer location. For example, if you want to use appBackUpScreen instead of the graph screen, just do Disp π9872.

Func will let you execute a subroutine as an interrupt. Interrupts activate a little over one hundred times per second, regardless of what is happening code wise. For example, this will automatically display the graph screen, even if you don't have any other DispGraphs in your code:
Code: [Select]
FuncLbl "INTERRUPT     ;the Lbl "INTERRUPT part will return the location of the routine
Repeat getKey=15
rand/1024→Y
rand/683→X
rand/1024→R
Circle(Y,X,R,3
End
Goto Lbl "Stop          ;Jumps to the end of the code
.INTERRUPT
DispGraph
End                   ;Ends the interrupt
.Stop
Stop
Note that this isn't optimised XD

And finally, the Send( command will let you make a program or appvar of any size you want (assuming there is enough memory). So to create the program named HI with 768 bytes (which can be used as a screen buffer):
Code: [Select]
Send(768,"EHI
Programs have a prefix of "E", protected programs have a prefix of "F" and appvars have a prefix of "U"
This also returns the location of the variable in case you are using it for a buffer *cough*

Hopefully the next update will include a readme that is up to date and has more examples/explanations. For now, here is a screenie and the latest version of Grammer. Feel free to ask questions (as well as how to do things)!

3077
ASM / Re: Interrupt Questions
« on: October 13, 2011, 08:41:40 am »
After the call to ParserNext, IprogPtr is never updated. I'm not sure if ParserNext is supposed to advance any pointers, but it certainly won't here. Also, for those of us who don't have the Z80 opcode table memorized, you should add a comment for .db 21h that says ; ld hl, imm16

The only other thing that comes to mind is that you need to make ensure that ParseNext completes quickly or else the main code won't run. Also, make sure that the routine never EIs. Check to make sure the interrupt vector table is correct. And don't even think of running that from flash.
Okay, thanks! The call actually takes care of the progPtr stuff and that is working fine, but the routine does in fact use EI, so I will try to work around that.
I have ideas >.>

Thanks much! I will see if this works :)

EDIT: It works! Here is how I fixed it:
In the interrupt, I set a flag and then reset it as it finishes
In the program code, whenever I need to EI, I check that flag first to see if it is okay
And it works now :) I am now executing Grammer code as an interrupt that updates the LCD

Is there a better way to check if an interrupt is currently executing? I am pretty sure I saw a way, so I will check.

3078
ASM / Re: Interrupt Questions
« on: October 12, 2011, 11:21:55 pm »
Okay, well this is the current version that I am toying with. I added some code because it seemed to recursively call itself and I wanted to fix that a little.

Code: [Select]

interrupt:
;     or a \ ret nc
     push af
     push bc
     push de
     push hl
     ld hl,(progPtr)
     push hl
     .db 21h
IprogPtr:
     .dw 0
     ld a,h \ or l
     jr z,EndExec
 jr nz,$
       ld (progPtr),hl
       ld (IprogPtr2),hl
       sbc hl,hl \ ld (IprogPtr),hl
       call ParserNext
       .db 21h
IprogPtr2:
       .dw 0
       ld (IprogPtr),hl
EndExec:
     sub a
     out (3),a
     ld a,%00001011
     out (3),a
     pop hl
     ld (progPtr),hl
     pop hl
     pop de
     pop bc
     pop af
     ei
     ret
interrupt_end:
EDIT: I have the jr nz,$ for debugging puproses

3079
ASM / Re: Interrupt Questions
« on: October 12, 2011, 11:11:15 pm »
The current one is the one up at the top with the changes suggested.

3080
KnightOS / Re: AsmOS - A basic version of Knight Kernel
« on: October 12, 2011, 10:52:50 pm »
Good point :P

3081
KnightOS / Re: AsmOS - A basic version of Knight Kernel
« on: October 12, 2011, 10:39:51 pm »
I've always wanted to make rst routines...
Yeah, that just seems like an amazing thing to play with O.O

EDIT: Also, I was a little disappointed that this wasn't a BASIC version of Knight Kernel :P

3082
Miscellaneous / Re: How many Englisch words do you know?
« on: October 12, 2011, 10:37:53 pm »
I don't know how reputable this is, then... If clicking everything returns two different results, I dunno.

Also, I got 25100, but I am a native speaker. I found that my knowledge of french helped a lot, too.

3083
ASM / Re: Interrupt Questions
« on: October 12, 2011, 10:18:50 pm »
Hmm, I have tried these suggestions, but they aren't working. I also notice that whenever I open the debugger in Wabbit, the interrupt is executing. I feel like it might be activating too often. Does the interrupt automatically execute after certain conditions?

EDIT: Here is the installer code:
Code: [Select]
     di
     ld hl,interrupt
     ld de,8A8Ah
     ld bc,interrupt_end - interrupt
     ldir

     ld hl,8000h
     ld de,8001h
     ld bc,256
     ld (hl),8Ah
     ldir

     ld a,80h
     ld i,a
     im 2
It is inline which is why there is no "ei" or "ret" (the ei comes later).

3084
ASM / Interrupt Questions
« on: October 12, 2011, 05:36:19 pm »
Okay, I have this code that is causing a crash for me and I am trying to figure out why:
Code: [Select]
interrupt:
     push af
     push bc
     push de
     push hl
     ld hl,(progPtr)
     push hl
     .db 21h
IprogPtr:
     .dw 0
     ld a,h \ or l
     ld (progPtr),hl
     call nz,ParserNext
EndExec:
     pop hl
     ld (progPtr),hl
     pop hl
     pop de
     pop bc
     pop af
     ret
interrupt_end:
This is for Grammer which is why I am asking. (progPtr) is the program counter and calling ParserNext will parse the data at progPtr.

I also disable interrupts and switch it back to mode 1 before exiting the program in case I need to do that

3085
TI-BASIC / Re: Use of seq()? (83/84)
« on: October 12, 2011, 01:01:33 pm »
seq(f(X),X,n,m) where f(X) is an equation, n is the lower bound, and m is the upper bound. For example, seq(X^3+3X2+3X+1,X,0,5)

3086
Grammer / Re: Grammer
« on: October 12, 2011, 07:53:11 am »
Thanks much Yeong! But now I have to see how I can use the variance( token, because that seems neat... XD

3087
Grammer / Re: Grammer
« on: October 12, 2011, 07:48:04 am »
Okay, cool. Um, I am looking through the Catalog and I see "Func" as a potential token (like executing a Function)

3088
Grammer / Re: Grammer
« on: October 12, 2011, 07:44:39 am »
Wow, that is a token?
Umm, is this on all OSes? (I notice it is a two-byte token)

3089
Grammer / Re: Grammer
« on: October 12, 2011, 07:39:43 am »
I was thinking of using that to increase the size of a var. So for example, to add bytes to the end of a program file in case it has map data or sprite data or something like that.

3090
Grammer / Re: Grammer
« on: October 12, 2011, 07:33:06 am »
Yeah, I already used that D: Which reminds me, a few posts back I posted a way to use arrays (involving int().

Here is the post link: http://ourl.ca/11664/251481

EDIT: You were looking for a way to do this, right?

Pages: 1 ... 204 205 [206] 207 208 ... 317