Image Map Image Map
Page 1 of 4 1234 LastLast
Results 1 to 10 of 38

Thread: Z80 Hello World example in hex

  1. #1
    Join Date
    Jan 2011
    Location
    Vancouver, BC
    Posts
    4,957
    Blog Entries
    3

    Default Z80 Hello World example in hex

    Hi guys,

    I am trying to learn a bit of programming for this z80 homered machine I have. It is completely homered in design and features a monitor that near as I can tell has only two commands: (L)old and (G)o (execute).

    There doesn't seem to be any provision for loading or saving stuff. Any other keys you hit just get a What? prompt. I think I may have dumped the ROM here before.. if not I could do it.

    Basically I just want to do a test program that does a Hello World type thing but my Googlefu is failing. It keeps coming up with assembly programs (I need op codes) that have includes for specific machines.

    I'm wondering if we have to know specific details of the design of this machine to get text output we want, or if that matters?

  2. #2
    Join Date
    May 2011
    Location
    Outer Mongolia
    Posts
    2,403

    Default

    Please tell me that this Homered machine looks exactly like this!

    the-homer-ft.jpg

    Generally speaking you do need to know the specific design details of a machine to get a "hello world" printed to the screen, yes. Typically an assembly "hello world" will either make a call to some "print to the console" routine in the firmware that you'll need to know how to access, or you'll need to manually shove the string out the serial port or poke it into the video memory if you're going all the way to bare metal, and in that case you'll need to know the relevant addresses.
    My Retro-computing YouTube Channel (updates... eventually?): Paleozoic PCs

  3. #3
    Join Date
    Jan 2014
    Location
    Western North Carolina, USA
    Posts
    1,337

    Default

    So, hello world in Z80 hex, for the TRS-80 Model III:
    Code:
    5200: 210652C31B0248656C6C6F20576F726F
    5210: 64210D00000000000000000000000000
    In assembler (MRAS' format):
    Code:
    VDLINE  EQU 021BH
    BEGIN   ORG 5200H
            LD HL, MESSAGE
            JP VDLINE
    MESSAGE DB "Hello World!"
            DB ODH
            END BEGIN
    The monitor for your machine will have a subroutine similar to the TRS-80 VDLINE routine that takes a buffer pointed to by HL, terminated by an end of line (on the TRS-80 a single carriage return without linefeed does this), and puts it out the console device. I jump to this routine instead of CALLing (hex code 0CDH) to save the byte for the RETurn opcode, 0C9H.

    If your machine's routine uses BC instead of HL, replace the first 21 with 01; if DE instead, use 11.

    Been a while since I've hand-assembled something for my native language, Z80. A good little bit of fun!
    Last edited by lowen; May 18th, 2020 at 05:57 PM.
    --
    Thus spake Tandy Xenix System III version 3.2: "Bughlt: Sckmud Shut her down Scotty, she's sucking mud again!"

  4. #4
    Join Date
    Jan 2011
    Location
    Vancouver, BC
    Posts
    4,957
    Blog Entries
    3

    Default

    Here is a dump of the ROM if it helps. I hope it's a complete one - the EPROM is a 2758 which I read was 'upward compatible' with a 2716. The pinouts are mostly the same except A10. Not sure, but it does show the prompts I'm used to seeing:

    Code:
    :1000000031E007ED5E18690011000C06003E20008B
    :100010001213121310FAC9FF11000C0600EDB0C93B
    :100020004CEF4DEFC9FFFFFFC3CE00474820544FB0
    :10003000FFFFFFFFFFFFFFFFC3A0015245414459EF
    :10004000676CFFFFFFFFFFFFFFFFFFFFFFFFFFFFEB
    :10005000FF2940FFFFFFFFFFFFFFFFFFFFFFFFFF45
    :10006000574841543FFFFFED45DB00FBED4DFFFFDF
    :100070003E00ED473E06D3023E4FD3023E87D302F9
    :10008000DB00218800E5ED4DCFD7213B000E05DFD9
    :10009000FB762E400E0FEDB128042E6018EFCBE555
    :1000A0006E2929E9212B00CDAB00E90E05DF2140A7
    :1000B00000AF11070CCDC50029292929856FE776E6
    :1000C000FE0DC818EDFE3A3802D607E60FC93EF01D
    :1000D000A10F0F0F0FCDDF003E0FA1CDDF00C9C66E
    :1000E00030FE3AFAE800C6071213C9FFFFFFFFFF10
    :1000F00000048004000580050006800600078007D4
    :10010000214401CDAB000E00E5E1CD5001E5060331
    :10011000CD62011002180C76FE0E380ACDC500ED36
    :100120006F18ED971802FE0DCD6E0128E1FE08CD87
    :100130007C0128DAFE0A01100028CEFE0C01F0FF37
    :1001400028C718CA4C49535420FFFFFFFFFFFFFF89
    :1001500009E5CF11000C0610CD6201CD6E0110F83B
    :10016000E1C97BE6E05FE7134EEF3E2D12C9083E82
    :100170002012237BF61F5F13CB8A08C9EB01C0FF57
    :1001800009EBCBD2CB8A2B2BC9FFFFFFFFFFFFFF71
    :1001900050435350414642434445484C49584959BD
    :1001A000E5F5C5D5FDE5DDE5E5D5C5F5011600218B
    :1001B000FEFF39E5D109E5F9E1EBF9D511000C2194
    :1001C000900106080E10EDA0EDA01313E3E7E13E49
    :1001D0001FB35F1310EED1C1F1E1C9FFFFFFFFFFB5
    :1001E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1F
    :1001F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0F
    :10020000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE
    :10021000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEE
    :10022000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDE
    :10023000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCE
    :10024000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBE
    :10025000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAE
    :10026000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9E
    :10027000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8E
    :10028000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7E
    :10029000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6E
    :1002A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5E
    :1002B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4E
    :1002C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3E
    :1002D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2E
    :1002E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1E
    :1002F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0E
    :10030000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD
    :10031000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFED
    :10032000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDD
    :10033000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCD
    :10034000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBD
    :10035000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAD
    :10036000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9D
    :10037000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8D
    :10038000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7D
    :10039000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6D
    :1003A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D
    :1003B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4D
    :1003C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3D
    :1003D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2D
    :1003E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1D
    :1003F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0D
    :10040000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC
    :10041000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEC
    :10042000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDC
    :10043000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCC
    :10044000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBC
    :10045000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAC
    :10046000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9C
    :10047000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8C
    :10048000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7C
    :10049000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6C
    :1004A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5C
    :1004B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4C
    :1004C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3C
    :1004D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2C
    :1004E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1C
    :1004F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0C
    :10050000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB
    :10051000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEB
    :10052000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDB
    :10053000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCB
    :10054000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBB
    :10055000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAB
    :10056000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9B
    :10057000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8B
    :10058000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7B
    :10059000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6B
    :1005A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5B
    :1005B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4B
    :1005C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3B
    :1005D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2B
    :1005E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1B
    :1005F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0B
    :10060000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA
    :10061000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEA
    :10062000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDA
    :10063000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCA
    :10064000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBA
    :10065000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAA
    :10066000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9A
    :10067000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8A
    :10068000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7A
    :10069000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6A
    :1006A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5A
    :1006B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4A
    :1006C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3A
    :1006D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2A
    :1006E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1A
    :1006F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0A
    :10070000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9
    :10071000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9
    :10072000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD9
    :10073000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC9
    :10074000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB9
    :10075000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA9
    :10076000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF99
    :10077000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF89
    :10078000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF79
    :10079000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF69
    :1007A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF59
    :1007B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF49
    :1007C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF39
    :1007D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF29
    :1007E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF19
    :1007F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF09
    :00000001FF
    A screenshot shows some of the prompts:

    homebrew z80.png

    If anyone recognizes it I'd love to know whose it is.

  5. #5

    Default

    Quote Originally Posted by falter View Post
    Here is a dump of the ROM if it helps. I hope it's a complete one - the EPROM is a 2758 which I read was 'upward compatible' with a 2716. The pinouts are mostly the same except A10. Not sure, but it does show the prompts I'm used to seeing:

    Code:
    :1000000031E007ED5E18690011000C06003E20008B
    :100010001213121310FAC9FF11000C0600EDB0C93B
    :100020004CEF4DEFC9FFFFFFC3CE00474820544FB0
    :10003000FFFFFFFFFFFFFFFFC3A0015245414459EF
    :10004000676CFFFFFFFFFFFFFFFFFFFFFFFFFFFFEB
    :10005000FF2940FFFFFFFFFFFFFFFFFFFFFFFFFF45
    :10006000574841543FFFFFED45DB00FBED4DFFFFDF
    :100070003E00ED473E06D3023E4FD3023E87D302F9
    :10008000DB00218800E5ED4DCFD7213B000E05DFD9
    :10009000FB762E400E0FEDB128042E6018EFCBE555
    :1000A0006E2929E9212B00CDAB00E90E05DF2140A7
    :1000B00000AF11070CCDC50029292929856FE776E6
    :1000C000FE0DC818EDFE3A3802D607E60FC93EF01D
    :1000D000A10F0F0F0FCDDF003E0FA1CDDF00C9C66E
    :1000E00030FE3AFAE800C6071213C9FFFFFFFFFF10
    :1000F00000048004000580050006800600078007D4
    :10010000214401CDAB000E00E5E1CD5001E5060331
    :10011000CD62011002180C76FE0E380ACDC500ED36
    :100120006F18ED971802FE0DCD6E0128E1FE08CD87
    :100130007C0128DAFE0A01100028CEFE0C01F0FF37
    :1001400028C718CA4C49535420FFFFFFFFFFFFFF89
    :1001500009E5CF11000C0610CD6201CD6E0110F83B
    :10016000E1C97BE6E05FE7134EEF3E2D12C9083E82
    :100170002012237BF61F5F13CB8A08C9EB01C0FF57
    :1001800009EBCBD2CB8A2B2BC9FFFFFFFFFFFFFF71
    :1001900050435350414642434445484C49584959BD
    :1001A000E5F5C5D5FDE5DDE5E5D5C5F5011600218B
    :1001B000FEFF39E5D109E5F9E1EBF9D511000C2194
    :1001C000900106080E10EDA0EDA01313E3E7E13E49
    :1001D0001FB35F1310EED1C1F1E1C9FFFFFFFFFFB5
    :1001E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1F
    :1001F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0F
    :10020000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE
    :10021000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEE
    :10022000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDE
    :10023000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCE
    :10024000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBE
    :10025000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAE
    :10026000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9E
    :10027000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8E
    :10028000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7E
    :10029000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6E
    :1002A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5E
    :1002B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4E
    :1002C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3E
    :1002D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2E
    :1002E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1E
    :1002F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0E
    :10030000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD
    :10031000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFED
    :10032000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDD
    :10033000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCD
    :10034000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBD
    :10035000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAD
    :10036000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9D
    :10037000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8D
    :10038000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7D
    :10039000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6D
    :1003A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D
    :1003B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4D
    :1003C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3D
    :1003D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2D
    :1003E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1D
    :1003F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0D
    :10040000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC
    :10041000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEC
    :10042000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDC
    :10043000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCC
    :10044000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBC
    :10045000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAC
    :10046000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9C
    :10047000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8C
    :10048000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7C
    :10049000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6C
    :1004A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5C
    :1004B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4C
    :1004C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3C
    :1004D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2C
    :1004E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1C
    :1004F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0C
    :10050000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB
    :10051000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEB
    :10052000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDB
    :10053000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCB
    :10054000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBB
    :10055000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAB
    :10056000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9B
    :10057000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8B
    :10058000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7B
    :10059000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6B
    :1005A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5B
    :1005B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4B
    :1005C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3B
    :1005D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2B
    :1005E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1B
    :1005F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0B
    :10060000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA
    :10061000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEA
    :10062000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDA
    :10063000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFCA
    :10064000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBA
    :10065000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFAA
    :10066000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9A
    :10067000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8A
    :10068000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7A
    :10069000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF6A
    :1006A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5A
    :1006B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF4A
    :1006C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF3A
    :1006D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2A
    :1006E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1A
    :1006F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0A
    :10070000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF9
    :10071000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9
    :10072000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD9
    :10073000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC9
    :10074000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFB9
    :10075000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA9
    :10076000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF99
    :10077000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF89
    :10078000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF79
    :10079000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF69
    :1007A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF59
    :1007B000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF49
    :1007C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF39
    :1007D000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF29
    :1007E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF19
    :1007F000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF09
    :00000001FF
    A screenshot shows some of the prompts:

    homebrew z80.png

    If anyone recognizes it I'd love to know whose it is.
    I took a quick look at the disassembly of this dump, and I have a few questions / clarifications

    1. I am assuming this ROM is situated in the memory map at 0x0000. Correct me if I am wrong.

    2. How does this computer actually handle I/O. Does it communicate using a port mapped UART, or does it have memory mapped VRAM of some sort? I tried assuming that it had a port mapped UART like most Z80 homebrews, but outside of a few bytes sent out during initialization (configuration data for a UART or similar I/O chip I am assuming), no use is made of the IN or OUT instructions during any of the routines. Then again, the dump may be incomplete or I just have my disassembler set up wrong.

  6. #6
    Join Date
    Jan 2011
    Location
    Vancouver, BC
    Posts
    4,957
    Blog Entries
    3

    Default

    I believe so, yes. The first available RAM seems to be at 0x0400.

    It has direct video output.. I don't see a UART chip anywhere. It appears to have a video card of sorts built on one of the cards - 8x2102 RAMs dedicated to it.

    It's possible my dump isn't complete. My GQ 4x4 programmer didn't have a definition for an Intel 2758. So I looked at the datasheet which seemed to suggest it was related to the 2716. However the pin on the 2716 marked A10 is marked something I can't quite read on the 2758 datasheet.. AR? So I'm wondering if we are missing an address line/bit here. I suppose I could just manually check it by starting at 0x0000 and going line by line to see if it is the same as the dump.

  7. #7
    Join Date
    Jan 2005
    Location
    Principality of Xeon W-2140B the Great State of Central New Jerky
    Posts
    1,952

    Default

    Chances are you're going to be much better off writing basic assembler programs on some 80x86 machines with masm or even debug. Just my 2 cents. An excellent text is IBM PC Assembler Language and Programming by Peter Abel 1st or 2nd ("Assembly") editions.

  8. #8
    Join Date
    Jan 2011
    Location
    Vancouver, BC
    Posts
    4,957
    Blog Entries
    3

    Default

    I plugged the eprom back in, fired up the computer, and checked every address against the dump and it appears to match. Which means I got lucky.. apparently the 2758 is a lower voltage version of the 2708. Anyway, reading it as a 2716 apparently did the job.

    Is it normal to have FFs sprinkled in amidst opcodes and data? Most EPROMs I've dumped have everything packed in tightly. I'm wondering if there is possible bitrot happening? Maybe other functions like load and save are missing because of that?

  9. #9
    Join Date
    Jun 2012
    Location
    UK - Worcester
    Posts
    3,856

    Default

    I have disassembled the EPROM contents (see attached). Obviously, the dissassembler does not understand text messages!

    It looks like it uses interrupts (IM2).

    The stack (and hence RAM) should be at $7E0.

    There appears to be some memory at $0C00 (video RAM possibly)?

    Or I wonder if the VDU is like the MARK-8 VDU that I have seen where it has some RAM, but you address it via I/O ports?

    I can see an input from port 0 and an output to port 2.

    No more time today to do any more disassembly - but a partial list of further commands to try may be E, M, G, O and !. But (of course) this is a guess.

    Because the EPROM lives at address $0000, it can (and does appear to use) the eight (8) restart instructions to perform subroutines.

    The $FF bytes are not 'bit rot' but the EPROM may be 'hand assembled' and I think it just has 'spare bytes of $FF' to apply modifications to the debug monitor as required. There appears to be a lot of empty space in this EPROM, so space (and hence tightly packed code) wasn't a constraint!

    I see there is a text string listing all of the Z80 registers, so there must be some form of register dump command somewhere.

    Any chance of some photographs to see what we are dealing with?

    Dave

    Code:
                               .data:00000000 31 e0 07                         ld sp,0x07e0
                               .data:00000003 ed 5e                            im 2
                               .data:00000005 18 69                            jr 0x0070
                               .data:00000007 00                               nop
                               .data:00000008 11 00 0c                         ld de,0x0c00
                               .data:0000000b 06 00                            ld b,0x00
                               .data:0000000d 3e 20                            ld a,0x20
                               .data:0000000f 00                               nop
                               .data:00000010 12                               ld (de),a
                               .data:00000011 13                               inc de
                               .data:00000012 12                               ld (de),a
                               .data:00000013 13                               inc de
                               .data:00000014 10 fa                            djnz 0x0010
                               .data:00000016 c9                               ret
                               .data:00000017 ff                               rst 0x38
                               .data:00000018 11 00 0c                         ld de,0x0c00
                               .data:0000001b 06 00                            ld b,0x00
                               .data:0000001d ed b0                            ldir
                               .data:0000001f c9                               ret
                               .data:00000020 4c                               ld c,h
                               .data:00000021 ef                               rst 0x28
                               .data:00000022 4d                               ld c,l
                               .data:00000023 ef                               rst 0x28
                               .data:00000024 c9                               ret
                               .data:00000025 ff                               rst 0x38
                               .data:00000026 ff                               rst 0x38
                               .data:00000027 ff                               rst 0x38
                               .data:00000028 c3 ce 00                         jp 0x00ce
                               .data:0000002b 47                               ld b,a
                               .data:0000002c 48                               ld c,b
                               .data:0000002d 20 54                            jr nz,0x0083
                               .data:0000002f 4f                               ld c,a
                               .data:00000030 ff                               rst 0x38
                               .data:00000031 ff                               rst 0x38
                               .data:00000032 ff                               rst 0x38
                               .data:00000033 ff                               rst 0x38
                               .data:00000034 ff                               rst 0x38
                               .data:00000035 ff                               rst 0x38
                               .data:00000036 ff                               rst 0x38
                               .data:00000037 ff                               rst 0x38
                               .data:00000038 c3 a0 01                         jp 0x01a0
                               .data:0000003b 52                               ld d,d
                               .data:0000003c 45                               ld b,l
                               .data:0000003d 41                               ld b,c
                               .data:0000003e 44                               ld b,h
                               .data:0000003f 59                               ld e,c
                               .data:00000040 67                               ld h,a
                               .data:00000041 6c                               ld l,h
                               .data:00000042 ff                               rst 0x38
                               .data:00000043 ff                               rst 0x38
                               .data:00000044 ff                               rst 0x38
                               .data:00000045 ff                               rst 0x38
                               .data:00000046 ff                               rst 0x38
                               .data:00000047 ff                               rst 0x38
                               .data:00000048 ff                               rst 0x38
                               .data:00000049 ff                               rst 0x38
                               .data:0000004a ff                               rst 0x38
                               .data:0000004b ff                               rst 0x38
                               .data:0000004c ff                               rst 0x38
                               .data:0000004d ff                               rst 0x38
                               .data:0000004e ff                               rst 0x38
                               .data:0000004f ff                               rst 0x38
                               .data:00000050 ff                               rst 0x38
                               .data:00000051 29                               add hl,hl
                               .data:00000052 40                               ld b,b
                               .data:00000053 ff                               rst 0x38
                               .data:00000054 ff                               rst 0x38
                               .data:00000055 ff                               rst 0x38
                               .data:00000056 ff                               rst 0x38
                               .data:00000057 ff                               rst 0x38
                               .data:00000058 ff                               rst 0x38
                               .data:00000059 ff                               rst 0x38
                               .data:0000005a ff                               rst 0x38
                               .data:0000005b ff                               rst 0x38
                               .data:0000005c ff                               rst 0x38
                               .data:0000005d ff                               rst 0x38
                               .data:0000005e ff                               rst 0x38
                               .data:0000005f ff                               rst 0x38
                               .data:00000060 57                               ld d,a
                               .data:00000061 48                               ld c,b
                               .data:00000062 41                               ld b,c
                               .data:00000063 54                               ld d,h
                               .data:00000064 3f                               ccf
                               .data:00000065 ff                               rst 0x38
                               .data:00000066 ff                               rst 0x38
                               .data:00000067 ed 45                            retn
                               .data:00000069 db 00                            in a,(0x00)
                               .data:0000006b fb                               ei
                               .data:0000006c ed 4d                            reti
                               .data:0000006e ff                               rst 0x38
                               .data:0000006f ff                               rst 0x38
                               .data:00000070 3e 00                            ld a,0x00
                               .data:00000072 ed 47                            ld i,a
                               .data:00000074 3e 06                            ld a,0x06
                               .data:00000076 d3 02                            out (0x02),a
                               .data:00000078 3e 4f                            ld a,0x4f
                               .data:0000007a d3 02                            out (0x02),a
                               .data:0000007c 3e 87                            ld a,0x87
                               .data:0000007e d3 02                            out (0x02),a
                               .data:00000080 db 00                            in a,(0x00)
                               .data:00000082 21 88 00                         ld hl,0x0088
                               .data:00000085 e5                               push hl
                               .data:00000086 ed 4d                            reti
                               .data:00000088 cf                               rst 0x08
                               .data:00000089 d7                               rst 0x10
                               .data:0000008a 21 3b 00                         ld hl,0x003b
                               .data:0000008d 0e 05                            ld c,0x05
                               .data:0000008f df                               rst 0x18
                               .data:00000090 fb                               ei
                               .data:00000091 76                               halt
                               .data:00000092 2e 40                            ld l,0x40
                               .data:00000094 0e 0f                            ld c,0x0f
                               .data:00000096 ed b1                            cpir
                               .data:00000098 28 04                            jr z,0x009e
                               .data:0000009a 2e 60                            ld l,0x60
                               .data:0000009c 18 ef                            jr 0x008d
                               .data:0000009e cb e5                            set 4,l
                               .data:000000a0 6e                               ld l,(hl)
                               .data:000000a1 29                               add hl,hl
                               .data:000000a2 29                               add hl,hl
                               .data:000000a3 e9                               jp (hl)
                               .data:000000a4 21 2b 00                         ld hl,0x002b
                               .data:000000a7 cd ab 00                         call 0x00ab
                               .data:000000aa e9                               jp (hl)
                               .data:000000ab 0e 05                            ld c,0x05
                               .data:000000ad df                               rst 0x18
                               .data:000000ae 21 40 00                         ld hl,0x0040
                               .data:000000b1 af                               xor a
                               .data:000000b2 11 07 0c                         ld de,0x0c07
                               .data:000000b5 cd c5 00                         call 0x00c5
                               .data:000000b8 29                               add hl,hl
                               .data:000000b9 29                               add hl,hl
                               .data:000000ba 29                               add hl,hl
                               .data:000000bb 29                               add hl,hl
                               .data:000000bc 85                               add a,l
                               .data:000000bd 6f                               ld l,a
                               .data:000000be e7                               rst 0x20
                               .data:000000bf 76                               halt
                               .data:000000c0 fe 0d                            cp 0x0d
                               .data:000000c2 c8                               ret z
                               .data:000000c3 18 ed                            jr 0x00b2
                               .data:000000c5 fe 3a                            cp 0x3a
                               .data:000000c7 38 02                            jr c,0x00cb
                               .data:000000c9 d6 07                            sub 0x07
                               .data:000000cb e6 0f                            and 0x0f
                               .data:000000cd c9                               ret
                               .data:000000ce 3e f0                            ld a,0xf0
                               .data:000000d0 a1                               and c
                               .data:000000d1 0f                               rrca
                               .data:000000d2 0f                               rrca
                               .data:000000d3 0f                               rrca
                               .data:000000d4 0f                               rrca
                               .data:000000d5 cd df 00                         call 0x00df
                               .data:000000d8 3e 0f                            ld a,0x0f
                               .data:000000da a1                               and c
                               .data:000000db cd df 00                         call 0x00df
                               .data:000000de c9                               ret
                               .data:000000df c6 30                            add a,0x30
                               .data:000000e1 fe 3a                            cp 0x3a
                               .data:000000e3 fa e8 00                         jp m,0x00e8
                               .data:000000e6 c6 07                            add a,0x07
                               .data:000000e8 12                               ld (de),a
                               .data:000000e9 13                               inc de
                               .data:000000ea c9                               ret
                               .data:000000eb ff                               rst 0x38
                               .data:000000ec ff                               rst 0x38
                               .data:000000ed ff                               rst 0x38
                               .data:000000ee ff                               rst 0x38
                               .data:000000ef ff                               rst 0x38
                               .data:000000f0 00                               nop
                               .data:000000f1 04                               inc b
                               .data:000000f2 80                               add a,b
                               .data:000000f3 04                               inc b
                               .data:000000f4 00                               nop
                               .data:000000f5 05                               dec b
                               .data:000000f6 80                               add a,b
                               .data:000000f7 05                               dec b
                               .data:000000f8 00                               nop
                               .data:000000f9 06 80                            ld b,0x80
                               .data:000000fb 06 00                            ld b,0x00
                               .data:000000fd 07                               rlca
                               .data:000000fe 80                               add a,b
                               .data:000000ff 07                               rlca
                               .data:00000100 21 44 01                         ld hl,0x0144
                               .data:00000103 cd ab 00                         call 0x00ab
                               .data:00000106 0e 00                            ld c,0x00
                               .data:00000108 e5                               push hl
                               .data:00000109 e1                               pop hl
                               .data:0000010a cd 50 01                         call 0x0150
                               .data:0000010d e5                               push hl
                               .data:0000010e 06 03                            ld b,0x03
                               .data:00000110 cd 62 01                         call 0x0162
                               .data:00000113 10 02                            djnz 0x0117
                               .data:00000115 18 0c                            jr 0x0123
                               .data:00000117 76                               halt
                               .data:00000118 fe 0e                            cp 0x0e
                               .data:0000011a 38 0a                            jr c,0x0126
                               .data:0000011c cd c5 00                         call 0x00c5
                               .data:0000011f ed 6f                            rld
                               .data:00000121 18 ed                            jr 0x0110
                               .data:00000123 97                               sub a
                               .data:00000124 18 02                            jr 0x0128
                               .data:00000126 fe 0d                            cp 0x0d
                               .data:00000128 cd 6e 01                         call 0x016e
                               .data:0000012b 28 e1                            jr z,0x010e
                               .data:0000012d fe 08                            cp 0x08
                               .data:0000012f cd 7c 01                         call 0x017c
                               .data:00000132 28 da                            jr z,0x010e
                               .data:00000134 fe 0a                            cp 0x0a
                               .data:00000136 01 10 00                         ld bc,0x0010
                               .data:00000139 28 ce                            jr z,0x0109
                               .data:0000013b fe 0c                            cp 0x0c
                               .data:0000013d 01 f0 ff                         ld bc,0xfff0
                               .data:00000140 28 c7                            jr z,0x0109
                               .data:00000142 18 ca                            jr 0x010e
                               .data:00000144 4c                               ld c,h
                               .data:00000145 49                               ld c,c
                               .data:00000146 53                               ld d,e
                               .data:00000147 54                               ld d,h
                               .data:00000148 20 ff                            jr nz,0x0149
                               .data:0000014a ff                               rst 0x38
                               .data:0000014b ff                               rst 0x38
                               .data:0000014c ff                               rst 0x38
                               .data:0000014d ff                               rst 0x38
                               .data:0000014e ff                               rst 0x38
                               .data:0000014f ff                               rst 0x38
                               .data:00000150 09                               add hl,bc
                               .data:00000151 e5                               push hl
                               .data:00000152 cf                               rst 0x08
                               .data:00000153 11 00 0c                         ld de,0x0c00
                               .data:00000156 06 10                            ld b,0x10
                               .data:00000158 cd 62 01                         call 0x0162
                               .data:0000015b cd 6e 01                         call 0x016e
                               .data:0000015e 10 f8                            djnz 0x0158
                               .data:00000160 e1                               pop hl
                               .data:00000161 c9                               ret
                               .data:00000162 7b                               ld a,e
                               .data:00000163 e6 e0                            and 0xe0
                               .data:00000165 5f                               ld e,a
                               .data:00000166 e7                               rst 0x20
                               .data:00000167 13                               inc de
                               .data:00000168 4e                               ld c,(hl)
                               .data:00000169 ef                               rst 0x28
                               .data:0000016a 3e 2d                            ld a,0x2d
                               .data:0000016c 12                               ld (de),a
                               .data:0000016d c9                               ret
                               .data:0000016e 08                               ex af,af'
                               .data:0000016f 3e 20                            ld a,0x20
                               .data:00000171 12                               ld (de),a
                               .data:00000172 23                               inc hl
                               .data:00000173 7b                               ld a,e
                               .data:00000174 f6 1f                            or 0x1f
                               .data:00000176 5f                               ld e,a
                               .data:00000177 13                               inc de
                               .data:00000178 cb 8a                            res 1,d
                               .data:0000017a 08                               ex af,af'
                               .data:0000017b c9                               ret
                               .data:0000017c eb                               ex de,hl
                               .data:0000017d 01 c0 ff                         ld bc,0xffc0
                               .data:00000180 09                               add hl,bc
                               .data:00000181 eb                               ex de,hl
                               .data:00000182 cb d2                            set 2,d
                               .data:00000184 cb 8a                            res 1,d
                               .data:00000186 2b                               dec hl
                               .data:00000187 2b                               dec hl
                               .data:00000188 c9                               ret
                               .data:00000189 ff                               rst 0x38
                               .data:0000018a ff                               rst 0x38
                               .data:0000018b ff                               rst 0x38
                               .data:0000018c ff                               rst 0x38
                               .data:0000018d ff                               rst 0x38
                               .data:0000018e ff                               rst 0x38
                               .data:0000018f ff                               rst 0x38
                               .data:00000190 50                               ld d,b
                               .data:00000191 43                               ld b,e
                               .data:00000192 53                               ld d,e
                               .data:00000193 50                               ld d,b
                               .data:00000194 41                               ld b,c
                               .data:00000195 46                               ld b,(hl)
                               .data:00000196 42                               ld b,d
                               .data:00000197 43                               ld b,e
                               .data:00000198 44                               ld b,h
                               .data:00000199 45                               ld b,l
                               .data:0000019a 48                               ld c,b
                               .data:0000019b 4c                               ld c,h
                               .data:0000019c 49                               ld c,c
                               .data:0000019d 58                               ld e,b
                               .data:0000019e 49                               ld c,c
                               .data:0000019f 59                               ld e,c
                               .data:000001a0 e5                               push hl
                               .data:000001a1 f5                               push af
                               .data:000001a2 c5                               push bc
                               .data:000001a3 d5                               push de
                               .data:000001a4 fd e5                            push iy
                               .data:000001a6 dd e5                            push ix
                               .data:000001a8 e5                               push hl
                               .data:000001a9 d5                               push de
                               .data:000001aa c5                               push bc
                               .data:000001ab f5                               push af
                               .data:000001ac 01 16 00                         ld bc,0x0016
                               .data:000001af 21 fe ff                         ld hl,0xfffe
                               .data:000001b2 39                               add hl,sp
                               .data:000001b3 e5                               push hl
                               .data:000001b4 d1                               pop de
                               .data:000001b5 09                               add hl,bc
                               .data:000001b6 e5                               push hl
                               .data:000001b7 f9                               ld sp,hl
                               .data:000001b8 e1                               pop hl
                               .data:000001b9 eb                               ex de,hl
                               .data:000001ba f9                               ld sp,hl
                               .data:000001bb d5                               push de
                               .data:000001bc 11 00 0c                         ld de,0x0c00
                               .data:000001bf 21 90 01                         ld hl,0x0190
                               .data:000001c2 06 08                            ld b,0x08
                               .data:000001c4 0e 10                            ld c,0x10
                               .data:000001c6 ed a0                            ldi
                               .data:000001c8 ed a0                            ldi
                               .data:000001ca 13                               inc de
                               .data:000001cb 13                               inc de
                               .data:000001cc e3                               ex (sp),hl
                               .data:000001cd e7                               rst 0x20
                               .data:000001ce e1                               pop hl
                               .data:000001cf 3e 1f                            ld a,0x1f
                               .data:000001d1 b3                               or e
                               .data:000001d2 5f                               ld e,a
                               .data:000001d3 13                               inc de
                               .data:000001d4 10 ee                            djnz 0x01c4
                               .data:000001d6 d1                               pop de
                               .data:000001d7 c1                               pop bc
                               .data:000001d8 f1                               pop af
                               .data:000001d9 e1                               pop hl
                               .data:000001da c9                               ret
                               .data:000001db ff                               rst 0x38
                               .data:000001dc ff                               rst 0x38
                               .data:000001dd ff                               rst 0x38
                               .data:000001de ff                               rst 0x38
                               .data:000001df ff                               rst 0x38
    Last edited by daver2; May 19th, 2020 at 01:07 AM.

  10. Default

    The string output routine is at 0018, since it does not keep track of any cursor position I would say it is not directly writing to video RAM but some memory mapped I/O.

    Code:
         ;RST 3 (18H) - Print string
         ;HL => String, C = Length
    0018 LD   DE,0C00
    001B LD   B,00
    001D LDIR
    001F RET
    It is called from the main command loop here:

    Code:
         ;print READY
    008A LD   HL,003B       ;"READY"
    008D LD   C,05
    008F RST  18H
         ;wait for input
    0090 EI                 ;enable interrupts (normally disabled?)
    0091 HALT               ;intr loads A with input char?
         ;look up command
    0092 LD   L,40          ;cmd key table
    0094 LD   C,0F          ;max length (but only 2 used)
    0096 CPIR               ;scan
    0098 JR   Z,009E        ;if found, go to cmd
    009A LD   L,60          ;"WHAT?"
    009C JR   008D          ;output message and loop
         ;do command
    009E SET  4,L           ;if match was at 0040, HL now 0051 etc
    00A0 LD   L,(HL)        ;get entry address
    00A1 ADD  HL,HL         ;multiply by 4 (max range 1K)
    00A2 ADD  HL,HL
    00A3 JP   (HL)          ;jump to command
    The command table really has only two entries, the rest is filled with FF.
    Interrupt handler looks unnecessarily complicated for what I guess it does, possibly compiler generated code? Uses LD HL,offset + ADD HL,SP to access memory.

    edit: I meant the code jumped to by RST 38H, which isn't actually the interrupt handler. D'oh! It's using IM2 with the vector somewhere in page 0.
    Last edited by dreNorteR; May 19th, 2020 at 02:09 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •