RTE under basic program ..pascal ,gfa ,omikron,basic

GFA, ASM, STOS, ...

Moderators: simonsunnyboy, Mug UK, Zorro 2, exxos, Moderator Team

Re: RTE under basic program ..pascal ,gfa ,omikron,basic

Postby christos » Mon Feb 07, 2011 1:36 am

Tomchi wrote:Sorry i could not help you more.


Don't be so sad. It's not your fault you couldn't help :)
Felix qui potuit rerum cognoscere causas.
My Atari blog

STOT Email address: stot(NoSPAM)atari(DOT)org
User avatar
christos
Fuji Shaped Bastard
Fuji Shaped Bastard
 
Posts: 2108
Joined: Tue Apr 13, 2004 8:24 pm
Location: Greece

Re: RTE under basic program ..pascal ,gfa ,omikron,basic

Postby charles » Mon Feb 07, 2011 1:52 am

of course he couldn't help ,
have you seen that bludgering he did

neat but destructive

unstable
and does not run under the editor
can not be reconfigured to work with other timers

charles
atari is my lifestyle,not a hobby.
User avatar
charles
10 GOTO 10
10 GOTO 10
 
Posts: 1854
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada

Re: RTE under basic program ..pascal ,gfa ,omikron,basic

Postby spiny » Mon Feb 07, 2011 10:08 am

charles wrote:of course he couldn't help ,
have you seen that bludgering he did

neat but destructive

unstable
and does not run under the editor
can not be reconfigured to work with other timers

charles



irony meter at critical !
User avatar
spiny
Disk Imager Supreme
Disk Imager Supreme
 
Posts: 1739
Joined: Mon Aug 11, 2003 11:53 pm
Location: just outside bristol

Re: RTE under basic program ..pascal ,gfa ,omikron,basic

Postby Tomchi » Mon Feb 07, 2011 1:10 pm

well as soon as i posted the code, it was meant to be used, modifyied by anyone, so do what you want with it, whatever moderized may mean even if it's to say my code doesn't work or yours is better.

Now don't say my code is unstable, coz the timer b example is just correct and very stable, now what bludgering mean i don't know, does not run in editor is just common thing as far as you code decent speed things with GfA overmore when GfA wasn't designed for the thing, cannot be configured to work with other timers just involves yourself .

the post asked for a way to make an RTE in a basic language, i showed you what i do ... Never spoke about being XX years experimenting things, now it doesn't work at first try for your purpose but still it writes an RTE , so please charles, don't pee on my code coz others are kidding you and you feel being better than me, coz you're far from that, thx.
There's no way to happiness, happiness is the way ...
click
Noextra
User avatar
Tomchi
Captain Atari
Captain Atari
 
Posts: 360
Joined: Sat Jun 10, 2006 5:17 pm
Location: Au bord de la rivière

Re: RTE under basic program ..pascal ,gfa ,omikron,basic

Postby charles » Mon Feb 07, 2011 3:01 pm

don't get me wrong
iam not peeing on your code
i am just making a point that a code which won't run in the editor is close to poo poo for my uses and trivial practise, how is this practical to design a program if users have to stop the editor , load the compilliier and compille
every time they want to see if the code thay are working on is "proofed right" ?

any how it doesn't work correctily and is a unstable method as i illustrated in my example , it only works for the installed timerb vector and is non transferable to the timer a vector
this means something is wrong if the same technque can not be applyed twice

i'll check again . but i'm afraid i do not like or really approve of hacks like this (frustrating to not see at edit time whats going on)

and yes like you said this is just one of many ways to do this
i'll find more!!!!!!!!!!!!!!!!!

thanks for work tomchi
charles
atari is my lifestyle,not a hobby.
User avatar
charles
10 GOTO 10
10 GOTO 10
 
Posts: 1854
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada

Re: RTE under basic program ..pascal ,gfa ,omikron,basic

Postby christos » Mon Feb 07, 2011 3:15 pm

charles wrote:don't get me wrong
iam not peeing on your code
i am just making a point that a code which won't run in the editor is close to poo poo for my uses and trivial practise, how is this practical to design a program if users have to stop the editor , load the compilliier and compille

charles


You realise that you don't really have to quit the editor with gfa 3.6TT. There's the menu.prg thingy..
Felix qui potuit rerum cognoscere causas.
My Atari blog

STOT Email address: stot(NoSPAM)atari(DOT)org
User avatar
christos
Fuji Shaped Bastard
Fuji Shaped Bastard
 
Posts: 2108
Joined: Tue Apr 13, 2004 8:24 pm
Location: Greece

Re: RTE under basic program ..pascal ,gfa ,omikron,basic

Postby lp » Mon Feb 07, 2011 5:17 pm

