1;;==========================================================================;; 2;; Joe Zbiciak's HELLO WORLD, Version 2. ;; 3;; PUBLIC DOMAIN ;; 4;; http://spatula-city.org/~im14u2c/intv/ ;; 5;;==========================================================================;; 6 7;* ======================================================================== *; 8;* TO BUILD IN BIN+CFG FORMAT: *; 9;* as1600 -o hello.bin -l hello.lst hello.asm *; 10;* *; 11;* TO BUILD IN ROM FORMAT: *; 12;* as1600 -o hello.rom -l hello.lst hello.asm *; 13;* ======================================================================== *; 14 15;* ======================================================================== *; 16;* This demo (specifically, the contents of hello2.asm) is hereby placed *; 17;* into the public domain. The library routines it includes are NOT *; 18;* placed in the public domain, however. You may distribute and/or *; 19;* modify this demo as you see fit. Enjoy! *; 20;* ======================================================================== *; 21 22ROMW 16 ; Use standard GI 10-bit ROM width 23 24;------------------------------------------------------------------------------ 25; Include system information 26;------------------------------------------------------------------------------ 27INCLUDE "../library/gimini.asm" 28 29;------------------------------------------------------------------------------ 30; macros 31;------------------------------------------------------------------------------ 32 33MACRO gen_cs_card(f, c, g, a) 34(GEN_CS_CARD.%f% + %c%*8 + GEN_CS_CARD.%g% + GEN_CS_CARD.%a%) 35ENDM 36 37MACRO disp_ptr(r, c) 38($200 + %r%*20 + %c%) 39ENDM 40 41MACRO disp_ofs(r, c) 42(%r%*20 + %c%) 43ENDM 44 45;; MVOD: Write a 16-bit value as Double-Byte-Data. Leaves its first 46;; operand byte-swapped. 47MACRO MVOD r, a 48MVO %r%, %a% 49SWAP %r% 50MVO %r%, %a% + 1 51ENDM 52 53;; LOOP: Decrements %r%, and branches to %l% if it's non-zero. 54MACRO LOOP r, l 55DECR %r% 56BNEQ %l% 57ENDM 58 59GEN_CS_CARD PROC 60@@Black EQU 00000000000000b ; foreground == 0 61@@Blue EQU 00000000000001b ; foreground == 1 62@@Red EQU 00000000000010b ; foreground == 2 63@@Tan EQU 00000000000011b ; foreground == 3 64@@DarkGreen EQU 00000000000100b ; foreground == 4 65@@Green EQU 00000000000101b ; foreground == 5 66@@Yellow EQU 00000000000110b ; foreground == 6 67@@White EQU 00000000000111b ; foreground == 7 68@@Grey EQU 01000000000000b ; foreground == 8 69@@Cyan EQU 01000000000001b ; foreground == 9 70@@Orange EQU 01000000000010b ; foreground == 10 71@@Brown EQU 01000000000011b ; foreground == 11 72@@Pink EQU 01000000000100b ; foreground == 12 73@@LightBlue EQU 01000000000101b ; foreground == 13 74@@YellowGreen EQU 01000000000110b ; foreground == 14 75@@Purple EQU 01000000000111b ; foreground == 15 76@@GRAM EQU 00100000000000b ; Select card from GRAM 77@@GROM EQU 00000000000000b ; Select card from GROM 78@@Advance EQU 10000000000000b ; Advances color stack. 79@@NoAdvance EQU 00000000000000b ; Does not advance color stack 80ENDP 81 82 83;------------------------------------------------------------------------------ 84; EXEC-friendly ROM header. 85;------------------------------------------------------------------------------ 86ORG $5000 ; Use default memory map 87ROMHDR: BIDECLE ZERO ; MOB picture base (points to NULL list) 88BIDECLE ZERO ; Process table (points to NULL list) 89BIDECLE MAIN ; Program start address 90BIDECLE ZERO ; Bkgnd picture base (points to NULL list) 91BIDECLE ONES ; GRAM pictures (points to NULL list) 92BIDECLE TITLE ; Cartridge title/date 93DECLE $03C0 ; No ECS title, run code after title, 94; ... no clicks 95ZERO: DECLE $0000 ; Screen border control 96DECLE $0000 ; 0 = color stack, 1 = f/b mode 97ONES: DECLE C_BLU, C_BLU ; Initial color stack 0 and 1: Blue 98DECLE C_BLU, C_BLU ; Initial color stack 2 and 3: Blue 99DECLE C_BLU ; Initial border color: Blue 100;------------------------------------------------------------------------------ 101 102 103;; ======================================================================== ;; 104;; TITLE -- Display our modified title screen & copyright date. ;; 105;; ======================================================================== ;; 106TITLE: PROC 107BYTE 103, 'Hello World', 0 108BEGIN 109 110; Patch the title string to say '=JRMZ=' instead of Mattel. 111PRINT 3, 1, White, "=JRMZ= Productions" 112PRINT 10, 8, White, "2003 =JRMZ=" 113 114; Done. 115RETURN ; Return to EXEC for title screen display 116ENDP 117 118;; ======================================================================== ;; 119;; MAIN: Here's our main program code. ;; 120;; ======================================================================== ;; 121MAIN: PROC 122BEGIN 123 124CALL CLRSCR ; Clear the screen 125 126PRINT 5, 4, Yellow, "Hello World!" 127MVII #disp_ptr(6, 3), R4 128MVII #14, R0 129MVII #gen_cs_card(Yellow, 13, GROM, NoAdvance), R1 ; 13 is 'dash' 130@@dash_loop: 131MVO@ R1, R4 132LOOP R0, @@dash_loop 133 134RETURN ; Return to the EXEC and sit doing nothing. 135ENDP 136 137;; ======================================================================== ;; 138;; LIBRARY INCLUDES ;; 139;; ======================================================================== ;; 140INCLUDE "../library/print.asm" ; PRINT.xxx routines 141INCLUDE "../library/fillmem.asm" ; CLRSCR/FILLZERO/FILLMEM 142 143 144;- 145;----------------------------------------------------------------------------- 146;Joseph Zbiciak http://spatula-city.org/~im14u2c/ Not your average "Joe" 147; R$+@$=W <-- sendmail.cf {$/{{.+ <-- modem noise 148; !@#!@@! <-- Mr. Dithers swearing Zbiciak <-- Joe's last name 149;-------- Program Intellivision! http://spatula-city.org/SDK-1600/ ---------- 150