Assembler does not support DB 'string'

Bug #579316 reported by Missouga Dongi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gnusim8085
Confirmed
Medium
Aanjhan Ranganathan

Bug Description

All 8085 assemblers I've seen support the DB 'string'
construction but not this one.
I've attached a patch to allow string declarations too.

There is a known minor bug: consecutive spaces inside
strings are compressed to just one space. To correct this I would have to break to much of the existing program structure and I'd rather not.

Appart from the above minor bug, strings enclosed in single or double quote are now allowed in DB and commas
inside strings are handled correctly.

Tags: assembler
Revision history for this message
Missouga Dongi (zelea2) wrote :

Logged In: YES
user_id=911054
Originator: YES

File Added: gnusim8085-1.3.2-db_string_ok.diff

Revision history for this message
Aanjhan Ranganathan (aanjhan) wrote :

Logged In: YES
user_id=798578
Originator: NO

Thanks for the patch. It would be great if you attach a sample test program that you used to verify your changes.

Revision history for this message
Onkar Shinde (onkarshinde) wrote :
Revision history for this message
The Escapist (wisd00m) wrote :

This really is an important feature, I had to work around this some time ago and it can get pretty annoying fairly soon.

The minimal syntax typically supported is:

label: db 'f','o','o'
label: db "mystring",0A,0D,'$'

i.e. single quotes for single bytes, and double quotes for multiple bytes.

The built-in assembler is not especially good at handling those "pseudo instructions" (i.e. macros etc):
http://www.tortall.net/projects/yasm/manual/html/nasm-pseudop.html

      db 0x55 ; just the byte 0x55
      db 0x55,0x56,0x57 ; three bytes in succession
      db 'a',0x55 ; character constants are OK
      db 'hello',13,10,'$' ; so are string constants
      dw 0x1234 ; 0x34 0x12
      dw 'a' ; 0x61 0x00 (it's just a number)
      dw 'ab' ; 0x61 0x62 (character constant)
      dw 'abc' ; 0x61 0x62 0x63 0x00 (string)
      dd 0x12345678 ; 0x78 0x56 0x34 0x12
      dd 1.234567e20 ; floating-point constant
      dq 0x123456789abcdef0 ; eight byte constant
      dq 1.234567e20 ; double-precision float
      dt 1.234567e20 ; extended-precision float

source: http://www.nasm.us/doc/nasmdoc3.html

There are suggestions to replace the assembler with a more feature-complete solution: https://bugs.launchpad.net/gnusim8085/+bug/579336

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.