Jump to content
IGNORED

Troubles Using DASM


Recommended Posts

Nothing immediately obvious.  The ".\" is not needed for Windows, but that's not the problem.

I see you're using PowerShell, which apparently does need the ./

Probably 20 years since I've actively used Windows.  Is "cmd" command line still available? Have you tried that?

Do you have the file "kernel.asm" in that directory?

Might be useful to post that for us to check assembly too.

 

 

Edited by Andrew Davie
Link to comment
Share on other sites

9 hours ago, Andrew Davie said:

Nothing immediately obvious.  The ".\" is not needed for Windows, but that's not the problem.

I see you're using PowerShell, which apparently does need the ./

Probably 20 years since I've actively used Windows.  Is "cmd" command line still available? Have you tried that?

Do you have the file "kernel.asm" in that directory?

Might be useful to post that for us to check assembly too.

 

 

 

So, thing was that I didn't know whether I needed to set a path in my computer to the dasm.exe executable. Apparently, as long as I'm in the folder when calling it, or I'm entering the the folder it's in through

..\..\dasm_assembler\dasm-2.20.14-win-x64\dasm.exe

, it seems to work. Question now though, is that I don't know if I'm writing the command correctly:

PS C:\Users\pablo\Google Drive\ATARI_2600\dasm_assembler\dasm-2.20.14-win-x64> .\dasm.exe kernel.asm -l kernel.txt -f3 -v5 -o kernel.bin
-o Switch requires file name.
PS C:\Users\pablo\Google Drive\ATARI_2600\dasm_assembler\dasm-2.20.14-win-x64> .\dasm.exe kernel.asm -l kernel.txt -f3 -v5 -okernel.bin
-o Switch requires file name.
PS C:\Users\pablo\Google Drive\ATARI_2600\dasm_assembler\dasm-2.20.14-win-x64> .\dasm.exe kernel.asm -l kernel.txt -f3 -v5 -o kernel.bin
-o Switch requires file name.
PS C:\Users\pablo\Google Drive\ATARI_2600\dasm_assembler\dasm-2.20.14-win-x64> .\dasm.exe ..\..\projects\demo.asm -l kernel.txt -f3 -v5 -o kernel.bin
-o Switch requires file name.
PS C:\Users\pablo\Google Drive\ATARI_2600\dasm_assembler\dasm-2.20.14-win-x64> .\dasm.exe ..\..\projects\ -l demo.asm -f3 -v5 -o kernel.bin
-o Switch requires file name.
PS C:\Users\pablo\Google Drive\ATARI_2600\dasm_assembler\dasm-2.20.14-win-x64> .\dasm.exe ..\..\projects\ -l ..\..\projects\demo.asm -f3 -v5 -o ..\..\projects\kernel.bin
-o Switch requires file name.
PS C:\Users\pablo\Google Drive\ATARI_2600\dasm_assembler\dasm-2.20.14-win-x64> .\dasm.exe ..\..\projects\ -l ..\..\projects\demo.asm -f3 -v5 ..\..\projects\kernel.bin
-o Switch requires file name.
PS C:\Users\pablo\Google Drive\ATARI_2600\dasm_assembler\dasm-2.20.14-win-x64> .\dasm.exe ..\..\projects\ -l ..\..\projects\demo.asm -f3 -v5 -o ..\..\projects\kernel.bin
-o Switch requires file name.

As for what's in the folder I have my file in:

PS C:\Users\pablo\Google Drive\ATARI_2600\projects> ls


    Directory: C:\Users\pablo\Google Drive\ATARI_2600\projects


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----        3/10/2021   8:45 PM           1829 demo.asm

And as for what's inside the file, it's not what's in Andrew's book. I took this code from 8bitworkshop IDE [vcs] - examples/vsync.a , as I just currently want to get something assembling before anything else. I've always have had problems with command line assemblers and compilers. They seem really hard to understand and use.
The code in that link is:
 


	processor 6502
	include "vcs.h"
	include "macro.h"

	org  $f000

; Now we're going to drive the TV signal properly.
; Assuming NTSC standards, we need the following:
; - 3 scanlines of VSYNC
; - 37 blank lines
; - 192 visible scanlines
; - 30 blank lines

; We'll use the VSYNC register to generate the VSYNC signal,
; and the VBLANK register to force a blank screen above
; and below the visible frame (it'll look letterboxed on
; the emulator, but not on a real TV)

