JesterDev Posted July 21, 2004 Share Posted July 21, 2004 This to me is a bit strange, but here goes. With the code below I get loads of Unknown Mnemonic errors. But that's just the beginning.. (This is from Davie's Tutorial btw) processor 6502 include vcs.h include macro.h SEG ORG $F000 Reset StartOfFrame ; Start of vertical blank processing lda #0 sta VBLANK lda #2 sta VSYNC ; 3 scanlines of VSYNCH signal... sta WSYNC sta WSYNC sta WSYNC lda #0 sta VSYNC ; 37 scanlines of vertical blank... sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC ; 192 scanlines of picture... ldx #0 ldy #0 REPEAT 192; scanlines inx stx COLUBK nop nop nop dey sty COLUBK sta WSYNC REPEND lda #%01000010 sta VBLANK ; end of screen - enter blanking ; 30 scanlines of overscan... sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC sta WSYNC jmp StartOfFrame ORG $FFFA .word Reset ; NMI .word Reset ; RESET .word Reset ; IRQ END I know it's to big to fit in 4k and I have to throw in some loops. But I'll get to that in a moment once I figure out what I am doing wrong. So next if I copy and paste this code: processor 6502 include vcs.h SEG org $F000 replacing the what's there I don't get any errors other then: picd.asm (8): error: Unknown Mnemonic 'Reset'. picd.asm (9): error: Unknown Mnemonic 'StartOfFrame'. Unrecoverable error(s) in pass, aborting assembly! Complete. The only major difference is that I don't include the macro.h file and even if I do I still just get these last few errors. So is there perhaps required indenting like with Python? Or what is going on here? I have had the same problems with the Unknown Mnemonic 'LabelName' thing before, and had to copy and past the original code and then it worked. I'm just confused.. This should work just fine right?? Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted July 21, 2004 Share Posted July 21, 2004 I always use colon characters at the end of labels... Reset: StartOfFrame: ...for example. Maybe that's the problem? It's thinking that the labels are instructions (which it has no record for). Quote Link to comment Share on other sites More sharing options...
JesterDev Posted July 22, 2004 Author Share Posted July 22, 2004 That din't seem to make a difference: START OF PASS: 1 picd.asm (9): error: Unknown Mnemonic 'Reset:'. picd.asm (10): error: Unknown Mnemonic 'StartOfFrame:'. ---------------------------------------------------------------------- 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 ???? ---------------------------------------------------------------------- 7 references to unknown symbols. 4 events requiring another assembler pass. - Expression in mnemonic not resolved. - Expression in a DC not resolved. --- Unresolved Symbol List StartOfFrame 0000 ???? (R ) Reset 0000 ???? (R ) --- 2 Unresolved Symbols Unrecoverable error(s) in pass, aborting assembly! Complete. I'm using the lastest version of DASM, and the header files. I tried it on my wifes Windows box and I get the same errors. Quote Link to comment Share on other sites More sharing options...
DEBRO Posted July 22, 2004 Share Posted July 22, 2004 Make sure these labels (Reset and StartOfFrame) are all the way on the left with no spacing or tabbing. I assume these are subroutine labels. If so they need to start with no tabbing. Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted July 22, 2004 Share Posted July 22, 2004 Not according to the listing at the top. Looks like they should both be equal to $F000...bur the error shows them being interpreted as ram addresses (R ) Can you post a file? Quote Link to comment Share on other sites More sharing options...
DEBRO Posted July 22, 2004 Share Posted July 22, 2004 Not according to the listing at the top. Looks like they should both be equal to $F000...bur the error shows them being interpreted as ram addresses (R ) The ® means the symbol was referenced. Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted July 22, 2004 Share Posted July 22, 2004 Oh So for some reason, both of those tags remain at -null- instead of being equal to $F000 - when that ORG appears right above them.... Quote Link to comment Share on other sites More sharing options...
DEBRO Posted July 22, 2004 Share Posted July 22, 2004 Right, there must be a space to the left of them in his file because DASM doesn't see them as labels. If you copied his post to a file and made sure there was no space to the left of these labels it would compile successfully. Quote Link to comment Share on other sites More sharing options...
JesterDev Posted July 22, 2004 Author Share Posted July 22, 2004 Alright well there was a space, but know there is nothing and it still gives the same error. Perhaps I'm not getting it, but I also removed the tab, and still nothing. I can't attached the file for some reason. I zipped it up but it keeps telling me it's not valid.. ??? Anyway I uploaded here: http://home.comcast.net/~nintend0/picd.zip Quote Link to comment Share on other sites More sharing options...
Nukey Shay Posted July 22, 2004 Share Posted July 22, 2004 Hm...it works over here. No probs. Quote Link to comment Share on other sites More sharing options...
JesterDev Posted July 24, 2004 Author Share Posted July 24, 2004 I adjusted the jmp and it compiled for me. Seems strange though. Anyway thanks for the help. Quote Link to comment Share on other sites More sharing options...
+Andrew Davie Posted July 24, 2004 Share Posted July 24, 2004 I adjusted the jmp and it compiled for me. Seems strange though. Anyway thanks for the help. There's no black-magic involved. Labels and symbol *DEFINITIONS* must start in the very first column (that is, no whitespace before them). Opcodes and assembler directives (eg: LDA or ORG) must NOT start in the very first column. They *MUST* have whitespace before them, and optionally a label (which, again, MUST start in the first column). OPTIONALLABELHERE(whitespace)opcode(whitespace)OPTIONALOPERAND(optional comment/whitespace) for example... LABEL jmp LABEL ;this is correct LABEL jmp LABEL; this is incorrect (note the whitespace at the start of the line) jmp LABEL;this is incorrect (opcodes can't start at column 1 -- we should have whitespace before jmp) jmp jmp jmp; this is correct but VERY bad form! Why is the last line correct? It defines a label at the start of the line which just HAPPENS to be the same as an opcode, called 'jmp'. But since the assembler is expecting a label here, it doesn't care if it's the same as an opcode! Next the label 'jmp' is followed by a jmp instruciton (opcode) with a destination address/label of 'jmp' (which is the 'jmp' LABEL defined at the start of the line). This is incredibly bad style. I haven't tested this, and I don't intend to! **DO NOT TRY THIS AT HOME!!** The rules are; definitions of symbols (=labels) MUST start in the first columndirectives to the assembler, and opcodes, MUST have some whitespace before them (ie: they must NOT start in the first column).symbol definitions and opcodes can appear together on a single line. CheersA Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.