News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_SerErris

Winape Assembler/Debugger does weird things

Started by SerErris, 18:19, 26 September 23

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

SerErris

Hi all,

I have a problem with WinApe and I am not sure if I am seeing ghosts (sorry for the very bad translation from german).

I have this nice Assembler code (only a fraction of it):


org #8000

Main:
LD DE,&00
mainLoop: ;#8003 ;while StartAddress < EndAddress
PUSH IX ;Copy current Address to
POP     HL ;HL
LD      A,L ;Check if HL<BC
SUB C
LD A,H
SBC B
RET NC ;if HL<BC return (end address before start adress)
ADD HL,DE   ;Add offset to HL
CALL printAddress ;Print Address

This compiles perfectly. Looking at the debugger view it looks like that I am at breakpoint at #8000:
You cannot view this attachment.

So where it should read LD DE,0000 it reads LD DE,hl ??

The assembler did the right thing (11 00 00) is excatly the opcode for LD DE,0000

Also if I disassemble the code, it turns back into LD DE,#0000

That is absolutely strange and I never had it.

Anyone has any idea?
Proud owner of 2 Schneider CPC 464, 1 Schneider CPC 6128, GT65 and lots of books
Still learning all the details on how things work.

roudoudou

hl is in lower case so i guess this assembler lets you use hl as label or variable or symbol and you declared something related to this elsewhere
My pronouns are RASM and ACE

Prodatron

#2

This happens, if you define hl as a label with the value #0000
You cannot view this attachment.

WinApe is doing everything correctly.

GRAPHICAL Z80 MULTITASKING OPERATING SYSTEM

SerErris

Hm, okay I was not aware that I did use any label "hl". And Indeed I did not, however I hate that Winape Assembler does not correctly parse comments.

If you have a : in a comment, everything after it is not considered a comment anymore.

So this line.

; Destroys: HL

Which should be perfect fine, actually defines HL as a label! And as I do not asign anything its values is 0, so the assembler automatically replaces my code DE,&00 with DE,hl.

Thanks for clarifying that for me.
Proud owner of 2 Schneider CPC 464, 1 Schneider CPC 6128, GT65 and lots of books
Still learning all the details on how things work.

Jean-Marie

I had noticed this strange behavior regarding the comments. A solution is to type the semicolon twice, like :
;; comment here

Powered by SMFPacks Menu Editor Mod