Unexpanded VIC 20 Memory
Moderator: Moderators
Okie Dokie, I've gotten DASM to assemble my *.TXT files into working *.prg and execute with the proper SYS command.
I got VICmon from Zimmers, and successfully wrote and executed one of those as well, how would I write a DASM file in VICmon format, and is there a VICmon version for Unexpanded VIC?
I wrote that TEST.ASM on the VICmon, but I keep getting that annoying . dot and I cant seem to leave vicmon to run the program from BASIC line prompt.
I got VICmon from Zimmers, and successfully wrote and executed one of those as well, how would I write a DASM file in VICmon format, and is there a VICmon version for Unexpanded VIC?
I wrote that TEST.ASM on the VICmon, but I keep getting that annoying . dot and I cant seem to leave vicmon to run the program from BASIC line prompt.
-
- Vic 20 Devotee
- Posts: 269
- Joined: Mon Feb 04, 2008 6:06 am
You don't leave VicMon. You can execute it from inside. According to the instructions in the programmers reference manual chapter INTRODUCTION TO MACHINE LANGUAGE you just press shift + clr/home and type G and the address. In the example in the manual the program started at 1400 so I typed G 1400 and enter.
Also the sample program ends in BRK not RTS. I don't know why.
Also the sample program ends in BRK not RTS. I don't know why.
Change is inevitable except from a vending machine.
Ok so back to the 1.3 demo:
1 REM VIC VERSION
800 FOR AD=864TO885:READDA:POKEAD,DA:NEXTAD
805 PRINT"SYS 864 TO ACTIVATE"
810 DATA 160, 0, 169, 1, 153, 0
820 DATA 30, 153, 0, 31, 169, 6
830 DATA 153, 0, 150, 153, 0, 151
840 DATA 200, 208, 237, 96
How does this fill the screens with chr$ 65 aka A character?
According to the code we are putting data value 160 into memory location 864, and 864 on an unexpanded vic is the Cassette buffer up to 885 for this program. I don't understand how we can fill the screen by POKEing a couple numbers into Casette RAM...
1 REM VIC VERSION
800 FOR AD=864TO885:READDA:POKEAD,DA:NEXTAD
805 PRINT"SYS 864 TO ACTIVATE"
810 DATA 160, 0, 169, 1, 153, 0
820 DATA 30, 153, 0, 31, 169, 6
830 DATA 153, 0, 150, 153, 0, 151
840 DATA 200, 208, 237, 96
How does this fill the screens with chr$ 65 aka A character?
According to the code we are putting data value 160 into memory location 864, and 864 on an unexpanded vic is the Cassette buffer up to 885 for this program. I don't understand how we can fill the screen by POKEing a couple numbers into Casette RAM...
ok.. so here is the Assembly Language equivilent, which won't execute when loaded, i tried my best to get it to DASM standards:
it broken
Code: Select all
#processor 6502
org 7680 ;this is decimal start screen ram instead of $1E00
char.a equ $41
ldy #$00
lda #char.a
loop sta $0400,y ;not sure if we need 768 or 512 addresses here
sta $0500,y ;because 7680-8191 is only 511 not 768
sta $0600,y ; and this was written for commodore 64 originaly
sta $0700,y
iny
bne loop
rts
Last edited by Legacy on Mon Jan 26, 2009 4:27 pm, edited 2 times in total.
Try this ..
I don't have DASM so there may be syntax errors but the program is good. Save the resulting binary as "name.prg" and it can be loaded into vice.
In vice, with no expansion RAM, it will list as 1 SYS4109 and typing RUN will fill the screen with blue A characters.
BTW When you post your own code please use the code tags to preserve the formatting.
Lee.
Code: Select all
#processor 6502
char EQU "A"-$40 ; the PETSCII fill character
colr EQU 6 ; the fill colour
scrn1 EQU $1E00 ; start of the first screen page
scrn2 EQU $1EFA ; start of the second screen page
colp1 EQU $9600 ; start of the first colour page
colp2 EQU $96FA ; start of the second colour page
ORG $0FFF
dc.w Begin
Begin
dc.w nextline ; next line pointer
dc.w $0001 ; 1
dc.b $9E ; SYS
dc.b "4109" ; the decimal value of entry as characters
dc.b $00 ; end of line marker
nextline
dc.w $0000 ; BASIC end of text
entry
LDY #$00 ; clear the index
loop
LDA #char ; set the fill character
STA scrn1,Y ; save the character to page 1
STA scrn2,Y ; save the character to page 2
LDA #colr ; set the fill colour
STA colp1,Y ; save the colour to page 1
STA colp2,Y ; save the colour to page 2
DEY ; decrement the index
BNE loop ; loop if more to do
RTS
In vice, with no expansion RAM, it will list as 1 SYS4109 and typing RUN will fill the screen with blue A characters.
BTW When you post your own code please use the code tags to preserve the formatting.
Lee.
Last edited by Leeeeee on Tue Jan 27, 2009 12:05 pm, edited 1 time in total.
Syntax error 'A'-$40 aborting assembly, then I tried with just $40 and that had even more errors.
There must be a tutorial that is consistent with DASM or an emulated Assembler for VICE with lots of source and explanation. Ive had to go out and buy 3 books on 6502 vic because going back and forth from programmers refrence to ML for beginners, and VICE/DASM/vicmon24576 is alot of headaches. Hopefully the books arrive soon.
thats fd up dude , by the time i stopped DASM the file was 360 MB large, i thought you guys were here to help
There must be a tutorial that is consistent with DASM or an emulated Assembler for VICE with lots of source and explanation. Ive had to go out and buy 3 books on 6502 vic because going back and forth from programmers refrence to ML for beginners, and VICE/DASM/vicmon24576 is alot of headaches. Hopefully the books arrive soon.
thats fd up dude , by the time i stopped DASM the file was 360 MB large, i thought you guys were here to help
I believe Legacy could have use of an archive of small DASM examples. Copy and paste from a forum involves a high risk of failure since the assembler is so picky on indention. One space too many or too little may end up in pure frustration.
Leg, do you think a set of simple (preferrably commented) programs would help you get going?
Leg, do you think a set of simple (preferrably commented) programs would help you get going?
Anders Carlsson
That would be great thanks carlsson, and I have a copy of VIC Revealed coming too. I know its a learning process, just hard to learn without the proper tools. I am self taught in vc++ , vb, and I went to school for that too. So hopefully with a little hard work and determination I'll be on my way to understanding why a processor does what it does, and make it do what I want it to. Thanks!