charles wrote:don't get me wrong
iam not peeing on your code
i am just making a point that a code which won't run in the editor is close to poo poo for my uses and trivial practise, how is this practical to design a program if users have to stop the editor , load the compilliier and compille
every time they want to see if the code thay are working on is "proofed right" ?


Calling it poo poo is like saying its sh*t. You probably burned another bridge. :roll:

You didn't ask for a solution that worked in the editor, you ask for a solution which left the door open for any solution. Then you get one, can't make it work, now its Tomchi's fault. Its actually your fault.

If you are having to quit the editor, reload the source by hand every time you need to edit it, then obviously your development environment sucks. There are shells and multi-tasking operating systems that ease this process. Again this is your problem.

i'll check again . but i'm afraid i do not like or really approve of hacks like this (frustrating to not see at edit time whats going on)


Then you should of stated you wanted a solution that works in the editor from the get go. As if its any worse than the peeking and poking you do all over your code that we have seen in the past. :lol:

and yes like you said this is just one of many ways to do this
i'll find more!!!!!!!!!!!!!!!!!


There's really only 2 ways, the method Tomchi uses or write the interrupt in asm and install it. Apparently you are trying to avoid the assembler. You were also told BASIC was not designed for this sort of thing.
User avatar
lp
Atari God
Atari God
 
Posts: 1772
Joined: Wed Nov 12, 2003 11:09 pm
Location: My desk

Re: RTE under basic program ..pascal ,gfa ,omikron,basic

Postby wongck » Mon Feb 07, 2011 11:58 pm

Tomchi wrote:now what bludgering mean i don't know.


Right... Google define seems to also run out of ideas of what it means... :roll:

Watching at the side lines is such fun with Charles in the match. :wink:
My Stuff: Falcon CT63+CTPCI ATI R7500 14+512MB 30GB HDD CF HxC_SD EtherNEC/ FB/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list
User avatar
wongck
Ultimate Atarian
Ultimate Atarian
 
Posts: 10758
Joined: Sat May 03, 2008 2:09 pm
Location: Far East

Re: RTE under basic program ..pascal ,gfa ,omikron,basic

Postby charles » Tue Feb 08, 2011 1:52 am

thanks all clear in a cloudy sort of way

charles
atari is my lifestyle,not a hobby.
User avatar
charles
10 GOTO 10
10 GOTO 10
 
Posts: 1854
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada

Re: RTE under basic program ..pascal ,gfa ,omikron,basic

Postby wongck » Tue Feb 08, 2011 7:00 am

charles wrote:thanks all clear in a cloudy sort of way
charles

Guess the reason is that it's snowy in Canada.
My Stuff: Falcon CT63+CTPCI ATI R7500 14+512MB 30GB HDD CF HxC_SD EtherNEC/ FB/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list
User avatar
wongck
Ultimate Atarian
Ultimate Atarian
 
Posts: 10758
Joined: Sat May 03, 2008 2:09 pm
Location: Far East

Re: RTE under basic program ..pascal ,gfa ,omikron,basic

Postby charles » Tue Feb 08, 2011 7:16 am

Tomchi wrote:
now what bludgering mean i don't know

that implies decompostion

like saying " whats 1 and 1 "

and you say its "5 - 3"

we are both correct but asm or pure asm or even machine is more correct to a basic


so no object can envoke RTE?
atari is my lifestyle,not a hobby.
User avatar
charles
10 GOTO 10
10 GOTO 10
 
Posts: 1854
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada

Re: RTE under basic program ..pascal ,gfa ,omikron,basic

Postby lp » Tue Feb 08, 2011 8:47 am

I think he ate the yellow snow. :lol:
User avatar
lp
Atari God
Atari God
 
Posts: 1772
Joined: Wed Nov 12, 2003 11:09 pm
Location: My desk

Re: RTE under basic program ..pascal ,gfa ,omikron,basic

Postby charles » Tue Feb 08, 2011 2:21 pm

don't set me into passive mode
nothing will get written

charles
atari is my lifestyle,not a hobby.
User avatar
charles
10 GOTO 10
10 GOTO 10
 
Posts: 1854
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada

Re: RTE under basic program ..pascal ,gfa ,omikron,basic

Postby Nyh » Tue Feb 08, 2011 3:02 pm

Tomchi wrote:
Code: Select all
    PROCEDURE timer_b
      ~1                                          ! to locate start of procedure
      ~1                                          ! and to be replaced by the save registers machine code
      ' interrupt code
      CARD{&HFFFF8240}=CARD{rst%}                 ! rasterbar
      CARD{&HFFFF825E}=CARD{rst15%}               ! colour 15 rasters
      ADD rst%,2                                  ! points to next
      ADD rst15%,2                                ! points to next
      '
      BYTE{&HFFFFFA0F}=BCLR(BYTE{&HFFFFFA0F},0)   ! interupt is done
      '
      ~2                                          ! to locate end of procedure
      ~2                                          ! and to be replaced by the restore registers machine code
    RETURN