; Let's define a variable to hold the starting color
; at memory address $81
BGColor	equ $81

; The CLEAN_START macro zeroes RAM and registers
Start	CLEAN_START

NextFrame
; Enable VBLANK (disable output)
	lda #2
        sta VBLANK
; At the beginning of the frame we set the VSYNC bit...
	lda #2
	sta VSYNC
; And hold it on for 3 scanlines...
	sta WSYNC
	sta WSYNC
	sta WSYNC
; Now we turn VSYNC off.
	lda #0
	sta VSYNC

; Now we need 37 lines of VBLANK...
	ldx #37
LVBlank	sta WSYNC	; accessing WSYNC stops the CPU until next scanline
	dex		; decrement X
	bne LVBlank	; loop until X == 0

; Re-enable output (disable VBLANK)
	lda #0
        sta VBLANK
; 192 scanlines are visible
; We'll draw some rainbows
	ldx #192
	lda BGColor	; load the background color out of RAM
ScanLoop
	adc #1		; add 1 to the current background color in A
	sta COLUBK	; set the background color
	sta WSYNC	; WSYNC doesn't care what value is stored
	dex
	bne ScanLoop

; Enable VBLANK again
	lda #2
        sta VBLANK
; 30 lines of overscan to complete the frame
	ldx #30
LVOver	sta WSYNC
	dex
	bne LVOver
	
; The next frame will start with current color value - 1
; to get a downwards scrolling effect
	dec BGColor

; Go back and do another frame
	jmp NextFrame
	
	org $fffc
	.word Start
	.word Start

Let me know if you need anything else, please. Really just want to assemble something so I know I am able to actually program and try things out.

 

Edited by PaultheRoman
Link to comment
Share on other sites

2 hours ago, PaultheRoman said:

Question now though, is that I don't know if I'm writing the command correctly:

 

 

.\dasm.exe kernel.asm -l kernel.txt -f3 -v5 -o kernel.bin

 

no space between the -o and the filename. Same goes for other options like -l for the listing and -s for the symbol dump.

 

.\dasm.exe kernel.asm -lkernel.txt -f3 -v5 -okernel.bin

 

Link to comment
Share on other sites

Okay, so I took the advice and located the macro.h and vcs.h files into the same directory as demo.asm. I also united the -l and -o switches to their directed file/filename. It's still not working however in PowerShell though. Anything else that I need to fix?

PS C:\Users\pablo\Google Drive\ATARI_2600\projects> ls

    Directory: C:\Users\pablo\Google Drive\ATARI_2600\projects

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----        3/10/2021   8:45 PM           1829 demo.asm
-a----         9/8/2020   3:04 AM           5955 macro.h
-a----         9/8/2020   3:04 AM           9364 vcs.h

PS C:\Users\pablo\Google Drive\ATARI_2600\projects> ..\dasm_assembler\dasm-2.20.14-win-x64\dasm.exe .\demo.asm -ldemo.txt -f3 -v5 -okernel.bin
DASM 2.20.14
Copyright (c) 1988-2020 by the DASM team.
License GPLv2+: GNU GPL version 2 or later (see file LICENSE).
DASM is free software: you are free to change and redistribute it.
There is ABSOLUTELY NO WARRANTY, to the extent permitted by law.

Usage: dasm sourcefile [options]

-f#      output format 1-3 (default 1)
-oname   output file name (else a.out)
-lname   list file name (else none generated)
-Lname   list file, containing all passes
-sname   symbol dump file name (else none generated)
-v#      verboseness 0-4 (default 0)
-d       debug mode (for developers)
-Dsymbol              define symbol, set to 0
-Dsymbol=expression   define symbol, set to expression
-Msymbol=expression   define symbol using EQM (same as -D)
-Idir    search directory for INCLUDE and INCBIN
-p#      maximum number of passes
-P#      maximum number of passes, with fewer checks
-T#      symbol table sorting (default 0 = alphabetical, 1 = address/value)
-E#      error format (default 0 = MS, 1 = Dillon, 2 = GNU)
-S       strict syntax checking
-R       remove binary output-file in case of errors
-m#      safety barrier to abort on recursions, max. allowed file-size in kB

Report bugs on https://github.com/dasm-assembler/dasm please!

