Noizer, I appreciate your guidance on this. Please see the following one-minute demo:
https://youtu.be/DYRWQkK7uWc
Moderator: Moderators
Noizer, I appreciate your guidance on this. Please see the following one-minute demo:
Breakpoints are super-important to me, so I spent a ton of time thinking about what I wanted in a functional and considerate breakpoint management system. I'm happy that you noticed it. I'll be writing the documentation this weekend, and I expect that more than half the document is going to be dedicated to the BRK handler.
Wow! Never saw before undocumented opcodes assembled so easy - on vic 20 screen. Master skills, Respect!chysn wrote: ↑Fri May 15, 2020 5:40 pm
Noizer, I appreciate your guidance on this. Please see the following one-minute demo:
https://youtu.be/DYRWQkK7uWc
Thanks. I think it's just that most on-screen assemblers were written before anybody cared about undocumented instructions, rather than any particular skill on my part.Noizer wrote: ↑Sat May 16, 2020 11:06 amWow! Never saw before undocumented opcodes assembled so easy - on vic 20 screen. Master skills, Respect!chysn wrote: ↑Fri May 15, 2020 5:40 pm
Noizer, I appreciate your guidance on this. Please see the following one-minute demo:
https://youtu.be/DYRWQkK7uWc
Code: Select all
; 8-Bit Bubble Sort Subroutine
; Ascending
;
; Adapted from Example 4-4, 6502 Software Design, Leo J. Scanlon, 1980
;
; Preparations:
; X = List low byte
; Y = List high byte
; A = List length
* = 1800
List = $00 ; Location of list (2 bytes)
Size = $02 ; Size of list
Exchange = $03 ; Swap flag, indicates at least one swap
SortAsc: stx List
sty List+1
sta Size
sort8: ldy #$00
sty Exchange
ldx Size
dex
nxtel: lda (List),y
iny
cmp (List),y
bcc chkend
beq chkend
pha
lda (List),y
dey
sta (List),y
pla
iny
sta (List),y
lda #$ff
sta Exchange
chkend: dex
bne nxtel
bit Exchange
bmi sort8
rts
Code: Select all
10 N=100:DIMA(N)
11 FORI=1TON:A(I)=RND(1):NEXT
12 :
13 T1=TI
14 :
15 FORI=2TON:A=A(I)
16 FORJ=I-1TO1STEP-1:IFA(J)>ATHENA(J+1)=A(J):NEXT
17 A(J+1)=A:NEXTI
18 :
19 T2=TI
20 :
21 FORI=1TON:PRINTA(I):NEXT
22 PRINT:PRINTT2-T1
I pretty much turned to a random page in Scanlon's book to grab a subroutine to write a unit test for. I've been asking myself the question, What can you do with a machine language monitor that can run its commands in BASIC programs? Data loading was one answer, as the Hex Editor is way, way faster than DATA statements. And so assertions were a natural next step.
Code: Select all
=00fa 80
This is what I am doing with the inline assembler of BBC BASIC all the time, and how it also already was implemented with pretty much any symbolic assembler that used the BASIC editor of a CBM 8-bit machine in those times: they just took your wedge assembler a step forward and endowed the operands with symbolic addressing.chysn wrote: I've been asking myself the question, What can you do with a machine language monitor that can run its commands in BASIC programs?
Hmm... I don't think a DATA loader would be sooo slow. Having somewhat plain-text assembly code in a BASIC listing is a more reasonable achievement (compared to a DATA number desert). But then, off-line documentation serves a similar purpose.Data loading was one answer, as the Hex Editor is way, way faster than DATA statements.
Now imagine you don't have the luxury of a cross-assembler at hand, and are just sitting with your VIC-20 + native tool on a party. Then you need to organize your work flow in a way addresses are *not* constantly changing (or, at least, only once and then, when doing major changes).The tricky thing is that addresses of routines are constantly changing. So with every build, I have xa output a symbol table, which I can grep.
It took me a while to be convinced (by you, as it happens) that a cross-assembler was the way to go, and I can't imagine going back for anything bigger than a few hundred bytes. I honestly don't even remember how I wrote machine language code when I was a kid. Somehow I got things done, but it must have been miserable and I've blocked out all memory of it.Mike wrote: ↑Fri May 22, 2020 4:44 pm Now imagine you don't have the luxury of a cross-assembler at hand, and are just sitting with your VIC-20 + native tool on a party. Then you need to organize your work flow in a way addresses are *not* constantly changing (or, at least, only once and then, when doing major changes).
That's why I followed up my last remark with a wink smiley.chysn wrote:It took me a while to be convinced (by you, as it happens) that a cross-assembler was the way to go, and I can't imagine going back for anything bigger than a few hundred bytes.
By hand, on paper. Working out the branch offsets manually. Transferring the opcodes into decimal numbers. Into DATA lines. The size of the resulting code I wrote this way topped out at probably ~100 bytes.I honestly don't even remember how I wrote machine language code when I was a kid. Somehow I got things done, but it must have been miserable and I've blocked out all memory of it.
The nice thing is, the RAM size of the unexpanded VIC-20 roughly corresponds to the size of the 'scratchpad memory' of the human brain. Means, one can keep the equivalent of a written page of paper up and active while working on suchalike stuff. Anything beyond that requires one to keep notes on paper.But I do know that when I'm dealing with code on the VIC, that the symbol table is in my head, and I know where everything is.
O.K.wAx is a partner for a cross-assembler, not an alternative to one. It doesn't even natively save to disk, because that's outside its scope. I need to find the bugs, and I need to make sure that I don't break things trying to fix things.
That's interesting. That's probably why it seems like I'm psychologically hard-wired to love the VIC.Mike wrote: ↑Fri May 22, 2020 6:13 pm The nice thing is, the RAM size of the unexpanded VIC-20 roughly corresponds to the size of the 'scratchpad memory' of the human brain. Means, one can keep the equivalent of a written page of paper up and active while working on suchalike stuff. Anything beyond that requires one to keep notes on paper.
chysn wrote:...PM sent - I guess ... sometimes the outbox gets stuck here, is that normal?