Author Topic: interrupt help  (Read 2918 times)

0 Members and 1 Guest are viewing this topic.

Offline Geekboy1011

  • The Oneironaut
  • Donator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2031
  • Rating: +119/-2
  • Dream that Awakening dream
    • View Profile
interrupt help
« on: September 27, 2010, 06:33:34 pm »
ok so i finally started trying to learn axe and well i figured im going to need interupts for a program i want to make and thus went gung ho trying to make a counter that work with interrupts

a couple dozen or so ram clears later im still confused and still dont have a working program :/

any help please ^_^

Code: [Select]
.aaint
1->A
fNint(go,6)
while 1
if getkey(9)=1
goto end
end
end

lbl go
Disp a>dec,[i]
fnon
A+1->A
return

lbl end
fnoff
lnreg
« Last Edit: September 27, 2010, 06:34:34 pm by Geekboy1011 »

Offline shmibs

  • しらす丼
  • Administrator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2132
  • Rating: +281/-3
  • try to be ok, ok?
    • View Profile
    • shmibbles.me
Re: interrupt help
« Reply #1 on: September 27, 2010, 07:02:46 pm »
are you just trying to make the program stay in a loop, incrementing and displaying A via interrupt until (9) is pressed?

if so, you should do this:

Code: [Select]
:.A
:1->AFnInt(GO,6
:FnOn
:Repeat getkey(9)
:Pause 3 //im not entirely sure why this has to be here, but it does(only if you're doing a repeat loop with end immediately afterwards, though). ask quigibo
:End
:LnReg
:Return
:Lbl GO
:A+1->ADisp A▶Dec, i

does help?

Offline Geekboy1011

  • The Oneironaut
  • Donator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2031
  • Rating: +119/-2
  • Dream that Awakening dream
    • View Profile
Re: interrupt help
« Reply #2 on: September 27, 2010, 07:07:46 pm »
yeah that is what im trying to do but its still crashes on me :/ it counts up to 7 then it freezes X.x

Offline shmibs

  • しらす丼
  • Administrator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2132
  • Rating: +281/-3
  • try to be ok, ok?
    • View Profile
    • shmibbles.me
Re: interrupt help
« Reply #3 on: September 27, 2010, 07:36:35 pm »
hmm... maybe it's something to do with that Disp command?
try swapping it with text(0,0,A▶Dec

Offline Geekboy1011

  • The Oneironaut
  • Donator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2031
  • Rating: +119/-2
  • Dream that Awakening dream
    • View Profile
Re: interrupt help
« Reply #4 on: September 27, 2010, 07:43:12 pm »
that works
so its the display command thank you very much shmibs XD

although now im wondering y its acting liek that :/

Offline shmibs

  • しらす丼
  • Administrator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2132
  • Rating: +281/-3
  • try to be ok, ok?
    • View Profile
    • shmibbles.me
Re: interrupt help
« Reply #5 on: September 27, 2010, 07:53:15 pm »
i've never actually used Disp for anything, but maybe ,i command and the interrupt are fighting over ram space? either that or you just aren't supposed to move the cursor onto line 9 which would be outside the 128 byte range of the text shadow...

EDIT: does anything different happen if you dont use the interrupt and just increment A and use the Disp A▶Dec,i command inside the repeat loop?
DOUBLE EDIT: it's definitely a conflict with the interrupt. i tried it in wabbit and it worked fine until 861(apart from not exiting when the key was pressed), and then froze
« Last Edit: September 27, 2010, 08:06:06 pm by shmibs »

Offline Geekboy1011

  • The Oneironaut
  • Donator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2031
  • Rating: +119/-2
  • Dream that Awakening dream
    • View Profile
Re: interrupt help
« Reply #6 on: September 27, 2010, 08:04:11 pm »
nope runs fine when not using a interupt :/