Hi EE
I think the
.byte directive does what you want:
Quote:
The .BYTE directive deposits a series of 8-bit values into the object code for the current module. The values can be defined as the result of an expression (this includes simple numeric values) or as strings delimited by quotes.
Code:
.BYTE "Hello World",$0D,$0A,0
With some help from the two authors, I've been able to get Bill's TinyBasic reconstructed source (of Tom Pittman's binary) into a form which assembles with both assemblers, with the only variation being a swapping between two include headers:
Code:
.include "header-dev65.asm"
; .include "header-hxa.asm"
I've found that HXA sometimes gives clearer diagnostics, but dev65 is an easier route to binaries for ROM images. Anyhow, it's good to have portable sources.
Those headers are simple enough:
Code:
==> header-dev65.asm <==
;; assembly header for Dev65 assembler
;; http://www.obelisk.demon.co.uk/dev65/as65.html
mesg .macro sometext
.byte sometext
.endm
Code:
==> header-hxa.asm <==
;; assembly header for HXA assembler
;; http://home.earthlink.net/~hxa/docs/hxa.htm#l7e
.hexfile
.listfile
.errfile
.cpu T_32_M16
.assume BIT32=1032, BIT32R=3210
.include "i6502.a"
macro mesg, ?sometext
.str ?sometext
.endm
The other useful thing I have is a sign-extension macro, where I have a table of 8-bit bytes which are going to be treated as signed (so BPL, BMI, BIT are likely to be used)
Code:
;; sign extension - will set Z and N, but disturbs C and V
signextend .macro dummy
eor #$80
sec
sbc #$80
.endm
I could preserve C and V if I use a temporary: this is untested, and suggestions for improvement are welcome:
Code:
;; untested! sign extension - will set Z and N, preserve C and V
signextend .macro dummy
php
eor #$80
sec
sbc #$80
sta atemp
plp
lda atemp
.endm
(Probably this macro syntax is only good for dev65)
Both of those macros also work on 6502, but just waste some cycles.
(I've also been aiming to assemble the same source for both 6502 and 65Org16 - so far that's been possible, but I haven't yet got TinyBasic working.)
Cheers
Ed