bugZ80 assembler - Bugs: bug #57096, list output incorrectly displays...

 
 

bug #57096: list output incorrectly displays 'jp' instructions

Submitter:  None
Submitted:  Mon 21 Oct 2019 08:18:56 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Works For Me
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 02 Mar 2021 07:30:56 PM UTC, comment #1: 

Can't reproduce this with 1.9:


Assembling....
# File test-z80asm-jp.asm
0000                        start:
0000 c3 3b 00                jp main
0003
0003 0x00...                ds 0x0038-$, 0
0038
0038                        interrupt:
0038 fb                        ei
0039 ed 4d                reti
003b
003b                        main:
003b 01 00 10                ld bc, 01000h
003e 0b                        dec bc
003f 78                        ld a, b
0040 b1                        or c
0041 c2 3b 00                jp nz, main
0044 76                        halt
# End of file test-z80asm-jp.asm
0045
Assembly succesful.


There is an issue with the listing, that the "ds" line makes no sense, but the listed bytes for "jp" are correct.

Paul Flo Williams <hisdeedsaredust>
Group Member
Mon 21 Oct 2019 08:18:56 PM UTC, original submission:  

When assembling with the -l flag, the list that is output incorrectly displays the generated opcodes for the 'jp' instruction.

Test Code:

start:
jp main

ds 0x0038-$, 0

interrupt:
ei
reti

main:
ld bc, 01000h
dec bc
ld a, b
or c
jp nz, main
halt

=====

List output:

$ z80asm -i test-z80asm-jp.asm -l -v -o test-z80asm-jp.bin
Assembling....
# File test-z80asm-jp.asm
0000 start:
0000 c3 00 00 jp main
0003
0003 0x00... ds 0x0038-$, 0
0038
0038 interrupt:
0038 fb ei
0039 ed 4d reti
003b
003b main:
003b 01 00 10 ld bc, 01000h
003e 0b dec bc
003f 78 ld a, b
0040 b1 or c
0041 c2 3b 00 jp nz, main
0044 76 halt
# End of file test-z80asm-jp.asm
0045
 3b 00

Note that the displayed output for the `jp main` instruction is `c3 00 00`.

=====

Actual generated binary:

$ xxd test-z80asm-jp.bin
00000000: c33b 0000 0000 0000 0000 0000 0000 0000  .;..............
00000010: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000020: 0000 0000 0000 0000 0000 0000 0000 0000  ................
00000030: 0000 0000 0000 0000 fbed 4d01 0010 0b78  ..........M....x
00000040: b1c2 3b00 76                             ..;.v

Note that the initial `jp main` instruction assembled as `c3 3b 00`

=====

z80asm information:

$ z80asm --version
Z80 assembler version 1.8
Copyright (C) 2002-2007 Bas Wijnen <shevek@fmf.nl>.
Copyright (C) 2005 Jan Wilmans <jw@dds.nl>.
This program comes with ABSOLUTELY NO WARRANTY.
You may distribute copies of the program under the terms
of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.

The complete text of the GPL can be found in
/usr/share/common-licenses/GPL.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by hisdeedsaredust (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-03-16 hisdeedsaredust StatusNone Works For Me
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code