Now this is some naughty code. This will indeed work for rasters. It will however not work for timer interrupts because they might happen during a VBL interrupt (and a raster interrupt won't).

Simple advice to Charles: write your interrupt routines in assembly. There is no simple solution possible in Basic or Pascal. Having the RTE command is only a little part of the problem of writing an interrupt routine in Basic.

Hans Wessels
User avatar
Nyh
Atari God
Atari God
 
Posts: 1487
Joined: Tue Oct 12, 2004 2:25 pm
Location: Netherlands

Re: RTE under basic program ..pascal ,gfa ,omikron,basic

Postby charles » Tue Feb 08, 2011 3:19 pm

nyh just optimized my day!! thanks
this explaination is what we were looking for

1+1 =5-3

i told tomchi my code wasn't suitable for my application

and other frowned upon this
especially the moderator
who got easilly bent out of shape

wheres mine ?

whats up?

charles
atari is my lifestyle,not a hobby.
User avatar
charles
10 GOTO 10
10 GOTO 10
 
Posts: 1854
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada

Re: RTE under basic program ..pascal ,gfa ,omikron,basic

Postby charles » Tue Feb 08, 2011 3:25 pm

so basically i have to add a little more code to my dervirved tomchis ,
like if vbl interupt happening

do not read my variable?



is this suggestable?

charles
atari is my lifestyle,not a hobby.
User avatar
charles
10 GOTO 10
10 GOTO 10
 
Posts: 1854
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada

Re: RTE under basic program ..pascal ,gfa ,omikron,basic

Postby Tomchi » Tue Feb 08, 2011 4:09 pm

Nyh wrote:Now this is some naughty code. This will indeed work for rasters. It will however not work for timer interrupts because they might happen during a VBL interrupt (and a raster interrupt won't).


Hans Wessels



I don't understand why it doesn't work. I have something working with timer A, so i thought VBL wasn't a problem, but then moving mouse or even doing a PRINT would crash the proggy.

Could you enlighhten me Nyh plz, about what happens if the interrupt occurs during a VBL and why asm would work and converted gfa won't ?
There's no way to happiness, happiness is the way ...
click
Noextra
User avatar
Tomchi
Captain Atari
Captain Atari
 
Posts: 360
Joined: Sat Jun 10, 2006 5:17 pm
Location: Au bord de la rivière

Re: RTE under basic program ..pascal ,gfa ,omikron,basic

Postby charles » Tue Feb 08, 2011 4:19 pm

here is my 2 cents

its interupt driven
the interupt is set off pulse , pulse is from a timer
if something else is refreshing under the interupt ,(at the same time) the forced action interferrs with installed action
and clogs the system, delay cpu execution,and
causing misfired exceptions
result "bomby" the sequel no not from disney!!!!!

but to write all this out in a more technical code explanation
i would be here long than some people like

charles
atari is my lifestyle,not a hobby.
User avatar
charles
10 GOTO 10
10 GOTO 10
 
Posts: 1854
Joined: Tue Aug 17, 2004 12:11 am
Location: ont. Canada

Re: RTE under basic program ..pascal ,gfa ,omikron,basic

Postby Nyh » Tue Feb 08, 2011 4:29 pm

charles wrote:so basically i have to add a little more code to my dervirved tomchis ,
like if vbl interupt happening

do not read my variable?

Yes indeed!

It is that simple!

The only thing you have to do is snatch the SR from the stack, read the interrupt mask bits and proceed if there is no VBL happening which only can be done in assembly.

We will completely ignore the fact that writing the interrupt routine is assembly is far easier and that you are completely incapable of writing such a framework in Gfa Basic. Because that doesn't matter.

Hans Wessels
User avatar
Nyh
Atari God
Atari God
 
Posts: 1487
Joined: Tue Oct 12, 2004 2:25 pm
Location: Netherlands

Re: RTE under basic program ..pascal ,gfa ,omikron,basic

Postby Nyh » Tue Feb 08, 2011 4:30 pm

Tomchi wrote:
Nyh wrote:Now this is some naughty code. This will indeed work for rasters. It will however not work for timer interrupts because they might happen during a VBL interrupt (and a raster interrupt won't).

Hans Wessels


I don't understand why it doesn't work. I have something working with timer A, so i thought VBL wasn't a problem, but then moving mouse or even doing a PRINT would crash the proggy.

Could you enlighhten me Nyh plz, about what happens if the interrupt occurs during a VBL and why asm would work and converted gfa won't ?

All variables in Gfa are referenced A5 relative (if I am not mistaken). When a VBL or mouse interrupt in interrupted by an other interrupt like your timer interrupt it just might be A5 is pointing to something completely else and reading or writing to A5 will have interesting effects which will result in bombs. Even during a print statement A5 isn't pointing where it is supposed to point during execution of compiled Gfa code.

There are 2 solutions to this problem:
1 don't touch any variables, use only pokes and peeks like
wpoke $ff8240,wpeek(lpeek($fc))
lpoke $fc,lpeek($fc)+2
$fc contains a pointer to your rasterbar table.
All unused exception vectors can be misused as variables for interrupt routines. Depending on the Gfa compiler there might be no need to save any register because the compiler will not use any registers. I am pretty sure the Omikron compiler will not use any registers for this code but I don't know the Gfa compiler that good.

2 set A5 to the correct value so you can touch variables. The right value for A5 has to be stored at an address that can be reached by the assembly at the start of the interrupt routine. This can not be done in Gfa basic.

Hans Wessels
User avatar
Nyh
Atari God
Atari God
 
Posts: 1487
Joined: Tue Oct 12, 2004 2:25 pm
Location: Netherlands

Re: RTE under basic program ..pascal ,gfa ,omikron,basic

Postby lp » Tue Feb 08, 2011 4:33 pm

charles wrote:don't set me into passive mode
nothing will get written


You've been in passive mode for 9+ years already. I tried to tell you some posts back that BASIC is not suitable for this, but you don't listen. Typical.

Its more than a5, GFA maintains registers a3-a5 always. If any of these change, GFA fails. Its stated in the manual which charles probably never fully read. It applies to the editor and the compiler. They work nearly identical.
Last edited by lp on Tue Feb 08, 2011 4:53 pm, edited 1 time in total.
User avatar
lp
Atari God
Atari God
 
Posts: 1772
Joined: Wed Nov 12, 2003 11:09 pm
Location: My desk

Re: RTE under basic program ..pascal ,gfa ,omikron,basic

Postby Nyh » Tue Feb 08, 2011 4:41 pm

lp wrote:Its more than a5, GFA maintains registers a3-a5 always. If any of these change, GFA fails. Its stated in the manual which he probably never fully read. It applies to the editor and the compiler. They work nearly identical.

I stand corrected. Thanks for the clarification. And yes, I didn't read the Gfa manual form front to back because, well, I never did do any programming in Gfa. :wink:

Hans Wessels
Last edited by Nyh on Tue Feb 08, 2011 4:45 pm, edited 1 time in total.
User avatar
Nyh
Atari God
Atari God
 
Posts: 1487
Joined: Tue Oct 12, 2004 2:25 pm
Location: Netherlands

Re: RTE under basic program ..pascal ,gfa ,omikron,basic

Postby Nyh » Tue Feb 08, 2011 4:44 pm

Stupid me. I did a double post. :oops:
User avatar
Nyh
Atari God
Atari God
 
Posts: 1487
Joined: Tue Oct 12, 2004 2:25 pm
Location: Netherlands

Re: RTE under basic program ..pascal ,gfa ,omikron,basic

Postby lp » Tue Feb 08, 2011 4:53 pm

Nyh wrote:
lp wrote:Its more than a5, GFA maintains registers a3-a5 always. If any of these change, GFA fails. Its stated in the manual which he probably never fully read. It applies to the editor and the compiler. They work nearly identical.

I stand corrected. Thanks for the clarification. And yes, I didn't read the Gfa manual form front to back because, well, I never did do any programming in Gfa. :wink:


he=charles

I meant charles, not you. :) Charles is the one trying to make GFA do things it was never meant to do, therefore its his responsibility to read the manual. I have gone back and corrected the post. :wink:
User avatar
lp
Atari God
Atari God
 
Posts: 1772
Joined: Wed Nov 12, 2003 11:09 pm
Location: My desk

Re: RTE under basic program ..pascal ,gfa ,omikron,basic

Postby simonsunnyboy » Tue Feb 08, 2011 4:55 pm

*Mod note* Locked as there is nothing more to say. This hacky technique works but its limitations have been made clear.

In short, BASIC on it's own was never designed nor meant to handle true hardware interrupts (be it timers or other hardware).

Generic solution: Ensure the problem to be solved really needs an interrupt routine and if it does, write this interrupt handler in assembly language or ask someone to do this for you.
Simon Sunnyboy/Paradize - http://paradize.atari.org/ - STOT: http://www.npoi.de/stot/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

Jabber: simonsunnyboy@atari-jabber.org
User avatar
simonsunnyboy
Moderator
Moderator
 
Posts: 4335
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany

PreviousNext

Return to Coding

Who is online

Users browsing this forum: CommonCrawl [Bot] and 0 guests