Ants Pants
2015-04-07 04:03:09 UTC
Hi Guys,
im having problems with z80asm compiling a simple test program. im using
the org statement so the code gets compiled to run at 0xB000, but whenever
i compile with z80asm it gives me back the program starting at 0x0000, i
have ported the source for compatibility with TASM and compiled it with
this and i get what is expect, code at 0xB000. i have been through the
manual for z80asm but i cant seem to figure out what im doing wrong.
included below is the source ive attempted to compile with z80asm and the
output in intel .hex format - that i have but spaces in between the
bytecount/address/rtype/Data/check for easier reading:
;--------------------------------------------------------------
gpport: equ 0x21
ORG 0xB000
start:
LD A, 0xFf
out (gpport), a
call DELAY2
LD A, 0xF0
out (gpport), a
call DELAY2
jp start
DELAY2:
LD C,0x91 ;d1
LD B,0xE1 ;d2
LD A,0x23 ;d3
again31:
DEC C
JP Z, again30
JP again31
again30:
DEC B
JP Z, again32
JP again31
again32:
DEC A
JP Z, again33
JP again31
again33:
RET
;--------------------------------------------------------------
:20 0000 00 3EFFD321CD11B03EF0D321CD11B0C300B00E9106E13E230DCA1EB0C317B005C
A19
:0D 0020 00 25B0C317B03DCA2CB0C317B0C9 3E
:00 0000 01 FF
with the starting address in pink z80asm compiled to start at 0x0000
As compared to TASM with a similar source, just modifications to syntax:
;--------------------------------------------------------------
gpport: .equ $21
.ORG $B000
start:
LD A, $Ff
out (gpport), a
call DELAY2
LD A, $F0
out (gpport), a
call DELAY2
jp start
DELAY2:
LD C,$91 ;d1
LD B,$E1 ;d2
LD A,$23 ;d3
again31:
DEC C
JP Z, again30
JP again31
again30:
DEC B
JP Z, again32
JP again31
again32:
DEC A
JP Z, again33
JP again31
again33:
RET
.END
;--------------------------------------------------------------
:18 B000 00 3EFFD321CD11B03EF0D321CD11B0C300B00E9106E13E230D 62
:15 B018 00 CA1EB0C317B005CA25B0C317B03DCA2CB0C317B0C9 9D
:00 0000 01 FF
with the starting address in pink TASM compiled to start at 0xB000
As you can see the machine code is the same, just the org address is
different in the hex file. anyone have an idea of what im doing wrong in
the first source to be compiled with z80asm?
Many thanks,
Antony
im having problems with z80asm compiling a simple test program. im using
the org statement so the code gets compiled to run at 0xB000, but whenever
i compile with z80asm it gives me back the program starting at 0x0000, i
have ported the source for compatibility with TASM and compiled it with
this and i get what is expect, code at 0xB000. i have been through the
manual for z80asm but i cant seem to figure out what im doing wrong.
included below is the source ive attempted to compile with z80asm and the
output in intel .hex format - that i have but spaces in between the
bytecount/address/rtype/Data/check for easier reading:
;--------------------------------------------------------------
gpport: equ 0x21
ORG 0xB000
start:
LD A, 0xFf
out (gpport), a
call DELAY2
LD A, 0xF0
out (gpport), a
call DELAY2
jp start
DELAY2:
LD C,0x91 ;d1
LD B,0xE1 ;d2
LD A,0x23 ;d3
again31:
DEC C
JP Z, again30
JP again31
again30:
DEC B
JP Z, again32
JP again31
again32:
DEC A
JP Z, again33
JP again31
again33:
RET
;--------------------------------------------------------------
:20 0000 00 3EFFD321CD11B03EF0D321CD11B0C300B00E9106E13E230DCA1EB0C317B005C
A19
:0D 0020 00 25B0C317B03DCA2CB0C317B0C9 3E
:00 0000 01 FF
with the starting address in pink z80asm compiled to start at 0x0000
As compared to TASM with a similar source, just modifications to syntax:
;--------------------------------------------------------------
gpport: .equ $21
.ORG $B000
start:
LD A, $Ff
out (gpport), a
call DELAY2
LD A, $F0
out (gpport), a
call DELAY2
jp start
DELAY2:
LD C,$91 ;d1
LD B,$E1 ;d2
LD A,$23 ;d3
again31:
DEC C
JP Z, again30
JP again31
again30:
DEC B
JP Z, again32
JP again31
again32:
DEC A
JP Z, again33
JP again31
again33:
RET
.END
;--------------------------------------------------------------
:18 B000 00 3EFFD321CD11B03EF0D321CD11B0C300B00E9106E13E230D 62
:15 B018 00 CA1EB0C317B005CA25B0C317B03DCA2CB0C317B0C9 9D
:00 0000 01 FF
with the starting address in pink TASM compiled to start at 0xB000
As you can see the machine code is the same, just the org address is
different in the hex file. anyone have an idea of what im doing wrong in
the first source to be compiled with z80asm?
Many thanks,
Antony
--
You received this message because you are subscribed to the Google Groups "N8VEM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to n8vem+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/n8vem.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "N8VEM" group.
To unsubscribe from this group and stop receiving emails from it, send an email to n8vem+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/n8vem.
For more options, visit https://groups.google.com/d/optout.