DELETED

You need an actual VIC.

Moderator: Moderators

Post Reply
DELETED

DASM Macros

Post by DELETED »

DELETED
brighty
Vic 20 Amateur
Posts: 45
Joined: Wed Jul 02, 2008 2:14 am

Post by brighty »

Not a macro, but I've been using the following code (copied from Marko Mäkelä's code here):

Code: Select all

  .org $1201

; The BASIC line

basic:
  .word 0$      ; link to next line
  .word 2009    ; line number
  .byte $9E     ; SYS token

; SYS digits

  .if (* + 8) / 10000
  .byte $30 + start / 10000
  .endif
  .if (* + 7) / 1000
  .byte $30 + start % 10000 / 1000
  .endif
  .if (* + 6) / 100
  .byte $30 + start % 1000 / 100
  .endif
  .if (* + 5) / 10
  .byte $30 + start % 100 / 10
  .endif
  .byte $30 + start % 10
0$:
  .byte 0,0,0   ; end of BASIC program

start
  ...
It works and I just copy and paste it into new projects directly below the .org directive.

My macro-fu is inferior to yours. I've wanted to look for a while but been too busy coding :)

HTH
User avatar
nbla000
Salmon Run
Posts: 2582
Joined: Thu Oct 13, 2005 8:58 am
Location: Italy

Re: DASM Macros

Post by nbla000 »

MRaider wrote:

Code: Select all

$0b,$10,$0a,$00,$9e,"4","1","0","9",$00,$00,$00
Why not this:

Code: Select all

$0b,$10,$d9,$07,$9e,"4","1","0","9",$00,$00,$00
2009 SYS4109 (much more sexy then 10 SYS4109) :wink:
Mega-Cart: the cartridge you plug in once and for all.
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Marko himself rewrote that code as a macro. See basic.i as found in my music player package:

http://www.cbm.sfks.se/files/vplay.zip

As a matter of fact, you find some macros to handle raster timing there too. On top of it, you find my music player which makes heavy use of macros, however not the typical ones you'd associate with an assembler.
Anders Carlsson

Image Image Image Image Image
DELETED

Re: DASM Macros

Post by DELETED »

DELETED
User avatar
Mike
Herr VC
Posts: 5134
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: DASM Macros

Post by Mike »

MRaider wrote:I quite like the idea of using the year as the line number though, it's a nice touch.
To 'compensate' for the space between line number (year), and SYS, I often also put an extra space between SYS and address, like in:

2008 SYS 8584

this line which shows up in quite some files of VICtoria Gold Edition.

Alternatively, if one follows the line number in memory with $00,$3a,$3a,$3a,$3a, these characters, and the rest of the line will not be listed, displaying only the line number.

Michael
DELETED

Post by DELETED »

DELETED
User avatar
Mike
Herr VC
Posts: 5134
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

Such a display is possible using an additional REM, with {DEL} control characters to delete the REM, and further up to the first 'S' of 'SYS', followed by a text message. Here's an example memory dump from VICE:

Code: Select all

>C:1000  00 20 10 d9 07 9e 34 31   . ....41
>C:1008  33 30 3a 8f 14 14 14 14   30:.....
>C:1010  14 14 14 14 14 14 14 28   .......(
>C:1018  43 29 20 4d 49 4b 45 00   C) MIKE.
>C:1020  00 00                     ..
Greetings,

Michael
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

I believe this will always (??) work on an unexpanded VIC-20:

poke 4109,238:poke 4110,15
poke 4111,144:poke 4112,96

2128 sys4099

Analyze the line number 2128, stored as $50 $08 = BVC $100D. :-D
Anders Carlsson

Image Image Image Image Image
User avatar
Mike
Herr VC
Posts: 5134
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

carlsson wrote:always (??)
Not, if I do a 'POKE 783,64' beforehand, setting the V flag before entering ML code. This will then continue to execute the SYS token, and the numbers as funny opcodes ... :lol:
DELETED

Post by DELETED »

DELETED
DELETED

Post by DELETED »

DELETED
DELETED

Post by DELETED »

DELETED
Post Reply