CBM prg Studio
Moderator: Moderators
-
- Vic 20 Enthusiast
- Posts: 179
- Joined: Fri Mar 19, 2010 4:31 pm
- Website: http://www.ajordison.co.uk/
- Location: Hartlepool, UK
- Occupation: Software Engineer
Sorry for the late reply!
First off, 'ror acc+1' isn't being assembled properly. It's being assembled to $66, which is the zero page ror. If you give the label 'acc' a value it works as expected. This is definitely a bug though as the assembler should say that 'acc' hasn't been defined.
@Kweepa, what are anonymous labels? I've never heard of them! No there aren't any macros, I might add them but I didn't think anyone used them, to be honest.
As for the binary import, the best way is to load it into the memory viewer and disassemble it from there.
First off, 'ror acc+1' isn't being assembled properly. It's being assembled to $66, which is the zero page ror. If you give the label 'acc' a value it works as expected. This is definitely a bug though as the assembler should say that 'acc' hasn't been defined.
@Kweepa, what are anonymous labels? I've never heard of them! No there aren't any macros, I might add them but I didn't think anyone used them, to be honest.
As for the binary import, the best way is to load it into the memory viewer and disassemble it from there.
-
- Omega Star Commander
- Posts: 1371
- Joined: Thu Jan 31, 2008 2:12 pm
- Website: https://robert.hurst-ri.us
- Location: Providence, RI
- Occupation: Tech & Innovation
Anonymous labels and macros are 'advanced' features of a, well, macro assembler... adding macros to any degree that other assemblers have already will take quite a bit of time and add a lot of complexity for the compiler, editor, documentation, end user, . . .
I'd like to suggest you continue to focus on your project's objective of being a friendly IDE for Commodore computers: so far it achieves this for BASIC, assembler, charset/sprite graphics, and even debugging has been introduced. Adding tools to integrate SID music as part of the project, or a wizard to convert WAV files into usable 4- or 8-bit playback data, or support for BASIC Super Expander, 3.5 (TED) and 7.0 (128) would be very cool next steps.
IMO, the (integrated) debugger should mature in a way that allows it to be useful for the beginner/enthusiast as a learning aide. For debugging that is better achieved within the target Commodore host, launching the project with a DEBUG boolean checkbox would be 'friendly'... if enabled, it could add some sort of Programmer's Aide function to the emulator's cartridge slot, like TRACE ON / TRACE OFF if my memory serves. For assembler projects, leverage the debugger already present in the emulator (VICE and MESS both have very mature debuggers) -- make for easier integration of that process by launching them with their appropriate command-line switches to have their debugger's enabled at startup; and you can advance that process more if the project can export assembler symbols and have them load into the emulator's debugger -- VICE does that extremely well and makes for a much friendlier debugging session for the programmer to simply 'watch SYMBOL' rather than doing a manual lookup of what SYMBOL resolves as some hex address to enter for each session.
I'd like to suggest you continue to focus on your project's objective of being a friendly IDE for Commodore computers: so far it achieves this for BASIC, assembler, charset/sprite graphics, and even debugging has been introduced. Adding tools to integrate SID music as part of the project, or a wizard to convert WAV files into usable 4- or 8-bit playback data, or support for BASIC Super Expander, 3.5 (TED) and 7.0 (128) would be very cool next steps.
IMO, the (integrated) debugger should mature in a way that allows it to be useful for the beginner/enthusiast as a learning aide. For debugging that is better achieved within the target Commodore host, launching the project with a DEBUG boolean checkbox would be 'friendly'... if enabled, it could add some sort of Programmer's Aide function to the emulator's cartridge slot, like TRACE ON / TRACE OFF if my memory serves. For assembler projects, leverage the debugger already present in the emulator (VICE and MESS both have very mature debuggers) -- make for easier integration of that process by launching them with their appropriate command-line switches to have their debugger's enabled at startup; and you can advance that process more if the project can export assembler symbols and have them load into the emulator's debugger -- VICE does that extremely well and makes for a much friendlier debugging session for the programmer to simply 'watch SYMBOL' rather than doing a manual lookup of what SYMBOL resolves as some hex address to enter for each session.
Any technology distinguishable from magic is insufficiently advanced.
https://robert.hurst-ri.us/rob/retrocomputing
https://robert.hurst-ri.us/rob/retrocomputing
-
- Vic 20 Enthusiast
- Posts: 179
- Joined: Fri Mar 19, 2010 4:31 pm
- Website: http://www.ajordison.co.uk/
- Location: Hartlepool, UK
- Occupation: Software Engineer
Thanks for that. Based on your comments I think I'll concentrate on two areas for the moment:
* Integrate and add support for symbols in my debugger,
* Add support for using third party debuggers. I didn't know VICE even had a debugger until recently! I might need some help with this.
My debugger was never meant to compete with the 'big boys', but you're right, it is useful as a learning tool and for testing small programs, as is CBM prg Studio in general.
I'm not quite sure what you mean about adding Programmer's Aid functions to the cartridge slot, but that can wait until a later date.
* Integrate and add support for symbols in my debugger,
* Add support for using third party debuggers. I didn't know VICE even had a debugger until recently! I might need some help with this.
My debugger was never meant to compete with the 'big boys', but you're right, it is useful as a learning tool and for testing small programs, as is CBM prg Studio in general.
I'm not quite sure what you mean about adding Programmer's Aid functions to the cartridge slot, but that can wait until a later date.
- Kweepa
- Vic 20 Scientist
- Posts: 1315
- Joined: Fri Jan 04, 2008 5:11 pm
- Location: Austin, Texas
- Occupation: Game maker
Another bug:
Loads and stores to the zero page are assembled correctly, but if the zero page address is odd (I think this is the condition), the assembler adds BRK ($00) after the instruction.
I wouldn't lump anonymous labels and macros together. Anonymous labels are great for my coding speed as I don't have to get all caught up coming up with a decent name for a jump destination. Here's an example using ACME syntax.
-
lda xstep
beq +
dec
cmp #12
beq ++
+
dey
bne -
++
rts
I hope that's self explanatory
On the learning tool front, I would love a feature that adds column (like the line numbers) showing the number of bytes and the timings for each instruction. Perhaps highlighting a block of code could sum those up and put it in a tooltip.
Awesome job so far! Hopefully I'll have a CBM Prg Studio produced game soon.
Loads and stores to the zero page are assembled correctly, but if the zero page address is odd (I think this is the condition), the assembler adds BRK ($00) after the instruction.
I wouldn't lump anonymous labels and macros together. Anonymous labels are great for my coding speed as I don't have to get all caught up coming up with a decent name for a jump destination. Here's an example using ACME syntax.
-
lda xstep
beq +
dec
cmp #12
beq ++
+
dey
bne -
++
rts
I hope that's self explanatory
On the learning tool front, I would love a feature that adds column (like the line numbers) showing the number of bytes and the timings for each instruction. Perhaps highlighting a block of code could sum those up and put it in a tooltip.
Awesome job so far! Hopefully I'll have a CBM Prg Studio produced game soon.
-
- Vic 20 Enthusiast
- Posts: 179
- Joined: Fri Mar 19, 2010 4:31 pm
- Website: http://www.ajordison.co.uk/
- Location: Hartlepool, UK
- Occupation: Software Engineer
Can you post some sample code (it doesn't have to be all of it) which does this? I can't reproduce it here.Kweepa wrote:Another bug:
Loads and stores to the zero page are assembled correctly, but if the zero page address is odd (I think this is the condition), the assembler adds BRK ($00) after the instruction.
- Kweepa
- Vic 20 Scientist
- Posts: 1315
- Joined: Fri Jan 04, 2008 5:11 pm
- Location: Austin, Texas
- Occupation: Game maker
Code: Select all
*=$A0
mac word 0
ext word 0
aux word 0
*=$1400
mult
sta mac
stx mac+1
mult_
lda #0
sta ext+1
ldy #$11
clc
mulloop
ror ext+1
ror
ror mac+1
ror mac
bcc mul2
clc
adc aux
tax
lda aux+1
adc ext+1
sta ext+1
txa
mul2
dey
bne mulloop
lda mac+1
rts
Code: Select all
*=$A0
00A0 00 BRK
00A1 00 BRK
00A2 00 BRK
00A3 00 BRK
00A4 00 BRK
00A5 00 BRK
*=$1400
1400 85 A0 STA $A0
1402 86 A1 STX $A1
1404 00 BRK
1405 A9 00 LDA #$00
1407 85 A3 STA $A3
1409 00 BRK
140A A0 11 LDY #$11
140C 18 CLC
140D 66 A3 ROR $A3
140F 00 BRK
1410 6A ROR
1411 66 A1 ROR $A1
1413 00 BRK
1414 66 A0 ROR $A0
1416 90 0E BCC $1426
1418 18 CLC
1419 65 A4 ADC $A4
141B AA TAX
141C A5 A5 LDA $A5
141E 00 BRK
141F 65 A3 ADC $A3
1421 00 BRK
1422 85 A3 STA $A3
1424 00 BRK
1425 8A TXA
1426 88 DEY
1427 D0 E4 BNE $140D
1429 A5 A1 LDA $A1
142B 00 BRK
142C 60 RTS
-
- Vic 20 Enthusiast
- Posts: 179
- Joined: Fri Mar 19, 2010 4:31 pm
- Website: http://www.ajordison.co.uk/
- Location: Hartlepool, UK
- Occupation: Software Engineer
- Kweepa
- Vic 20 Scientist
- Posts: 1315
- Joined: Fri Jan 04, 2008 5:11 pm
- Location: Austin, Texas
- Occupation: Game maker
Another small bug:Results in 9, not 9E, being added to the machine code.
I worked around it by using
2011SYS4109 added
Code: Select all
byte $9e
I worked around it by using
Code: Select all
byte 158
-
- Vic 20 Enthusiast
- Posts: 179
- Joined: Fri Mar 19, 2010 4:31 pm
- Website: http://www.ajordison.co.uk/
- Location: Hartlepool, UK
- Occupation: Software Engineer
- Kweepa
- Vic 20 Scientist
- Posts: 1315
- Joined: Fri Jan 04, 2008 5:11 pm
- Location: Austin, Texas
- Occupation: Game maker
Another little bug: didn't produce any output. It just skipped to the next instruction. I hardcoded and it worked fine.
Any sign of the new version? I can't wait to try out the integrated debugging!
Code: Select all
ora #>textures
Code: Select all
ora #$16
Any sign of the new version? I can't wait to try out the integrated debugging!
-
- Vic 20 Enthusiast
- Posts: 179
- Joined: Fri Mar 19, 2010 4:31 pm
- Website: http://www.ajordison.co.uk/
- Location: Hartlepool, UK
- Occupation: Software Engineer
-
- Vic 20 Enthusiast
- Posts: 179
- Joined: Fri Mar 19, 2010 4:31 pm
- Website: http://www.ajordison.co.uk/
- Location: Hartlepool, UK
- Occupation: Software Engineer
And here it is! Version 1.3.0 has been released and can be downloaded from www.ajordison.co.uk . Once again, thanks for all the help and support.
Enjoy
Enjoy
- Kweepa
- Vic 20 Scientist
- Posts: 1315
- Joined: Fri Jan 04, 2008 5:11 pm
- Location: Austin, Texas
- Occupation: Game maker
Hi AJ,
Another bug report. The first part is perhaps a feature?
If I try to compile this code, the LDAs just have 0 as their operand, and the JMP indirect doesn't compile: Invalid operand, label, or variable.
I can work around it for now with
or
But it wastes a few bytes / isn't as legible...
Thanks,
Steve
Another bug report. The first part is perhaps a feature?
Code: Select all
callback_fn = $20 ; ZP or not, no difference
...
; push return address onto stack, msb then lsb
lda #>(callback_rts-1)
pha
lda #<(callback_rts-1)
pha
jmp (callback_fn)
callback_rts
I can work around it for now with
Code: Select all
lda #>callback_rts
pha
lda #<callback_rts
clc
sbc #1
pha
jmp ($20)
callback_rts
Code: Select all
lda #>callback_rts
pha
lda #<callback_rts
pha
byte $6c, $20 ; jmp ($20)
callback_rts
byte 0
Thanks,
Steve
-
- Vic 20 Enthusiast
- Posts: 179
- Joined: Fri Mar 19, 2010 4:31 pm
- Website: http://www.ajordison.co.uk/
- Location: Hartlepool, UK
- Occupation: Software Engineer
Hi Steve,
I might have fixed this. Assembling this program:
(I had to remove the braces after the LDAs)
Gives this output:
Is this what you would expect?
Cheers.
I might have fixed this. Assembling this program:
Code: Select all
*=$c000
callback_fn = $20 ; ZP or not, no difference ...
; push return address onto stack, msb then lsb
lda #>callback_rts-1
pha
lda #<callback_rts-1
pha
jmp (callback_fn)
callback_rts rts
Gives this output:
Code: Select all
*=$C000
C000 A9 C0 LDA #$C0
C002 48 PHA
C003 A9 08 LDA #$08
C005 48 PHA
C006 6C 20 00 JMP ($0020)
C009 60 RTS
Cheers.