Fatal assembly error: Check command-line format.
PS C:\Users\pablo\Google Drive\ATARI_2600\projects>

That's the bad news. The good news, is that in the Command Prompt it seemed to be that it worked:
 


C:\Users\pablo\Google Drive\ATARI_2600\projects>..\dasm_assembler\dasm-2.20.14-win-x64\dasm.exe .\demo.asm -ldemo.txt -f3 -v5 -okernel.bin

START OF PASS: 1
back to: .\demo.asm
back to: .\demo.asm

----------------------------------------------------------------------
SEGMENT NAME                 INIT PC  INIT RPC FINAL PC FINAL RPC
                             f000                            f000
RIOT                     [u] 0280                            0280
TIA_REGISTERS_READ       [u] 0000                            0000
TIA_REGISTERS_WRITE      [u] 0000                            0000
INITIAL CODE SEGMENT         0000 ????                       0000 ????
----------------------------------------------------------------------
4 references to unknown symbols.
0 events requiring another assembler pass.

--- Symbol List (sorted by symbol)
0.FREE_BYTES             0000
1.CLEAR_STACK            f005              (R )
AUDC0                    0015
AUDC1                    0016
AUDF0                    0017
AUDF1                    0018
AUDV0                    0019
AUDV1                    001a
BGColor                  0081              (R )
COLUBK                   0009              (R )
COLUP0                   0006
COLUP1                   0007
COLUPF                   0008
CTRLPF                   000a
CXBLPF                   0006
CXCLR                    002c
CXM0FB                   0004
CXM0P                    0000
CXM1FB                   0005
CXM1P                    0001
CXP0FB                   0002
CXP1FB                   0003
CXPPMM                   0007
ENABL                    001f
ENAM0                    001d
ENAM1                    001e
GRP0                     001b
GRP1                     001c
HMBL                     0024
HMCLR                    002b
HMM0                     0022
HMM1                     0023
HMOVE                    002a
HMP0                     0020
HMP1                     0021
INPT0                    0008
INPT1                    0009
INPT2                    000a
INPT3                    000b
INPT4                    000c
INPT5                    000d
INTIM                    0284
LVBlank                  f01e              (R )
LVOver                   f03a              (R )
NextFrame                f00a              (R )
NO_ILLEGAL_OPCODES       0000 ????         (R )
NUSIZ0                   0004
NUSIZ1                   0005
PF0                      000d
PF1                      000e
PF2                      000f
REFP0                    000b
REFP1                    000c
RESBL                    0014
RESM0                    0012
RESM1                    0013
RESMP0                   0028
RESMP1                   0029
RESP0                    0010
RESP1                    0011
RSYNC                    0003
ScanLoop                 f02b              (R )
Start                    f000              (R )
SWACNT                   0281
SWBCNT                   0283
SWCHA                    0280
SWCHB                    0282
T1024T                   0297
TIA_BASE_ADDRESS         0000              (R )
TIA_BASE_READ_ADDRESS    0000              (R )
TIA_BASE_WRITE_ADDRESS   0000              (R )
TIM1T                    0294
TIM64T                   0296
TIM8T                    0295
TIMINT                   0285
VBLANK                   0001              (R )
VDELBL                   0027
VDELP0                   0025
VDELP1                   0026
VERSION_MACRO            006d
VERSION_VCS              006a
VSYNC                    0000              (R )
WSYNC                    0002              (R )
--- End of Symbol List.
--- Unresolved Symbol List
NO_ILLEGAL_OPCODES       0000 ????         (R )
--- 1 Unresolved Symbol


Complete. (0)

C:\Users\pablo\Google Drive\ATARI_2600\projects>

Is this output what I'm looking for, guys?

Edited by PaultheRoman
Link to comment
Share on other sites

23 hours ago, RevEng said:

See this issue

 

 

 

[nevermind me here, with the answer]

dasm cleanmem.asm -f3 -v0 -o"cart.bin"

 

I think the output option parm may need to be inside the quotes with the filename:

dasm cleanmem.asm -f3 -v0 "-ocart.bin" 

 

Powershell processes command line options and even variables inside of quotes:

 

dasm.exe "$script:ROM_file" "-o$script:BIN_file" "-f3"

 

We're used to seeing just strings inside quotes with most languages but PowerShell is different. 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...