Skip to content

Instantly share code, notes, and snippets.

@vintagechips
Created September 14, 2018 02:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vintagechips/fedcc5dd542ed595742d8c48add07110 to your computer and use it in GitHub Desktop.
Save vintagechips/fedcc5dd542ed595742d8c48add07110 to your computer and use it in GitHub Desktop.
Z8 Single Board Computer Start-up Program
; Z8 STARTUP PROGRAM
;
; REGISTERS
PORT0 := %00
PORT2 := %02
PORT3 := %03
P0MOD := %F8
P2MOD := %F6
P3MOD := %F7
;
ORG %000C
RESET: DI ;DESABLE INTERRUPT
LD PORT0,#%00 ;ADDRESS PRESET
LD P0MOD,#%66 ;A8-A11, WAIT, INT-STACK, P04-P07(INPUT)
LD P2MOD,#%00 ;SET P20-P27 AS OUTPUT
LD P3MOD,#%01 ;SET P20-P27 PULLUP
;
LOOP: LD PORT2,#%55 ;OUT %55 TO P2
JR STEP
STEP: LD PORT2,#%AA ;OUT %AA TO P2
JR LOOP ;LOOP
;
END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment