[MrGibson.com Home]
Odyssey2 Macro Assembler
Assembler Manual

What you need to know before you program

Odyssey2 uses the Intel 8048 CPU.  Always start with define of:
  cpu  8048
  org  400h

Odyssey2 has:
4 custom sprites and 12 movable predefined graphic characters on screen.
There are 64 graphic characters including letters and numbers, 
ball, 3 types of boats, a plane, man, and others.

Like other computers at the time, graphics characters/sprites are broken down to 
8x8 blocks or 64 bits/pixels:

  db  10111101b
  db  01111110b
  db  10110111b
  db  10110111b
  db  11111111b
  db  01111110b
  db  11011011b
  db  10010001b

Sprites and graphic characters are limited to 8 colors while grid graphics can 
have up to 16 colors.


Appendix A: Full Technical specifications: CPU - Intel 8048 8-bit microcontroller running at 5.37 MHz Memory: CPU-internal RAM: 64 bytes CPU-external RAM: 128 bytes Audio/video RAM: 128 bytes BIOS ROM: 1024 bytes Video: Intel 8244 with 160×200 resolution 16-color fixed palette (8 basic colors - black, blue, green, cyan, red, magenta, yellow and white - with a half-brightness variation (4-bit RGBI)); sprites may only use 8 of these colors 4 8×8 single-color user-defined sprites; each sprite's color may be set independently 12 8×8 single-color characters; must be one of the 64 shapes built into the ROM BIOS; can be freely positioned like sprites, but cannot overlap each other; each character's color may be set independently 4 quad characters; groups of four characters displayed in a row 9×8 background grid; dots, lines, or solid blocks
Appendix B: Video graphic control address Video sprite 0 ctrl 000h Sprite 0 Control range is 000h - 003h [000h is Xcord, 001h is Ycord, 002h color] Video sprite 1 ctrl 004h Sprite 1 Control rande is 004h - 007h [004h is Xcord, 005h is Ycord, 006h color] Video sprite 2 ctrl 008h Sprite 2 Control range is 008h - 00Bh [008h is Xcord, 009h is Ycord, 00Ah color] Video sprite 3 ctrl 00Ch Sprite 3 Control range is 00Ch - 00Fh [00Ch is Xcord, 00Dh is Ycord, 00Eh color] vdc character 0 010h vdc character 1 014h vdc character 2 018h vdc character 3 01Ch vdc character 4 020h vdc character 5 024h vdc character 6 028h vdc character 7 02Ch vdc character 8 030h vdc character 9 034h vdc character a 038h vdc character b 03Ch vdc sprite 0 shape 080h vdc sprite 1 shape 088h vdc sprite 2 shape 090h vdc sprite 3 shape 098h
Appendix C: Odyssey2 Character Set
#   HEX  Character     #   HEX  Character
0   00   0             32  20   A             
1   01   1             33  21   Z             
2   02   2             34  22   X            
3   03   3             35  23   C             
4   04   4             36  24   V             
5   05   5             37  25   B             
6   06   6             38  26   M             
7   07   7             39  27   .             
8   08   8             40  28   -             
9   09   9             41  29   x             
10  0A   :             42  2A   “divide sign” 
11  0B   $             43  2B   =             
12  0C                 44  2C   Y             
13  0D   ?             45  2D   N             
14  0E   L             46  2E   /             
15  0F   P             47  2F   “block”       
16  10   +             48  30   10
17  11   W             49  31   “ball”
18  12   E             50  32   “man right”
19  13   R             51  33   “man right walk”
20  14   T             52  34   “man left walk”
21  15   U             53  35   “man left”
22  16   I             54  36   “arrow right”
23  17   O             55  37   “tree”
24  18   Q             56  38   “slope left”
25  19   S             57  39   “slope right”
26  1A   D             58  3A   “man forward”
27  1B   F             59  3B   \
28  1C   G             60  3C   “sub/ship 1”
29  1D   H             61  3D   “plane”
30  1E   J             62  3E   “ship 2”
31  1F   K             63  3F   “ship 3”

Appendix D: Built in sounds beep-error 028h explode 02Eh alarm 03Ch select 04Ah keyclick 056h buzz 05Ah select2 05Eh shoot 06Ah
Appendix E: Joystick reading call 038Fh Will read joystick and store to accumulator. Load 000 into Register 1 before call statement for joystick 0 and 001 for joystick 1 Return Values: #001h joystick up #002h joystick right #004h joystick down #008h joystick Left
Assembler commands: Usage |HEX|byte(s)|info
nop NOP |00|1|No Operation No operation. Command is often used as a pause in operation (eat a clock cycle).
anl ANL A,rr |58|1|AND Logical register A=A&rr ANL A,@r |50|1|AND Logical memory A=A&[r] ANL A,#n |53|2|AND Logical Immediate A=A&n ANL pp,#n|98|2|AND Logical I/O port pp=pp&n analyze value The function is great for using to compare keyboard or joystick input. Note: use with jnz function example: anl a,#002h jnz do_this Example checks to see if accumalator has the hex value of 02, if so, go to code that has do_this.
ret RET |83|2|Return from subroutine Return to where branched (from subroutine)
call CALL a |14|2|Call subroutine
jmp JMP a |04|2|Unconditional Jump
jnz JNZ l |96|2|Jump if Not Zero If A<>0 Jump if not zero, if true