;; ;; Filename: led1.sx ;; Reference: Introduction to Assembly Language Programming ;; with the Scenix SX Microcontroller, version 1.2 ;; Ref Webpage: http://www.sxtech.com/Downloads/intro_to_sx.pdf ;; Page: 20 ;; Webpage: http://devices.sapp.org/program/scenix/led1/led1.sx ;; Creation Date: 31 May 2000 ;; Last Modified: 31 May 2000 ;; ;; Description: This program will light up an LED connected to ;; any of the 8 Port B (rb) I/O pins. Put a 470 Ohm or so ;; resistor between the LED and +5 volts. ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; device pic16c55, oscxt5 device turbo, stackx_optionx reset Start freq 50_000_000 org 0 Start MOV !rb, #0 MOV rb, #0 SLEEP ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; Program notes: ; ; device pic16c55, oscxt5 ; Assembler directive that tells the assembler to have ; the SX controller to configure itself like a PIC16C55 ; microprocessor and a high-speed oscillator (oscxt5). ; ; device turbo, stackx_optionx ; turbo = fast execution mode ; stackx_optionx = ? ; ; reset Start ; indicates where the program is to start executing. ; "Start" is a user-defined label. This label marks ; where the program will start executing when it is started. ; ; freq 50_000_000 ; Specifies the clock frequency in Hertz. Not needed by ; the SX chip, but helps the debugger determine what clock ; frequency you want to use. The default value is 50 MHz ; if none is specified. The underscore characters are ; optional and used for readability. ; ; org 0 ; "Origin" -- a directive that instructs the assembler to ; begin generating code at the specified address ; ; Start ; A label used to mark a program address. ; ; MOV !rb, #0 ; Write the constant 0 to the port B direction register. ; 0 = output, 1 = input. ; ; MOV rb, #0 ; Writes the data value 0 to the port B register. Each ; pin on port B will then be set to 0 volts. ; ; SLEEP ; Shuts the processor down in low-power mode. ;