English
Language : 

45111 Datasheet, PDF (44/184 Pages) List of Unclassifed Manufacturers – 14-DAY MONEY BACK GUARANTEE
7 The SASM Assembler
7.1 The Structure of an SX Assembly Program
A typical SX assembly language program contains comments, directives, symbols, labels, expressions
and mnemonic instructions as shown in the sample below.
;---------------------------------------
;| XYZ Controller Version 2.1
|
;|
(C) 1997 Company, Inc.
|
;| Written by John Doe 12/01/97
|
;---------------------------------------
Comments
; =====Device data and Equates=====
DEVICE
SX28, OSCHS2, PROTECT
ID ’V2.1’
RESET Main
Directives
pvdd
data_out_a
EQU rc.1
EQU %1100
; =====Variables=====
org
$08
;vdd
;point to start of ram
Symbols
xbit_in
ds 1
data_low
ds 1
data_high
ds 1
pulses
ds 1
; =====Begin code=====
org
$000
;pc communication data
;programming pulse count
Labels
; =====JUMP TABLE=====
jmp
read
jmp
program
jmp
pin_mode
;$00 = read device
;$01 = program device
;$07 = pin mode
; =====PC COMMUNICATION=====
get_data
mov w,#19
clrb dc
jmp send_data:bits
;ready
;set receive mode
;receive word into data
Mnemonics
Operands
send_okay
mov w,#$00
mov data_low,w
mov w,#4
jmp send_data:go
send_data
:go
mov w,#19
clc
setb dc
;ready null+0+16outdata+1
;clear carry for stop bit
;set transmit mode
Page 44 • SX-Key/Blitz Development System Manual 2.0 • Parallax, Inc.