Author Topic: WinAPE bug??  (Read 1714 times)

0 Members and 1 Guest are viewing this topic.

Offline CPCLER

  • CPC664
  • ***
  • Posts: 104
  • Country: dk
  • Pecunia non olet
  • Liked: 3
  • Likes Given: 37
WinAPE bug??
« on: 16:13, 22 March 09 »
I seem to have a problem when doing conditional assembly and making use of the fabulous relocate table function at the same time in winape assembler.

this code makes the assembler freeze:

Code: [Select]
org    &4000

let     a = 1

jp    dosomething

if     a = 0

relocate_start
dw relocate_count
relocate_end
endif

.dosomething

ld    hl,data
ld    de,&2000
ld    bc,9*2
ldir
ret

.data dw 1,2,3,4,5,6,8,9

I am converting a small Amsdos utility to SymbOS and want the source for both versions in the same file.
SymbOS makes use of the relocate facility, but it seems there are some problems when doing conditional assembly at the same time....

Never succeeded in bringing down the assembler before!

Is this a bug or am I doing something wrong?

/CPCLER

Offline Executioner

  • Supporter
  • 6128 Plus
  • *
  • Posts: 783
  • Country: au
  • WinAPE Developer
    • WinAPE
  • Liked: 391
  • Likes Given: 60
Re: WinAPE bug??
« Reply #1 on: 01:47, 24 March 09 »
Is this a bug or am I doing something wrong?

Hi CPCLER, it's a bug. WinAPE appears to attempt to evaluate the relocation count even though it's inside the false condition, but the previous relocate_start wasn't processed, so it tries to generate an error and gets into an infinite loop trying to skip to the end of the line. I've fixed this for the next release.

Offline CPCLER

  • CPC664
  • ***
  • Posts: 104
  • Country: dk
  • Pecunia non olet
  • Liked: 3
  • Likes Given: 37
Re: WinAPE bug??
« Reply #2 on: 12:07, 25 March 09 »
Hi Executioner

Excellent, looking forward to the next release of WinAPE. My fav development to for CPC!  :)

There is however a way to bypass the bug.

Code: [Select]
relocate_start

org    &4000

let     a = 0

jp    dosomething

if     a = 1

.rel dw relocate_count

else
     dw 1002
.rel dw &FFFF

endif

.dosomething

ld    hl,data
ld    de,&2000
ld    bc,9*2
ldir
ret

.data dw 1,2,3,4,5,6,8,9

relocate_end

Regards,
CPCLER

Hi CPCLER, it's a bug. WinAPE appears to attempt to evaluate the relocation count even though it's inside the false condition, but the previous relocate_start wasn't processed, so it tries to generate an error and gets into an infinite loop trying to skip to the end of the line. I've fixed this for the next release.