Jump to content
IGNORED

Newbie Needs Help


kamakazi

Recommended Posts

Hi All,

 

I am attempting to learn the Intellivision for development purposes. However, when trying to use a printed code of Merrick's Hello World code and compiling it with AS1600, I keep getting all kinds of errors. Would someone be kind enough to tell me what is going wrong? Is it my code or something else?

 

;;------------------------------------------
;;HELLO.ASM
;;------------------------------------------
;;by MICHAEL ALLARD
;;based on source code by Merrick J. Stemen
;;21 OCTOBER 2011
;;Program makes calls to EXEC
;;Not a REAL GAME!
;;
;;Complier: AS1600
;;
;;------------------------------------------
;;Portions of ROMHDR adapted from Joe Zbiciak's PONG
ROMW 10
ORG $5000
;;------------------------------------------
ROMHDR:
WORD $0001 ;Moveable Object Data Pointer
WORD $0000 ;RTAB
WORD START ;START of program
WORD $0000 ;Background graphics pointer
WORD ROMHDR ;CARDTAB
WORD TITLE ;Pointer to ASCIIZ Title String
BYTE $80  ;Bit 7 SET - Run code after title
BYTE $02  ;H/V offset
BYTE $00  ;color stack mode (0=CS; 1=F/B)
BYTE 1,1,1,1 ;color stack data (All blue)
BYTE $02  ;Red Border
;;------------------------------------------
TITLE: BYTE 100, "MIKE'S GAME",0
;;------------------------------------------
;;Print "2000" where the copyright data goes
;;(I realize that I only need two zeros
POST_TITLE: MVII #$2D0,R4 ;WHERE THE COPYRIGHT DATE GOES
MVII #$97,R1	 ;CHARACTER "2" - WHITE
MVO@ R1,R4	 ;PUT THE "2" ON THE SCREEN
MVII #$87,R1	 ;CHARACTER "0" - WHITE
MVO@ R1,R4	 ;"0"
MVO@ R1,R4	 ;"0"
MVO@ R1,R4	 ;"0"
MVO@ R5,R6	 ;PUSH R5
INCR R4	 
JSR R5,$187B
BYTE "Mike",0    ;PUT MY NAME OVER LAST MATTEL
MVI@ R6,R7	 ;RETURN FROM TITLE SCREEN
;;------------------------------------------
START: MVO@ R5,R6 ;PUSH R5
MVII #$0200,R4 ;START OF SCREENMEM
MVII $240,R0  ;TO CLEAR ENTIRE SCREEN
JSR R5,$1738 ;CLEARMEM
MVII #$027C,R4 ;WHERE TO PRINT THE MESSAGE
MVII #$0004,R3 ;COLOR TO PRINT THE MESSAGE
JSR R5,$187B ;PRINT DATA THAT FOLLOWS
BYTE "HELLO WORLD!",0
MVII #$02DE,R4 ;WHERE TO PRINT THE MESSAGE
MVII #$0000,R3 ;COLOR TO PRINT THE MESSAGE
JSR R5,$187B ;PRINT THE DATA THAT FOLLOWS
BYTE "PRESS F10 OR ESC",0
MVI@ R6,R7  ;IS THIS THE END?
;;---------------------------------------------- 

 

And the error messages I keep getting:

 

00000000 ROMW			 00000000 ORG			  00000000 ROMHDR		  
00000000 WORD			 00000000 BYTE			 00000000 TITLE		   
0000000d POST_TITLE	   0000000f MVII			 0000000f MVO@			
0000000f INCR			 0000000f JSR			  0000000f MVI@			
0000000f START		   
  ;;------------------------------------------
  ;;HELLO.ASM
  ;;------------------------------------------
  ;;by MICHAEL ALLARD
  ;;based on source code by Merrick J. Stemen
  ;;21 OCTOBER 2011
  ;;Program makes calls to EXEC
  ;;Not a REAL GAME!
  ;;
  ;;Complier: AS1600
  ;;
  ;;------------------------------------------
  ;;Portions of ROMHDR adapted from Joe Zbiciak's PONG
0x0				    ROMW 10
ERROR - parse error at/before token "10"
0x0				    ORG $5000
ERROR - parse error at/before token "$5000"
  ;;------------------------------------------
0x0				    ROMHDR:
0x0				    WORD $0001 ;Moveable Object Data Pointer
ERROR - parse error at/before token "$0001"
  WORD $0000 ;RTAB
ERROR - multiple definition of label
ERROR - parse error at/before token "$0000"
  WORD START ;START of program
ERROR - invalid opcode
ERROR - multiple definition of label
  WORD $0000 ;Background graphics pointer
ERROR - multiple definition of label
ERROR - parse error at/before token "$0000"
  WORD ROMHDR ;CARDTAB
ERROR - invalid opcode
ERROR - multiple definition of label
  WORD TITLE ;Pointer to ASCIIZ Title String
ERROR - invalid opcode
ERROR - multiple definition of label
0x0				    BYTE $80  ;Bit 7 SET - Run code after title
ERROR - parse error at/before token "$80"
  BYTE $02  ;H/V offset
ERROR - multiple definition of label
ERROR - parse error at/before token "$02"
  BYTE $00  ;color stack mode (0=CS; 1=F/B)
ERROR - multiple definition of label
ERROR - parse error at/before token "$00"
  BYTE 1,1,1,1 ;color stack data (All blue)
ERROR - multiple definition of label
ERROR - parse error at/before token "1"
  BYTE $02  ;Red Border
ERROR - multiple definition of label
ERROR - parse error at/before token "$02"
  ;;------------------------------------------
0000 0064 004d 0049  TITLE: BYTE 100, "MIKE'S GAME",0
0003 004b 0045 0027 0053 0020 0047 0041 004d
000b 0045 0000
  ;;------------------------------------------
  ;;Print "2000" where the copyright data goes
  ;;(I realize that I only need two zeros
000d 02bc 02d0   POST_TITLE: MVII #$2D0,R4 ;WHERE THE COPYRIGHT DATE GOES
0xf				    MVII #$97,R1	 ;CHARACTER "2" - WHITE
ERROR - parse error at/before character "#"
  MVO@ R1,R4	 ;PUT THE "2" ON THE SCREEN
ERROR - invalid opcode
ERROR - parse error at/before character ","
  MVII #$87,R1	 ;CHARACTER "0" - WHITE
ERROR - multiple definition of label
ERROR - parse error at/before character "#"
  MVO@ R1,R4	 ;"0"
ERROR - invalid opcode
ERROR - multiple definition of label
ERROR - parse error at/before character ","
  MVO@ R1,R4	 ;"0"
ERROR - invalid opcode
ERROR - multiple definition of label
ERROR - parse error at/before character ","
  MVO@ R1,R4	 ;"0"
ERROR - invalid opcode
ERROR - multiple definition of label
ERROR - parse error at/before character ","
  MVO@ R5,R6	 ;PUSH R5
ERROR - invalid opcode
ERROR - multiple definition of label
ERROR - parse error at/before character ","
  INCR R4	 
ERROR - invalid opcode
  JSR R5,$187B
ERROR - invalid opcode
ERROR - parse error at/before character ","
  BYTE "Mike",0    ;PUT MY NAME OVER LAST MATTEL
ERROR - multiple definition of label
ERROR - parse error at/before string "Mike"
  MVI@ R6,R7	 ;RETURN FROM TITLE SCREEN
ERROR - invalid opcode
ERROR - parse error at/before character ","
  ;;------------------------------------------
000f 0275   START: MVO@ R5,R6 ;PUSH R5
  MVII #$0200,R4 ;START OF SCREENMEM
ERROR - multiple definition of label
ERROR - parse error at/before character "#"
  MVII $240,R0  ;TO CLEAR ENTIRE SCREEN
ERROR - multiple definition of label
ERROR - parse error at/before token "$240"
  JSR R5,$1738 ;CLEARMEM
ERROR - invalid opcode
ERROR - multiple definition of label
ERROR - parse error at/before character ","
  MVII #$027C,R4 ;WHERE TO PRINT THE MESSAGE
ERROR - multiple definition of label
ERROR - parse error at/before character "#"
  MVII #$0004,R3 ;COLOR TO PRINT THE MESSAGE
ERROR - multiple definition of label
ERROR - parse error at/before character "#"
  JSR R5,$187B ;PRINT DATA THAT FOLLOWS
ERROR - invalid opcode
ERROR - multiple definition of label
ERROR - parse error at/before character ","
  BYTE "HELLO WORLD!",0
ERROR - multiple definition of label
ERROR - parse error at/before string "HELLO WORLD!"
  MVII #$02DE,R4 ;WHERE TO PRINT THE MESSAGE
ERROR - multiple definition of label
ERROR - parse error at/before character "#"
  MVII #$0000,R3 ;COLOR TO PRINT THE MESSAGE
ERROR - multiple definition of label
ERROR - parse error at/before character "#"
  JSR R5,$187B ;PRINT THE DATA THAT FOLLOWS
ERROR - invalid opcode
ERROR - multiple definition of label
ERROR - parse error at/before character ","
  BYTE "PRESS F10 OR ESC",0
ERROR - multiple definition of label
ERROR - parse error at/before string "PRESS F10 OR ESC"
  MVI@ R6,R7  ;IS THIS THE END?
ERROR - invalid opcode
ERROR - multiple definition of label
ERROR - parse error at/before character ","
  ;;---------------------------------------------- 
ERROR SUMMARY - ERRORS DETECTED 74
		   -  WARNINGS	   0

 

Any help in the right direction would be appreciated. For software, I am using the SDK1600 package with all included development apps. The "Hello World" code is from an Electonite document titled "Programming the Intellivision II. After reading the title, which I just noticed, is there a difference between the two or is this code for something else? Thanks in advanced.

Link to comment
Share on other sites

You probably want a space before your instructions mnemonics so that the assembler knows its not a label.

 

You also had a # missing from a MVII instruction. Fixed code is here :-

 

 

 

;;------------------------------------------
;;HELLO.ASM
;;------------------------------------------
;;by MICHAEL ALLARD
;;based on source code by Merrick J. Stemen
;;21 OCTOBER 2011
;;Program makes calls to EXEC
;;Not a REAL GAME!
;;
;;Complier: AS1600
;;
;;------------------------------------------
;;Portions of ROMHDR adapted from Joe Zbiciak's PONG
   ROMW 10
   ORG $5000
;;------------------------------------------
ROMHDR:
   WORD $0001 ;Moveable Object Data Pointer
   WORD $0000 ;RTAB
   WORD START ;START of program
   WORD $0000 ;Background graphics pointer
   WORD ROMHDR ;CARDTAB
   WORD TITLE ;Pointer to ASCIIZ Title String
   BYTE $80  ;Bit 7 SET - Run code after title
   BYTE $02  ;H/V offset
   BYTE $00  ;color stack mode (0=CS; 1=F/B)
   BYTE 1,1,1,1 ;color stack data (All blue)
   BYTE $02  ;Red Border
;;------------------------------------------
TITLE: BYTE 100, "MIKE'S GAME",0
;;------------------------------------------
;;Print "2000" where the copyright data goes
;;(I realize that I only need two zeros
POST_TITLE: MVII #$2D0,R4 ;WHERE THE COPYRIGHT DATE GOES
   MVII #$97,R1	 ;CHARACTER "2" - WHITE
   MVO@ R1,R4	   ;PUT THE "2" ON THE SCREEN
   MVII #$87,R1	 ;CHARACTER "0" - WHITE
   MVO@ R1,R4	   ;"0"
   MVO@ R1,R4	   ;"0"
   MVO@ R1,R4	   ;"0"
   MVO@ R5,R6	   ;PUSH R5
   INCR R4  
   JSR R5,$187B
   BYTE "Mike",0    ;PUT MY NAME OVER LAST MATTEL
   MVI@ R6,R7	   ;RETURN FROM TITLE SCREEN
;;------------------------------------------
START: MVO@ R5,R6 ;PUSH R5
   MVII #$0200,R4 ;START OF SCREENMEM
   MVII #$240,R0  ;TO CLEAR ENTIRE SCREEN
   JSR R5,$1738 ;CLEARMEM
   MVII #$027C,R4 ;WHERE TO PRINT THE MESSAGE
   MVII #$0004,R3 ;COLOR TO PRINT THE MESSAGE
   JSR R5,$187B ;PRINT DATA THAT FOLLOWS
   BYTE "HELLO WORLD!",0
   MVII #$02DE,R4 ;WHERE TO PRINT THE MESSAGE
   MVII #$0000,R3 ;COLOR TO PRINT THE MESSAGE
   JSR R5,$187B ;PRINT THE DATA THAT FOLLOWS
   BYTE "PRESS F10 OR ESC",0
   MVI@ R6,R7  ;IS THIS THE END?
;;----------------------------------------------

 

 

Link to comment
Share on other sites

GroovyBee is right. For reference, the Assembler treats all symbols flushed to the left margin as labels, whether they are followed a colon or not. So, your code

 

MVII #$97,R1

 

is interpreted as if "MVII" were a label followed by the invalid instruction "#$97, R1".

 

-dZ.

Edited by DZ-Jay
Link to comment
Share on other sites

Came here to say the same thing as GroovyBee and DZ-Jay...

 

Strings that start in the first column usually get interpreted as labels. Most modern programming languages (except possibly Python) largely ignore white space. AS1600 (and most assemblers, for that matter) treat the first column of a new line as special, though, to distinguish labels from mnemonics / macros / etc.

 

(The major exception in AS1600 are the MACRO/ENDM directives, which want to start in the first column. That's really rather unique to AS1600, and comes from how Joe Fisher implemented macros in his IMASM tool that I integrated into AS1600. But, let's not get ahead of ourselves... just know that MACRO and ENDM are the two exceptions to "first column means a label".)

Link to comment
Share on other sites

Came here to say the same thing as GroovyBee and DZ-Jay...

 

Strings that start in the first column usually get interpreted as labels. Most modern programming languages (except possibly Python) largely ignore white space. AS1600 (and most assemblers, for that matter) treat the first column of a new line as special, though, to distinguish labels from mnemonics / macros / etc.

 

(The major exception in AS1600 are the MACRO/ENDM directives, which want to start in the first column. That's really rather unique to AS1600, and comes from how Joe Fisher implemented macros in his IMASM tool that I integrated into AS1600. But, let's not get ahead of ourselves... just know that MACRO and ENDM are the two exceptions to "first column means a label".)

 

Er, Joe, if I recall correctly, you can also use a macro in the first column and it'll be expanded properly.

 

-dZ.

Edited by DZ-Jay
Link to comment
Share on other sites

Groovy, what manual?

 

The first rule of the club is don't talk about the club. The second rule of the club is don't talk about the manual :lol:.

 

Shouldnt you be programming your 7800 games so you can hurry up and start the Intv ones, and stop harrassing the tourists!!!!

 

:P :P :P :P :D

Link to comment
Share on other sites

Groovy, what manual?

 

The first rule of the club is don't talk about the club. The second rule of the club is don't talk about the manual :lol:.

 

Shouldnt you be programming your 7800 games so you can hurry up and start the Intv ones, and stop harrassing the tourists!!!!

 

:P :P :P :P :D

 

Ouch! Harassing the tourists, LOL!

 

-dZ.

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...