Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Binary into asm
#4
Ok, so I got some weird results

First I compiled the following code:


Code:
art:
asm
incbin "final.bin"
end asm

pause 0
paper 0: ink 7: border 0: CLS

asm
ld hl,(.LABEL._art)
ld de,18432
ld bc,2048
ED
LDIR
RET
end asm

and it compiled ok, but produced no result (just finished the generated basic loader at line 30)

So, after some trial and error, I decided to try a goto 10 on the first line, and label the line with pause 0 with 10, therefore skipping the asm for the incbin (as it does not need to be executed, altough I assumed it would not be an issue)
This executed the second asm code, but I got gibberish instead of the expected drawing.

To check if there was something wrong with the bin file or something like that, I added the following basic code before the asm routine:

Code:
for n=0 to 2047
poke (18432+n), peek (@art+n)
next n
pause 0

This produced the desired art (but slower than the other assembly routine would); after the pause 0/ keypress, it run the asm and I got gibberish again.

Is there something wrong with my code, or is it some sort of bug?

Another try, I replaced the code with the following, turning the bin file non-relocatable:

Code:
GOTO 10

art:
asm
org 50000
incbin "final.bin"
end asm

10 pause 0
paper 0: ink 7: border 0: CLS

asm
ld hl,50000
ld de,18432
ld bc,2048
ED
LDIR
RET
end asm

This produced the expected image, but the program ended with the following message:

C Nonsense in BASIC, 30:1

(PS: It's not my intention to hardcode the image file)
Reply


Messages In This Thread
Binary into asm - by Nando - 07-31-2022, 12:27 AM
RE: Binary into asm - by boriel - 08-02-2022, 12:58 PM
RE: Binary into asm - by Nando - 08-02-2022, 01:51 PM
RE: Binary into asm - by Nando - 08-02-2022, 09:13 PM
RE: Binary into asm - by boriel - 08-02-2022, 10:21 PM
RE: Binary into asm - by Nando - 08-02-2022, 11:20 PM
RE: Binary into asm - by Nando - 08-05-2022, 03:19 AM
RE: Binary into asm - by boriel - 08-09-2022, 06:26 AM
RE: Binary into asm - by Nando - 08-09-2022, 12:12 PM
RE: Binary into asm - by boriel - 08-10-2022, 11:07 AM
RE: Binary into asm - by Nando - 08-10-2022, 07:39 PM
RE: Binary into asm - by boriel - 08-11-2022, 08:59 AM
RE: Binary into asm - by Nando - 08-11-2022, 12:10 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)