----------
org 8000h
C_WRITESTR equ 0x06 ; API function to print a $ terminated string
ld de, Hello_TXT ; Load the address of the Hello_TXT label into DE
ld c, C_WRITESTR ; C must contain BDOS function number
RST 0x30
ret ; Return to the SCM
Hello_TXT: db 0x0D,0x0A,"Hello World!",0x0D,0x0A,"$" ; The $ terminated string to be printed
-------
The assembler output:
z88dk-z80asm -v ./hwZ80.asm -b -l
Predefined constant: __CPU_Z80__ = 1
Predefined constant: __CPU_ZILOG__ = 1
Predefined constant: __FLOAT_GENMATH__ = 1
Assembling 'hwZ80.asm' to 'hwZ80.o'
Reading 'hwZ80.asm' = 'hwZ80.asm'
Writing object file 'hwZ80.o'
Module 'hwZ80' size: 24 bytes
Code size: 24 bytes ($8000 to $8017)
Creating binary './hwZ80.bin'
Then using appmake I create an Intel HEX file.
z88dk-appmake +hex -b ./hw.bin -o hw.hex --org 0x8000
----------
The resulting HEX output is:
:100000001107800E06F7C90D0A48656C6C6F205702
:080010006F726C64210D0A24DB
:00000001FF
----------
My problem is with pasting bytes from a HEX code generated by the z88dk assembler. If I paste into screen using the rightclick 'paste' menu option or use minicoms 'paste file' option I get this
Small Computer Monitor - Z50Bus/Z80
*:0009ED0D866:8057602200F
Bad command
-------
Can someone please tell me what I am doing wrong?
regards,
Rob
:100000001107800E06F7C90D0A48656C6C6F205702
:080010006F726C64210D0A24DB
:00000001FF
This is my HEX file:
:108000001107800E06F7C90A0A48656C6C6F205785
:108010006F726C64210D0A24FFFFFFFFFFFFFFFF5B
:00000001FF
Note that my first lines start ":108000" where yours start ":100000".
The first two bytes after the colon are the number of bytes of data in the line (eg. 10)
The next 4 are the start address (eg. 8000 for the first line and 8010 for the second line)
Your file loads to address 0x0000, not 0x8000.
The data bytes looks correct in your file.
You can ignore the extra FF values in my file.
One little point about your code: SCM strings are terminated with a null, not a '$'.
Here is my listing file:
0001
0002 .PROC Z80 ;SCWorkshop select processor
0003 .HEXBYTES 0x10 ;SCWorkshop Intel Hex output format
0004
0005
0006 .ORG 0x8000
0007
8000: 11 07 80 0008 LD DE,Hello
8003: 0E 06 0009 LD C,6
8005: F7 0010 RST 0x30
8006: C9 0011 RET
0012
8007: 0A 0A 48 65 0013 Hello: .DB 0x0A,0x0A,"Hello World!",0x0D,0x0A,"$"
800B: 6C 6C ... 0013
0014
If you edit your HEX file to include the correct addresses I think you will be able to download it okay.
Steve
*2"52
Bad command
*
------
So I'm afraid that didn't work either. I'm assuming your checksum is correct as Douglas mentioned.Small Computer Monitor - Z50Bus/Z80
*2"52
Might I ask which terminal program you are using to paste the bytes over?
regards,
Rob