Code: Select all
.byte “HELLOWORLD”, $00 ; 11 bytes
Code: Select all
; H E L L O W O R L D
.byte $08, $05, $0C, $0C, $0F, $17, $0F, $12, $0C, $04, $00 ; 11 bytes
Moderator: Moderators
Code: Select all
.byte “HELLOWORLD”, $00 ; 11 bytes
Code: Select all
; H E L L O W O R L D
.byte $08, $05, $0C, $0C, $0F, $17, $0F, $12, $0C, $04, $00 ; 11 bytes
Code: Select all
RVS_ON = $12 ; Reverse on
RVS_OFF = $92 ; Reverse off
; Then later...
.asc RVS_ON,"SCORE=",RVS_OFF
I don't know VASM, but I know that no ASCII-to-screen code conversion pseudo op exists in XA. Consider making your own set of labels in a separate included file to ease the process, likeCode: Select all
.byte $08, $05, $0C, $0C, $0F, $17, $0F, $12, $0C, $04, $00 ; 11 bytes
Code: Select all
A = $01
B = $02
; etc...
Z = $1a
;then
.byte H,E,L,L,O," ",W,O,R,L,D
Code: Select all
.A 1800 /"HELLO, WORLD!"
(the given URL is defunct)zimmers.net wrote:VASM is a VIC-20 assembly language environment featuring a full-screen editor, TASM-like error-notification and a two pass assembler. It is key-compatible with TASM for the subset of commands it supports to avoid brainfarts. The only requirement is that you have at least a 16k RAM expansion. Source code included (under the GNU General Public License). See [...] for the Siders homepage.
As chysn already wrote, on 8-bit CBMs you need to differentiate between PETSCII and screen codes. PETSCII was derived from an early ASCII standard and especially has lower and upper case switched around in comparison to today's 7-bit ASCII.charles92027 wrote:[...]
Unfortunately, I haven't been able to get this working. The edit screen comes up, but it immediately crashes. No data table pseudo-ops are mentioned in the documentation, only a single byte or word at a time. This seems like something that the author intended to complete some day, but probably life got in the way.Mike wrote: ↑Sun Jun 26, 2022 5:30 am There also exists a native VIC-20 assembler called VASM (download: http://www.zimmers.net/anonftp/pub/cbm/ ... ogramming/):
Code: Select all
TextColor equ $18
TextPointerLow equ $20
TextPointerHigh equ $21
PosLow equ $22
PosHigh equ $23
ColorPosLow equ $24
ColorPosHigh equ $25
YPosTemp equ $30
*=$1201
dB $0B, $12, $0A, $00, $9E
dB $38, $31, $39, $32 ; SYS8192 = $2000
dB $00, $00, $00
*=$2000
sei
jsr $E55F ; clear screen
lda #>HelloWorld ;Load address of message into Zeropage $20/1
sta TextPointerHigh
lda #<HelloWorld
sta TextPointerLow
lda #$02 ; Load color - red
sta TextColor
ldy #5 ; x-Position
tya
sta YPosTemp
ldx #3 ; y-Position
jsr PrintText
jmp *
PrintText:
lda screenLo,x
adc YPosTemp
sta PosLow
sta ColorPosLow
lda screenHi,x
sta PosHigh
adc #$84
sta ColorPosHigh
PrintStr:
ldy #0 ;Reset Y
PrintStr_again:
lda (TextPointerLow),y ;Read in a character
cmp #255
beq PrintStr_Done ;Return if we've reached a 255
cmp #$40 ; text char > #$40 (64)
bcc charokay ; yes, then print
sec ; set carry
sbc #$40 ; minus #$40 (64)
charokay:
sta (PosLow),y ;Print to screen
lda TextColor
sta (ColorPosLow),y
iny
jmp PrintStr_again ;repeat
PrintStr_Done: ;Return when done
rts
HelloWorld:
db "HELLO WORLD !!!"
db 255
screenLo:
DB $00,$16,$2C,$42,$58,$6E,$84,$9A,$B0,$C6,$DC,$F2,$08,$1E,$34,$4A,$60,$76,$8C,$A2,$B8,$CE,$E4
screenHi:
DB $10,$10,$10,$10,$10,$10,$10,$10,$10,$10,$10,$10,$11,$11,$11,$11,$11,$11,$11,$11,$11,$11,$11