Coprolite.com
Google
 
Web Coprolite.com
SignalQ Sites:
NetAdminTools - Coprolite - NoNIC - SpotBridge - NAW
RoboCoop - AreWeDown - SolarPower - SysAdminTools
Xfig - Gold Loaf - GeekPapa - FixGMC - MCJ - FixRambler
Categories:
GNU/Linux | Homebrew designs | Perl | Microcontrollers | Graphics | Z-80 | FreeDOS | Electronics | Odyssey 2 | 8048 | Other/Msc.

Last 30 Days | Last 60 Days | Last 90 Days | All Articles/Links


Categories:
·GNU/Linux
·Homebrew Designs
·Perl
·Microcontrollers
·Graphics
·Z-80
·FreeDOS
·Other/Msc.
·Electronics
·8048
·All Categories
·Other SignalQ Websites




Counting In Place With the Odyssey 2
Topic: Odyessey 2   Posted:2004-05-15
Printer Friendly: Print

spacerspacer
Here is a program that will count from 0 to 9, and start over again at 0:

cpu     8048
org     0400h
jmp     02C3h           ;system start or reset - select game 
jmp     0009h           ;external IRQ - vblank routine  
jmp     timer           ;timer IRQ
jmp     001Ah           ;vblank service - vblank (collision and clock) 
jmp     start
jmp     0044h           ;continuation of vblank service - vblank (tune)
timer   retr                    ; we don't do anything with timer IRQs 
start
call    011Ch
mov     r6,#09h         ; color
mov     r5,#00h
mov     r2,#00h
vid     mov     r0,#10h         ; starting char in VDC 
mov     r3,#20h         ; x-position
mov     r4,#20h         ; y-position
call    03eah           ; display char  
call    0127h           ; start display
mov     r1,#0ffh
lpo     mov     r7,#0ffh
lpi     djnz    r7,lpi
djnz    r1,lpo
inc     r2
mov     a,r2
mov     r5,a
add     a,#0f6h
jnc     vid
mov     r2,#00h
mov     r5,#00h
jmp     vid





Please read our Terms of Use
Microsoft, Windows, Windows XP, Windows 2000, and NT are either trademarks or registered trademarks of Microsoft Corporation. Coprolite.com is not affiliated with Microsoft Corporation. Linux is a registered trademark of Linus Torvalds. All logos and trademarks in this site are property of their respective owner. Copyright 1997-2008 Coprolite.com

Created by:
MCJ
MCJ CMS