Home

Ubicom™ SX Cross Assembler User`s Manual

image

Contents

1. RA latch equ 00001000 SX18 20 28 48 52 port A latch init RA DDIR equ 11110111 SX18 20 28 48 52 port A DDIR value RA LVL equ 00000000 SX18 20 28 48 52 port A LVL value RA PLP equ 00001100 SX18 20 28 48 52 port A PLP value RB latch equ 00000000 SX18 20 28 48 52 port B latch init initial value after reset RB DDIR equ 11111111 SX18 20 28 48 52 port B DDIR value 0 Output 1 Input RB ST equ 11111111 9 X18 20 28 48 52 port B ST value 0 Enable 1 Disabl RB LVL equ 00000000 7SX18 20 28 48 52 port B LVL value 0 CMOS 1 TTL RB_PLP equ 00000000 SX18 20 28 48 52 port B PLP value 0 Enable 1 Disabl RC_latch equ 00000000 7SX18 20 28 48 52 port C latch init initial value after reset RC DDIR equ 11111111 SX18 20 28 48 52 port C DDIR value 0 Output 1 Input RC_ST equ Eb HHE IST 7SX18 20 28 48 52 port C ST value 0 Enable 1 Disabl RC_LVL equ 300000000 1 SX18 20 28 48 52 port C LVL value 0 CMOS 1 TTL RC PLP egu 300000000 7SX18 20 28 48 52 port C PLP value 0 Enable 1 Disabl IFDEF SX48 52 RD latch equ 500000000 SX48 52 port D latch init initial value after reset RD DDIR equ 11111111 SX48 52 port D DDIR value 0 Output 1 Input RD ST equ 11111111 SX48 52 port D ST value 0 Enable 1 Disabl RD_LVL equ 500000000 SX48 52 port D LVL value 0 CMOS 1 TTL RD PLP equ 500000000 SX48 52 port D PLP value 0 Enable 1 Dis
2. 3 1 1 FREQ BREAK WATCH CASE NOCASE SXKey Compatibility Syntax Description Example lt label gt FREQ lt expression gt lt comment gt lt label gt BREAK lt comment gt lt label gt WATCH lt operands gt lt comment gt lt label gt CASE lt comment gt lt label gt NOCASE lt comment gt Ignore the directive and any operands These directives have a particular meaning to the Parallex SXKey assembler but is unsupported by SASM For better portability of code originally written with SXKey SASM will ignore this directive Note that SASM does not make any attempt to validate the operands expected by SXKey The value of the expression on the FREQ directive gives the intended clock frequency in integer Hz The frequency is preserved in the output file for possible use by device programming and debugging tools Use of the FREQ directive declares a symbol named SX FREO as the 32 bit frequency value In addition the output file will contain a 32 bit value at locations 1014 high 16 bits and 1015 low 16 bits holding the frequency or zero if no FREQ directive was assembled DEVICE or FUSES or PROCESSOR Define Device Type and Fuse Bits If the BREAK directive appears the symbol _ SX BREAK will be defined as its address In addition the BREAK address is also found at 1017 in the output file The BREAK directive may only be assembled once in a single program FREQ 20000000 loopinc fr BREAK
3. Filename vpg UART 1 04 src Authors Chris Fogelklou Applications Engineer Ubicom Inc Program Description Virtual Peripherals Guidelines Example source code running at 50MHz with just a transmit and receive UART The code implements UART in software for baud rates of 1200 2400 4800 9600 19200 57600 bps depending on the rate selected it can be selected to work at interrupt rate of 4 32us Interface Pins rs232RxPin equ ra 2 UART receive input rs232TxPin equ ra 3 UART transmit output rts pin equ ra 0 UART 1 RTS input cts pin equ ra 1 UART 1 CTS output p RRR RRR KKK KK kk KR KEK KK kk koc ke RK ke kk KK ko koc ke RK KE KKK RK koc KKK kk koc kk koc ke RK KKK KK RK koc KK ke kk koc ke kk KER koc kk ke ek ke e ke SASM Cross Assembler User s Manual Rev 1 3 15 2000 Ubicom Inc All rights reserved Chapter 2 Program Structure www ubicom com PRR RRR KKK KK RRR EK RAR KK KKK KEK KKK KKK KK EK KKK KKK KKK kk KKK KKK KK KKK KR KKK KK KR KKK HAE KA KEK KKK AE KA A ER Target SX Uncomment one of the following lines to choose the SX18AC SX20AC SX28AC SX48BD SX52BD RBR NEDA PERERA e ERIE EER IR LEAR RE ER RE ERE ERR KE IRS IR HE REE OR IR IR ER RIK E SX18 20 SX28AC Sx48 52 I ERER I E KERR aet CR RI ERR ERIE ERS ERR ERS KR SRI ERIE A RAK ES OK ORC BI Ree Assembler Used Uncomment the following line if using the Parallax SX Key assembler SASM assembler enabled by default
4. The following tiny program is the source for all the example file formats in the following sections Page 1 SASM Cross Assembler Version 1 48 Line RE Opcode 1 2 OFFF OA10 3 4 OFFB OFFF 5 01312D00 6 7 200000010 8 0010 005F 9 0011 0C00 0012 0006 10 0013 0915 11 0014 0A13 12 13 0015 0C02 14 00000016 15 0016 01A6 16 0017 000C 17 Cross Reference 6 symbols Symbol ___SX_BREAK ___SX_FREQ blink rb start start loop 2000 Ubicom Inc All rights reserved Sour Type ADDR DATA ADDR RESV ADDR ADDR ce id reset DEVICE FREQ org start mode mov Loop call jmp Tue Nov 14 18 13 11 2000 Out Demo start 5X48 20 000 000 10 Sf rb 0 blink loop blink mov W 0000_0010 BREAK xor rb W toggle rb 1 ret END Value 00000016 01312D00 00000015 00000006 00000010 00000013 81 Line 0014 0005 0013 0015 0008 0010 SASM Cross Assembler User s Manual Rev 1 3 Appendix B Object File Format www ubicom com B 2 Intel HEX File Formats Intel Hex files are commonly used for file interchange with EPROM programmers A complete Intel Hex file contains one or more hexadecimal records The file ends with an end of file record Each data record begins with a nine character prefix and ends with a two character checksum Each letter corresponds to one hexadecimal digit in ASCII representation Example Record BBAAAATTH
5. 39 224 Nurmeue Constante ss ep a e Eri tee 39 2 3 Symbols s a exa na EE 41 2 3 1 SYINDOLNAames ss sy es be er mr Me ku RM RR E Sees 41 2 3 9 Symbol Tvpess zl oe ey U to eR ud tque HU aT rebar a depu tie EE 41 2 9 3 User Denned Symbols da et een te edes Rodi ote emt 41 2 3 4 Reserved Symbols uix bee ae oes Sew ee a wee ie 42 24 Expression sister essai tre oie DR ES a nn Sista eaves 42 2 4 1 Arithmetic OPeIatOTS A hg sper dope ren SHORE n REA eret 42 2 4 2 Well Defined Expressions sus ae osi EUMD e crus nt 45 2000 Ubicom Inc All rights reserved 3 SASM Cross Assembler User s Manual Rev 1 3 Contents Chapter 3 3 1 Chapter 4 4 1 4 2 4 3 44 4 5 4 6 www ubicom com SASM Assembler Directive Introduction eere ere vere eg rre oe Was Ee a Antes B wee dina NT Bede 47 3 1 1 FREQ BREAK WATCH CASE NOCASE SXKey Compatibility 49 3 1 2 DEVICE or FUSES or PROCESSOR Define Device Type and F se Bits dens dd eyes akva Wee Tu edat oie DUERME tas 50 3 1 3 DS Define Memory Space ocu ne a Rule td es 54 3 1 4 DW Define Data in Memory 22 esp Ge ER n CARRE 54 3 1 5 END End of Source Program 2235 ow exu Nu vare Hx n 54 3 1 6 EQU or GLOBAL Equate a Symbol to an Expression 55 3 1 7 ERROR Emit a User defined Error Message 55 3 1 8 ID Set an ID String in Program Memory 56 3 1 9 IF ELSE ENDIF Conditional Assembly
6. Il Logical Or x zv ll x 2y TRUE amp amp Logical And x y amp amp x y FALSE The unary ll operator takes the absolute value of an expression It is at the same precedence as the other unary operators i e as high as possible A warning is generated if the value has a bit position and the bit position of the result is set to zero The binary gt lt operator bit reverses an expression The value to its left is reversed across as many least bits as specified on its right It has the same precedence as multiplication and division i e higher than addition and lower than DOT The higher order bits are preserved A warning is generated if either value has a non zero bit position and the bit position of the result is set to zero For example 2001 gt lt 13 evaluates to 3000 The unary plus operator forces the bit position of a value to zero This is useful to convert a bit referenced symbol to the address of its file register The unary DOT operator extracts the bit position of a value and returns it as a value with a bit position of zero This is useful to extract just the bit position from a bit referenced symbol For example copy 30 Z 33 copyc copy C 9233 copydc copy DC 7 33 1 copyz copy Z 533 2 copypd copy PD 633 3 copyto copy TO 533 4 SASM Cross Assembler User s Manual Rev 1 3 44 2000 Ubicom Inc All rights reserved www ubicom com Chapter 2 Progr
7. RRR RRR KKK KK RK EEK EEK A koc ke RK ke kk koc kk ke kk KEK KK RK KR KKK ke kk koc KKK KR KK KKK KR KK KKK KKK koc ke kk ke ko ko ko KKK ke ek ke ke ke ek PSX Key PRR RRR RK KKK KEK RRR KK kk koc KKK KEK KK e ke kk KEK KK RK KK KK ke kk KK KK KR KK KKK KR KR KKK ke kk koc KKK KER koc ke kk ke ck ke ke ke ke ee Uncomment one of the following to run the uart vp at the required baud rate TE ERICA KORR eo de eoe e He e OR ERE EEE ERIC OE SKK REK EERAE EEE EERE o deo e OR RES dee CORRER IK RE EER ON OR He eo ee baud1200 baud rate of 1 2 Kbps baud2400 baud4800 baud rate of 4 8 Kbps baud9600 baud rate of 9 6 kbps baud1920 baud rate of 19 2kbps baud5760 baud rate of 57 6kbps RRR RRR KKK KK RK KKK KR KR KK KKK ke kk koc kk ke RK KEK ko koc RK RK KKK kk koc KK KKK KK KKK KR KK KKK KKK hock KKK kk koc ke kk ke ck ke ke ke ke ee d Assembler directives DH Z High speed external osc turbo mode 8 level stack and extended option reg H SX18 20 28 4 pages of program memory and 8 banks of RAM enabled by default SX48 52 8 pages of program memory and 16 banks of RAM enabled by default PRR RRR KKK KK kk RR KK KEK kc ke kk KEK KKK KKK KK EK KK RK RK KK KER KKK KKK KK KKK KR KKK KK KEK KKK KER KK KK KKK KEK ke e IFDEF SX_Key SX Key Directives IFDEF 5X18 20 SX18AC or SX20AC device directives for SX Key device SX18L oschs2 turbo stackx optionx ENDIF IFDEF SX28AC SX28AC device directives for S
8. SX48BD and SX52BD production release bank instruction expand setb fear modifies FSR bits 4 5 and 6 FSR 7 needs to be set by Software noexpand ELSE expand clrb fsr 7 noexpand ENDIF ENDIF endm PRR RRR KKK KK RK kk KK kk KE KKK ke kk KK KK KEK kc kk ko ke RK RK KK ke kk KK KR KEK koc kk ko ke EK kk ke kk kk kk KA KK KKK sj Macro mode Sets the MODE register appropriately for all revisions of SX I This is required since the MODE or MOV M instruction has only a 4 bit operand The SX18 20 28AC use only 4 bits of the MODE register however the SX48 52BD have the added ability of reading or writing some of the MODE registers and therefore use 5 bits of the MODE register The MOV M W instruction modifies all 8 bits of El the MODE register so this instruction must be used on the SX48 52BD to make sure the MODE register is written with the correct value This macro fixes this Di 2000 Ubicom Inc All rights reserved 17 SASM Cross Assembler User s Manual Rev 1 3 Chapter 2 Program Structure www ubicom com So instead of using the MODE or MOV M instructions to load the M register us mode instead LEER ERIE EEE EER RIK eR OS OR BRK BRIS BR KAAR REK KER IE KE A EBV E S _mode macro 1 noexpand IFDEF SX48 52 expand mov w 1 loads the M register correctly for the SX48BD and SX52BD mov m w noexpand ELSE expand mov m 41 l
9. 23 Invalid digit in numeric constant 24 Value is out of range 25 Bad radix value 26 Unknown microcontroller type 27 Unknown output format 28 Unknown listing parameter 29 Bad string syntax 30 Overwriting same program counter location SASM Cross Assembler User s Manual Rev 1 3 91 2000 Ubicom Inc All rights reserved Appendix D Error Message www ubicom com 31 Expected an sign 32 Unexpected EOF 33 Assume value is in HEXADECIMAL 34 Token length exceeds limit 35 Illegal character Ignored 36 File register truncated to 5 bits 37 Literal truncated to 8 bits 38 Missing RAM Bank bits 39 No destination bit 40 Destination bit can only be 0 or 1 4 Bit number out of range 42 Destination address not in selected page 43 Address exceeds memory limit 44 Address is not within lower half of memory page 45 Label must begin at column 1 46 Ignoring unknown directive 47 REPT count exceed limit 48 File register not in current bank 49 MODE register value truncated to 4 bits 50 Expected a fr bit operand 51 Obsolete keyword lt text gt for this device 52 Reset address not in page 0 53 Applied non bitfield operator to a bitfield value 54 Overriding earlier target device declaration 55 ERROR text 56 Source line is too long 57 Local symbol text expands to more than 130 characers 58 Division by zero 59 Literal truncated to 12 bits SASM Cross Assembler User s Manual Rev 1 3 92 2000 Ubicom Inc Al
10. 56 3 1 10 IFDEF ELSE ENDIF Conditional Assembly 57 3 1 11 IFNDEF ELSE ENDIF Conditional Assembly 57 3 1 12 INCLUDE Insert External Source File 58 3 1 13 LIST Control the list file format 58 3 1 14 LPAGE Insert Page Eject in Listing File 59 3 1 15 ORG Set Program Origin e ance nes Ri a 59 3 1 16 RADIX Setuefault radix 2i ac eb yal Eee ee Ee p 59 3 1 17 REPT ENDR Repeat Code Block 60 3 1 18 RESET Set Reset Vector Address uz A R RS Ge 61 3 1 19 RES or ZERO Reserve Storage in Memory 61 3 1 20 SET or Set a Symbol Equal to an Expression 62 3 1 21 SPAC Insert Lines in Listing File 62 3 1 22 TITLE or STITLE Define Program Heading 62 Macros ES BOTTO o pe R R r ven pu Sa et Ion Go Rede ee LPH er Ook qe TE Re qas 63 Macro Denton saca S CAR REX ERS ARONA RN REIR MSS REY Kd 64 4 2 1 MACRO Directive co che gx o ei M ES S EXER ex SEM SNR 64 4 2 2 ENDM DITECUVE osa iS ee ie ba A S ARN EE RE 65 4 2 3 EXITM Directive es mg ded Rr conte cn rto rae ode Oi ERA e 65 4 2 4 LOCAL Directive Me ees dal i sre ee x Le 65 4 2 5 Local Labels and Macros ases os ee E Tus E A RRS 66 Formal Parameters i enha he ERE E RESUME EE 66 Macro Invocation 3 ux A de REA hao hy RA S aus IN ba 67 4 4 1 Actual Values o
11. This is particularly useful to provide usage checking for complex macros The second form of the directive takes a symbol which specifies which pass of the assembler emits the message and additionally whether the message is a comment warning or error The default is a Pass 2 error The additional forms provide for additional message options without cluttering the namespace with extra reserved words Note that the first form of the ERROR directive is supported similarly by Parallax SXKey Example ERROR message Pass 2 error ERROR PI message Pass 1 error ERROR PIW message Pass 1 warning ERROR PIC message Pass 1 comment ERROR P2 message Pass 2 error ERROR P2W message Pass 2 warning ERROR P2C message Pass 2 comment 2000 Ubicom Inc All rights reserved 55 SASM Cross Assembler User s Manual Rev 1 3 Chapter 3 SASM Assembler Directive www ubicom com 3 1 8 ID Set an ID String in Program Memory Syntax Decription Example ID Text Assigns an ID text string at the end of program memory The string may be up to 8 characters and should be in quotes ID Demo28 3 1 9 IF ELSE ENDIF Conditional Assembly Syntax Description Example IF expression source lines ELSE source lines ENDIF ELSE is used in conjunction with IF directive to provide an alternative path If IF tests false the alternative path noted by the ELSE directive is taken providing conditional assembl
12. Universal Asynchronous Receiver Transmitter UART These routines send and receive RS232 serial data and are currently configured though modifications can be made for the popular No parity checking 8 data bit 1 stop bit N 8 1 data format RECEIVING The rs232Rxflag is set high whenever a valid byte of data has been received and it is the calling routine s responsibility to reset this flag once the incoming data has been collected TRANSMITTING The transmit routine requires the data to be inverted 2000 Ubicom Inc All rights reserved 27 SASM Cross Assembler User s Manual Rev 1 3 Chapter 2 Program Structure www ubicom com and loaded rs232Txhigh rs232Txlow register pair with the inverted 8 data bits Stored in rs232Txhigh and rs232Txlow bit 7 set high to act as a start bit Then the number of bits ready for transmission 10 1 start 8 data 1 stop must be loaded into the rs232Txcount register As soon as this latter is done the transmit routine immediately begins sending the data This routine has a varying execution rate and therefore should always be placed after any timing critical virtual peripherals such as timers adcs pwms etc Note The transmit and receive routines are independent and either may be removed if not needed to reduce execution time and memory usage d as long as the initial BANK serial common instruction is kept i
13. 081010000FOFFFABO12DFFOOE3 00000001FF FILE HXL 080010005F0006151302A60CA7 010FFFO010E1 04100000F4FFF7F50D 04100400F7F4F2F01B 04100800F4F4F6F 511 04100C00F6FDF6FFFS 08101000FBFFFF033100FF1696 00000001FF 2000 Ubicom Inc All rights reserved 83 SASM Cross Assembler User s Manual Rev 1 3 Appendix B Object File Format www ubicom com B 3 Binary File Format A binary object file contains an image of the program memory space from SX program address 0000 through OFFF exactly The extra information described in section B 1 1 as appearing at 1000 through 1017 does not appear in the binary file Unused program locations are initialized to the value SOfff The 16 bit program words appear low byte first The file will contain exactly 8192 bytes covering the addresses 0000 through 0FFF regardless of the complexity of the program Since each program word occupies two bytes the file offset of an SX program address is found by doubling the address This format is produced if the BIN16 option is used with the LIST F directive of with the F option on the command line The file extension is OBJ Example file shown as a hex dump 0000 Er OF tf Of EE Of ff DIE Tr Of ff 0t tf Of ff Of ill es DOLO tt Of ft Of TE Of ff Of LE OF tf VE ft Oft ff Of sine ka a 0020 5 00 00 Oc 06 00 15 09 13 0a 02 Oc ao 01 Oc 00 O030 LE OF EE OF trt Of ff OR LE OF ff OE EE DE EE Of usas 1EEOS Ef UE ft Of ft
14. All rights reserved Chapter 4 Macros www ubicom com The macro operates by emitting as many JMP 1 instructions as possible to use up the bulk of the delay at a cost of one word per three cycles then makes up the balance with NOP instructions This implementation expects that a count of zero on a REPT would skip the block entirely Macros are a powerful feature of the language and are capable of producing complex programs from relatively simple source code This chapter will describe each capability of the macro language This chapter descibes the macro language supported by SASM versions 1 46 and later Prior versions used a more limited macro language which evaluated the actual parameters once at the point of invocation and substituted a reference to that value for each formal parameter This severely limitted the kinds of applications of macros to those cases where each parameter was a numeric expression Macros designed for prior versions should work without modification except in a few rare circumstances Unfortunately the converse is less likely to be true It should also be the case that macros which work in the Parallax SXKey assembler should work in SASM versions 1 46 and later without modification If portability to SXKey must be maintained then care must be used to avoid features of SASM which are unsupported by SXKey 4 2 Macro Definition Before it can be used a macro must be defined Each macro has a name and may include name
15. ERE IE RR R KEEK R SER ERA RE e KER ERIS ERK EAERI EREKE ERI intPeriod 217 UARTfs 230400 Num 4 IFDEF baud1200 UARTBaud 1200 ENDIF IFDEF baud2400 UARTBaud 2400 ENDIF IFDEF baud4800 UARTBaud 4800 ENDIF IFDEF baud9600 UARTBaud 9600 ENDIF IFDEF baud1920 UARTBaud 19200 ENDIF IFDEF baud5760 UARTBaud 57600 ENDIF UARTDivide UARTfs UARTBaud Num UARTStDelay UARTDivide UARTDivide 2 1 IFDEF SX48 52 7 EA R K A RAR RAR KR KKK kk ko ko KKK KEK KKK ko ke kk koc kk ko ke kc KR KKK KEK KKK KKK KK KKK KR KK KKK KR KK KKK KER koc ke kk ke ck ke ek ke KE SX48BD 52BD Mode addresses On SX48BD 52BD most registers addressed via mode are read and write with the exception of CMP and WKPND which do an exchange with W FIRE ERE REE RRR ERE E KORG de VERRE KEER REE AR KEI ee de IE RR e see Qe KC TPR e BRE ge eoe PORN Se C ORB RAE XOR ER BR oe eie de ol ee Timer read addresses SASM Cross Assembler User s Manual Rev 1 3 24 2000 Ubicom Inc All rights reserved www ubicom com Chapter 2 Program Structure TCPL_R equ 00 Read Timer Capture register low byte TCPH_R equ Sol Read Timer Capture register high byte TR2CML_R equ 02 Read Timer R2 low byte TR2CMH_R equ 03 Read Timer R2 high byte TR
16. KK RK KKK KKK KK KKK KR KK KKK KR KR KKK KKK KK KKK ERK KKK ke HAE KA EE String Data p RRR RRR KKK KK RK RR KK KR KK KKK ke KA KK KKK kk KEK KK RK RK KK KEK KK KK KR KK KKK KR KR KKK ke kk hock KKK kc ko koc ke kk KKK k k ke ek VP RS232 Transmit _hello dw _hitSpace dw _enterhex dw org PAGE3_ORG jmp 13 10 Yup The UART works 13 10 Hit Space 0 13 10 Enter Hex Value 0 0 PR RR RRR KKK KR KEK RRR KK RK KR KKK KEK KK ko ko ke RK KEK KK RK kk KR KKK KEK KER KKK KKK KEK KER Main Program 7 Program execution begins here on power up or after a reset OCR BEE REE ek dese oce KRIS de koc ooi de koe sce dese ACARI se eclesie ee deo oem de vesicles eoo ede RI e w Heo de we ede dee koe ese dee NIKE org _resetEntry MAINPROGRAM_ORG 7 EAR K A k k k k e ko kk e KKK e kk koc kk KEK KK A ko ke kk KEK e ke KK hock kk KEK KKK KKK KK KKK KR KKK KK ke ke ko koc KKK KER koe k e k ck k k e ke Initialize all port configuration RRR RRR KKK KK kk RK KK KERR ke kk KER KR KKK KEK KEK ko ke RK hock kk ke kk KKK KKK KK KKK KR KKK kc koc ke kc ko koc ke kk KEK koe kk ke ek ke ek e EE mode mov mov mov mov IFDEF 5X48 52 mov mov mov mov ST W w RB_ST lrb w w RC_ST lrc w w RD_ST lrd w w RE_S lre w point Se Se Se Se tup tup tup tup Li OD RB Sc RC Sc RD Sc a Sc Er
17. Of FE Oft t OB EE VE LE DE EE OL Ee tie EROS EE OF EE OT EE f OEY LE OE ff Of tf Of TODA ove wes B 4 IEEE 695 File Format If the F IEEE695 switch is given to SASM the object code and debug information are written to a file which is compliant to the IEEE 695 standard This output file is named after the source file with the SXE extension B 4 1 Target Device SASM can generate code for either the SX18 SX20 SX28AC or the SX48 SX52BD devices Since there are subtle differences between these two processors the specific device specified to SASM is documented in the IEEE 695 file The very first record in the IEEE 695 file is the module begin record One of the parameters in that record is the target device name as an ASCII text string One of the following strings will appear indicating the specific device specified in the source file or on the SASM command line SX18AC SX20AC SX28AC SXA8BD or SX52BD B 4 2 Symbols SASM permits symbol table entries to be 32 bit integer values with an additional 3 bit field to define a bit number It was determined that some assembly time calculations are easier if intermediate 32 bit values can be saved SASM Cross Assembler User s Manual Rev 1 3 84 2000 Ubicom Inc All rights reserved www ubicom com Appendix B Object File Format However the CPU architecture defines at most a 12 bit instruction address and an 8 bit data address Since a debugger is most interested
18. be saved at the Start of ISR and restored at the End of ISR PRR RRR KHER KK RK RR KK KEK KR KKK ke kk KKK KKK KE KKK RK koc kk ke ERK KKK KE KK KKK KR KKK KK ke kk koc ke HAE kk koc ke kk ke ek ke ke ke e ek org 0 interrupt 7 3 PRR RR RRR KKK ko kk RE KKK RK KK KKK ERK KKK KEK KEK KK RK RK KK KER KKK KKK KK KKK KR KR KKK KKK KE KKK KER KKK KKK KEKE KER Interrupt Interrupt Frequency Cycle Frequency retiw value For example With a retiw value of 217 and an oscillator frequency of 50MHz this code runs every 4 32us RELA RE RIOR WORK FORMS IO ICR EER EKER FO sese dep e edes eie KRR E E ION ge de loge PO cda wn o ROI ICON CV COR de ISDE RE dep sede HOM PRR RRR KKK KK RK RE KKK KKK KKK KEK KKK KKK koc kk ko koc RK hock HAE kk KK KK KR KK KKK KR KK KKK ke kc ko koc KKK KER ko kk ke ek ke ke ke ke ke e VP VP Multitasker Virtual Peripheral Multitasker up to 16 individual threads each running at the interrupt rate 16 Change them below Input variable s is rmultiplex variable used to choose threads SASM Cross Assembler User s Manual Rev 1 3 26 2000 Ubicom Inc All rights reserved www ubicom com Chapter 2 Program Structure Output variable s None xecutes the next thread Variable s affected isrmultiplex Flag s affected None Program Cycles 9 cycles turbo mode UR GERI HC ag ee ede REE RO ER EER e RICE RES AER EIR EK OR e dee ek o RSE RAE dee e RIOR Hole eoe d RIE
19. be used in top line of listing file TITLE SAMPLE ASM SASM Cross Assembler User s Manual Rev 1 3 62 2000 Ubicom Inc All rights reserved www ubicom com 4 1 Introduction Chapter 4 Macros Macros enhance the capabilities of the assembly language by allowing a user to collect useful sequences of instructions such that they may be inserted in a program easily These sequences may include parameters which are specified at each invocation to modify the inserted instructions to suit a purpose For example the following listing fragment shows a macro which inserts a combination of instructions which will delay execution by a specified number of instruction cycles O L 0 V DV O1 VG GA H np When invoked as follows 12 delay ENDM MACRO cycles IF cycles gt 0 REP cycles 3 jmp 1 de ENDR REP cycles 3 nop de ENDR ENDIF delay 7 lay 3 cycl lay 1 cycl es The body of the macro is inserted in place of the invocation line and the value 7 replaces each use of the word cycles in the body 143 14 LS 17 18 19 20 21 22 0000 0001 0002 0A01 0A02 0000 Bap n wed ja eer SS IF F pan END SASM Cross Assembler User s Manual Rev 1 3 7 gt 0 EPT 7 3 jmp 1 jmp 1 DR EPT 7 3 nop DR IF 63 s de de s de lay 3 cyc lay 3 cyc lay 1 cycl Les Les 2000 Ubicom Inc
20. is 9B if OLDREV was specified and AB otherwise The low byte is 0 through 4 corresponding to the SX18AC SX20AC SX28AC SX48BD and SX52BD respectively The following table shows the encoding SABOO DEVICE SX18AC SABO1 DEVICE SX20AC SABO2 DEVICE SX28AC SAB03 DEVICE SX48BD SABO4 DEVICE SX52BD 9B00 DEVICE SX18AC OLDREV 9B01 DEVICE SX20AC OLDREV 9B02 DEVICE SX28AC OLDREV 9B03 DEVICE SX48BD OLDREV 9B04 DEVICE SX52BD OLDREV B 1 5 Frequency and Break The frequency number is the 32 bit value found on the FREQ directive or zero if no FREQ directive was assembled Since it is a 32 bit value it is broken into 2 16 bit words for storage in the object file The high order 16 bits are found at 1014 and the low 16 bits at 1015 This number represents the expected operating frequency in Hertz A Tool vendor may use this value when configuring a device programmer or emulator The Break address at 1017 contains the 12 bit program address at which the BREAK directive was assembled or zero if no BREAK directive was encountered A tool vendor may use this value to preselect a break point address SASM versions prior to 1 46 do not include the frequency and break information in their output files SASM Cross Assembler User s Manual Rev 1 3 80 2000 Ubicom Inc All rights reserved www ubicom com B 1 6 Sample Program Appendix B Object File Format
21. jmp loop 2000 Ubicom Inc All rights reserved 49 SASM Cross Assembler User s Manual Rev 1 3 Chapter 3 SASM Assembler Directive 3 1 2 Syntax Description Example www ubicom com DEVICE or FUSES or PROCESSOR Define Device Type and Fuse Bits lt lable gt DEVICE FUSE lt lable gt PROCESSOR settings settings lt comment gt lt settings gt settings settings lt comment gt Specifies the device type and fuse bits of both FUSE and FUSEX words to SASM assembler DEVICE DEVICE PINS28 BANKS8 OSCHS TURBO STACHKX OPTIONX CARRYX PROTECT There are different fuse settings for different device types NOTE When using the SX18 20 28AC devices with the SX ISD Debugger the fuse bits that se lect the program memory size must be set to BANKS8 2K program memory Tables 3 2 and Tables 3 3 show the FUSE FUSEX bit settings for the SX18 20 28AC and SX48 52BD devices Table 3 2 FUSE FUSEX Bit Settings for SX18 20 28AC Option Bits Description Function Default PINS18 5X18AC SX18AC Specifies device type PINS18 PINS20 SX20AC SX20AC PINS28 SX28AC SX28AC PINS48 SX48BD SX48BD PINS52 SX52BD SX52BD BANKSI 1 page 1 bank Configure memory size BANKSS8 BANKS2 2 page 1 bank should not be changed BANKS4 4 pages 4 banks unless to reduce the amount BANKSS8 4 pages 8 banks of program memory OSCLPI Ext Osc LP1 Specifies external OSCRC OSC
22. ke EK KEK kk RK KK KKK kk koc KKK KR KK KKK KR KKK KKK kk koc KKK ke ko khoe kk ke ec ke ke ke ke e A RAM Bank Register definitions E E KKE E IR RBS RRS HR EAI BR re IR IR RIK KE ERK RIOR NOR SOR I RS IR OR PRR RRR RAR RAR KR EK KK kk KR KKK KEK KK KK KKK KEK KK kk RK KKK ERK KR KKK EK KKK RAR KK KKK KKK KKK KK KA KK KKK Bank O0 LEER EERIE EEE EER CR ee e OR OR HA EAI GS BEERS RS RS O de IR RIK SH org bank0_org bank0 RRR RRR RAR RAR RAR RAR RARE RAR KK KKK KKK RE KKK RK RK KK KKK KKK RK kk KKK RAR RAR kc koc RRA ke kc ko ke kk koe ke kk Bank 1 EERE Ve CX Ie RE ER ERE ROM EAS EEE ARB qe RRR EI RRA RE OR EE OR See IER BBL oe de FERS PER RH de org bankl_org bank1 S rs232TxBank S UART bank rs232Txhigh ds hi byte to transmit rs232Txlow ds low byte to transmit rs232Txcount ds number of bits sent rs232Txdivide ds xmit timing 16 counter rs232Txflag ds rs232RxBank rs232Rxcount ds number of bits received rs232Rxdivide ds receive timing counter rs232Rxbyte ds buffer for incoming byte string ds used by send string to store the address in memory rs232byte ds used by serial routines hex ds MultiplexBank SASM Cross Assembler User s Manual Rev 1 3 20 2000 Ubicom Inc All rights reserved www ubicom com Chapter 2 Program Structure isrMultiplex ds 1 PRR RRR KKK RAR KR RK KK RRR KKK KR KK KKK KKK KEK KK RK KR KKK KR KKK KR KEK KKK KKK RRR KKK KKK KK KERR KK KKK Bank 2 PRR RRR
23. listing outputs Tables 3 1 shows a summary of directives Table 3 1 Assembler Directives Directive Description Syntax BREAK No effect SXKey compatibility BREAK CASE No effect SXKey compatibility CASE DEVICE Define device type and fuse options DEVICE setting setting DS Define memory space by incrementing the Symbol ds 1 program memory address Symbols ds 3 DW Define 16 bit data in program memory DW data data END Mark the End of source code END EQU Equate a symbol to an expression The sym Symbol EQU expression bol cannot be reassigned EXPAND or Specifies whether to expand the macro EXPAND or NOEXPAND instructions in the list file NOEXPAND FREQ No effect SXKey compatibility FREQ expression FUSE Define FUSE and FUSEX WORDsas explicit FUSE expression FUSEX expression values Not recommended for use FUSEX expression FUSES Synonym for DEVICE FUSES setting GLOBAL Synonym for EQU label GLOBAL expression ID Define an ID string up to 8 characters ID string IF Conditional assembly IF expression ELSE ELSE ENDIF ENDIF SASM Cross Assembler User s Manual Rev 1 3 47 2000 Ubicom Inc All rights reserved Chapter 3 SASM Assembler Directive www ubicom com Table 3 1 Assembler Directives Directive Description Syntax IFDEF Conditional assembly IFDEF symbol ELSE ELS
24. program memory with data The data may be in the form of constants or ASCII character strings Example DW 10h 20h 30h or DW This is a test 3 1 5 END End of Source Program Syntax lt label gt END lt comment gt Description Mark the end of program Example END terminate the program SASM Cross Assembler User s Manual Rev 1 3 54 2000 Ubicom Inc All rights reserved www ubicom com Chapter 3 SASM Assembler Directive 3 1 6 EQU or GLOBAL Equate a Symbol to an Expression Syntax lt label gt EQU lt expression gt lt comment gt lt lable gt GLOBAL lt expression gt lt comment gt Description A constant value or the value of a well defined expression is assigned to the given label Note that any value defined with an EQU directive is fixed and may not be redefined To support semi direct addressing mode for SX48 52BD devices and differentiate between global registers and bank 0 registers the bank 0 registers must be defined as the 9 bit values 100 through 10F In effect SASM treats the imaginary BANK 16 as identical to BANK 0 In addition banks 1 through 15 may also be referred to by addresses 110 through 1FF Example COUNT EQU 19h 3 1 7 ERROR Emit a User defined Error Message Syntax lt label gt ERROR Message Text lt comment gt lt lable gt ERROR lt passcode gt Message Text lt comment gt Decription Causes the assembler to emit an error message for this source line
25. reverse a quieted message LIST W lt 01112 gt operates like the W command line option to control the display of all comments warnings and errors Set to 0 to display all messages 1 for just warnings and errors or 2 for just errors SASM Cross Assembler User s Manual Rev 1 3 58 2000 Ubicom Inc All rights reserved www ubicom com Chapter 3 SASM Assembler Directive 3 1 14 LPAGE Insert Page Eject in Listing File Syntax Description Example lt label gt LPAGE lt comment gt Insert a form feed at this point in the listing file LPAGE 3 1 15 ORG Set Program Origin Syntax Description Example lt label gt ORG lt expression gt lt comment gt Set program origin for subsequent code at the expression value The expression must be well defined ORG 0 or ORG 100 3 1 16 RADIX Set default radix Syntax Description Example lt label gt RADIX lt radix gt lt comment gt Set the default radix for constants to one of binary octal decimal or hexidecimal The default default radix is decimal unless modified by the RADIX directive the LIST R lt radix gt directive or the R command line option RADIX HEX org 100 2000 Ubicom Inc All rights reserved 59 SASM Cross Assembler User s Manual Rev 1 3 Chapter 3 SASM Assembler Directive www ubicom com 3 1 17 REPT ENDR Repeat Code Block Syntax Description Example REPT count Codeblock ENDR
26. set warning to a higher level For example set W to 2 e W 0 will include all comments and warning errors e W 1 will include warning errors e W 2 will include errors only 2 It is recommended to set the processor type inside the main program rather than on the command line That is include the following line in the ASM file DEVICE SX18AC OR DEVICE PINS18 3 Version 1 45 5 or higher of SASM defaults to I CPARALLAX FINHX8M PSX18 RDEC T8 W1 LNOPAGE The F L P Q and R options may also be specified in the source file with the LIST directive SASM Cross Assembler User s Manual Rev 1 3 10 2000 Ubicom Inc All rights reserved www ubicom com Chapter 1 Overview 1 3 1 Compiler Mode Command C Arguments SXIPARALLAX Description The assembler can handle two sets of mnemonics This option chooses the specific collection of mnemonics to be recognized It may take any of the values SX or PARALLAX Default IC PARALLAX 1 3 2 Extensions for Various Tool Environments Command E Arguments NONE NOHAU Description E NOHAU can be used to cause the format of the logged error messages to use characters to delimit the fields and to write the error log to a file name cmperr log in the current directory regardless of the name of the source file Default TE NONE 1 3 8 Output Format Command F Arguments INHX8MIINHXSSIINHXI6lINHX32IBINI6lIIEEE695 Description The assembler can g
27. w mov w fr mov w fr w mov w lit mov w fr mov w fr mov W fr mov w lt lt fr mov w gt gt fr mov w lt gt fr mov w m movsz w fr movsz w ttfr mov m w mov m imm4 mov ra w mov loption w test fr Program Control Instructions call addr8 jmp addr9 nop ret retp reti retiw retw lit lit 1 1it 2 System Control Instructions bank fr iread page addr12 sleep Equivalent Assembler Mnemonics clc clz jmp w jmp pctw mode imm4 not w sc skip skip SASM Cross Assembler User s Manual Rev 1 3 88 2000 Ubicom Inc All rights reserved www ubicom com Parallax multi opcode instructions add add addb addb and and cjae fr lit Er fr2 Er frbit fr frbit fr lit Er tr2 fr lit addr9 fr fr2 addr9 fr lit addr9 fr fr2 addr9 fr lit addr9 fr fr2 addr9 fr lit addr9 fr fr2 addr9 fr lit addr9 fr fr2 addr9 fr lit addr9 fr fr2 addr9 fr 1lit fr fr2 fr lit E tr2 fr lit fr fr2 fr lit Rr fr fr lit fr Er fr lit Er fr2 fr addr9 fr addr9 frbit addr9 addr9 frbit addr9 addr9 addr9 addr9 fr 1it fr Er2 fr m m fr loption fr loption lit ra fr lra lit frbit frbit frbit frbit fr 1it Er HE fr 1it fr Er 2000 Ubicom Inc All rights reserved 89 Appendix C SX52INST SRC Sample Source SASM Cross Assembler User s Manual Rev 1 3 Appendix C SX52INST SRC S
28. whenever a valid byte of data has been received and it is the calling routine s responsibility to reset this flag once the incoming data has been collected i Output variable s rx flag rx byte Variable s affected tx divide rx divide rx count A Flag s affected rx_flag SASM Cross Assembler User s Manual Rev 1 3 28 2000 Ubicom Inc All rights reserved www ubicom com Program cycles Variable Length 23 worst Yes case Chapter 2 Program Structure PRR RRR KKK KK RK RR KK KR KK KKK KEK KKK KK RK KEK KK RK RK KKK ERK KKK KKK KKK KKK KKK KK KKK KKK KER KKK KK ck ke ke KER rs232Receive SEXDIE rs232RxOut bank sb ele snb stc test SZ jmp mov sc mov mov mov decsz jmp mov mov dec SZ rr snz setb rs232 rs232 rs232 rs232 rxbi w 9 rs232 w UA rs232 rs232 rs23 w UA rs232 rs232 rs232 rs232 RxBank RxPin RxPin Rxcount Rxdivide 2RxOut RTDivide Rxcount Rxbyte RxFlag Rxcount w RTStDelay RxDivide w Rxdivide w 71 get current rx bit l if so jump ahead 1 currently receiving byte l in case start ready 9 bits 71 skip ahead if not start bit l it is so renew bit count 1 ready 1 5 bit periods 50MHz 1 middle of next bit PA last bit eed TE AOT 1 then save bit il GA SO 1 23 then set flag 1 yes ready 1 bit period 50MHz pOCKORCKCKCkCkCk Ck ko ke kk RK KKK RK ko ke kk KEK KK
29. 0 Ubicom Inc All rights reserved www ubicom com Appendix B Object File Format B 2 2 INHX16 16 bit Intel Hex File Format This format will be produced if the INHX16 option is used with the LIST F directive or with the F option on the command line The file extension is HEX This format represents a sequence of 16 bit words Each 16 bit program word is stored in a file word high byte first in the hex file record The address field identifies the SX program address directly Example 08001000005F0C00000609150A130C0201A6000C7B 010FFFO00A10D7 041000000FFA40FFFOFF70FF5D1 041004000FF70FFA40FF20FFODF 041008000FFA40FFA0FF60FF5D5 04100C000FF60FFDOFF60FFFBC 081010000FFBOFFFFFFFABO301312D00FFFF0016A1 00000001FF B 2 3 INHX8S Split 8 bit Intel Hex File Format This format will be produced if the INHXSS option is used with the LIST F directive or with the F option on the command line The output is a pair of files one with the extension HXL and the other with the extension HXH This format represents the 16 bit program words in a pair of 8 bit hex files The HXL file contains the low byte of each word The HXH file contains the high byte of each word The addresses in each file directly represent the SX program address Example FILE HXH 08001000000C00090A0C0100BC 010FFFOOOAE7 041000000FO0FO0FOFBO 041004000FOFOFOFAC 041008000FOFOFOFAB 04100C000FOFOFOFA4
30. 00 Ubicom Inc All rights reserved 73 SASM Cross Assembler User s Manual Rev 1 3 Chapter 5 Assembler Output Files www ubicom com 5 6 Map File MAP The map file contains line correspondence between source file program counter and file number This file is necessary to enable source level debugging with the emulator The contents of the map file vary depending on which switch is used during compilation SASM generates correspondence between source file ASM and program counter It enables Emulators to load the source file to the Source Window during debugging 5 7 Error File ERR The error file contains all error messages generated during program compilation If there is no error the file will not be written and will be deleted if it previously existed 5 8 Error Messages Error messages display on the standard output from the assembler are written to the ERR file and are included in the LST file if generated Error messages include the listing line number at which the erroroccurred as well as the message number The form is filename src 10 Line 123 Error 55 Pass 2 ERROR user message where 10 is the line number within the file filename src 123 is the listing line number Error is the severity 55 is the message number for use with the LIST Q directive or Q command line option and 2 is the pass number Everything after the colon is the text of the specific error message
31. 41 lt hex digits gt 41 Character lt character gt A SASM Cross Assembler User s Manual Rev 1 3 40 2000 Ubicom Inc All rights reserved www ubicom com Chapter 2 Program Structure 2 3 Symbols A symbol represents a value which can be a variable an address label or an operand to an assembly instruction or directive 2 3 1 Symbol Names Symbol names are user defined or predefined combination of letters both uppercase and lowercase digits and special characters They are represented by a string of 1 32 alphanumeric characters with 1 the first character being A to Z a to Z e or Valid characters for SASM are as follows ABCDEFGHIJKLMNOPORSTUVWXYZ abcdefghijklmnopqrstuvwxwyz 12345678928 NOTE SASM accepts upper and lower case characters and is case sensitive 2 9 2 Symbol Types Each symbol has a type that describes the characteristics and information associated with it The way you define a symbol determines its type SASM supports four symbol types DATA A user defined symbol that represents a data variable defined by EQU directive VAR A user defined symbol that represents a data variable defined by SET directive ADDR A user defined symbol that represents a code address or program counter location RESV A predefined symbol used internally by SASM 2 3 3 User Defined Symbols Symbols are used in both label and operand fields in the source statement Symbols are define
32. BR HR RS IE RRR OR de ok ele bank Multiplexbank Z inc isrMultiplex toggle interrupt rate mov w isrMultiplex Z 7 EA RK K K k k K k k A e e A A ke A Ae e A KKK KEK KK KKK RK RE KKK RK RK KKK ERK KKK KR KK KKK ke A A k ke Ae Ae ke k A ke k A ke k k k ke k k e k k k k k k The code between the tableStart and tableEnd statements MUST be completely within the first half of a page The routines it is jumping to must be in the same page as this table FRESE RAK EERE EERE EES ER EEK KAE RK EK REE tableStart Start all tables with this macro jmp pctw jmp isrThreadl H jmp isrThread2 H jmp isrThread3 E jmp isrThread4 E jmp isrThreadl jmp isrThread5 A jmp isrThread6 jmp isrThread7 A jmp isrThreadl Z jmp isrThread8 jmp isrThread9 jmp isrThread10 H jmp isrThreadl E jmp isrThread11 Z jmp isrThread12 7 jmp isrThread13 P tableEnd End all tables with this macro pOCKOKCKCKCkCkCk kk ko kk kk KKK KK KKK KEK KKK ko ke kk koc kk ko ke RK hock kk KER KKK KKK KK KKK KEK koc kk koc ke kc ko koc ke KEK KER koc ke kk ke ek ke ek e ke VP VP Multitasker ISR TASKS PRR RRR KKK KK kk RR KK KR KK KKK ke kk KKK ko ke kc AE kk ko koc RK koc ko HAE kk koc KKK KR KK KKK KR KK KKK ke kc ko KKK RK kk koc kk ke ke ke kk ke k isrThreadl Serviced at ISR rate 4 E VP RS232 Transmit PRR RRR KKK KK RRR KEK KKK KK KKK KEK KKK KKK KE KKK kk KKK KKK KK HAE ERK KKK KKK ke ke ke ke ER Virtual Peripheral
33. E ENDIF ENDIF IFNDEF Conditional assembly IFNDEF symbol ELSE ELSE ENDIF ENDIF INCLUDE Insert external source file INCLUDE file LIST Control the list format set certain LIST P processor R radix command line options F format L NONEIPAGEINOPAGE X ONIOFF C cols N lines LPAGE Insert page eject in listing file LPAGE MACRO Defines a macro Label MACRO argument EXITM EXITM ENDM ENDM NOCASE No effect SXKey compatibility NOCASE ORG Set program origin ORG expression PROCESSOR Synonym for DEVICE PROCESSOR setting RADIX Set default radix RADIX BINIOCTIDECIHEX RADIX BIOIDIH REPT Repeat block of program code a specified REPT count ENDR number of times ENDR RESET Define reset vector starting location of RESET label program RES Reserve storage in memory RES expression SET or Set a symbol equal to an expression The Symbol SET expression symbol can be reassigned to new value Symbol expression SPAC Insert lines in listing SPAC expression STITLE Synonym for TITLE STITLE Title Text SUBTITLE Set a listing subtitle SUBTITLE Subtitle Text TITLE Define program heading TITLE file SASM Cross Assembler User s Manual Rev 1 3 48 2000 Ubicom Inc All rights reserved www ubicom com Chapter 3 SASM Assembler Directive Table 3 1 Assembler Directives Directive Description Syntax WATCH No effect SXKey compatibility WATCH arguments ZERO Synonym for RES ZERO expression
34. HHH HHHCC Definitions S Record start character BB Byte count the hexadecimal number of data bytes in the record AAAA Load address in hexadecimal of first data byte in this record TT Record type The record type is 00 for data records and 01 for the end record HH One hexadecimal data byte CC Record checksum This is the 2 s complement of the summation of all the bytes in the record from the byte count through the last byte While the summation is calculated it is always truncated to a one byte result Multiple format variations exist depending on the data word width address bus size and other features Those which are supported by SASM are described in the following sections B 2 1 INHX8M Merged 8 bit Intel Hex File Format This is the default hex file that will be generated by the SASM cross assembler The file extension is HEX This format represents a sequence of 8 bit bytes Each 16 bit program word is stored in a pair of bytes with the low byte of each word followed by the high byte Since the address field represents the address of a byte each SX program address is doubled Example 080020005F00000C0600150949 08002800130A020CA6010C00F2 021FFE00100AC7 08200000FA40FFFOFF70FF50FBD 08200800F70FFA40FF20FFO00FC7 08201000FA40FFA40FF60FF50FB9 08201800F60FFDOFF60FFFOF9C 10202000FBOFFFOFFFFF03AB3101002DFFFF160079 00000001FF SASM Cross Assembler User s Manual Rev 1 3 82 200
35. ICML_R equ 04 Read Timer R1 low byte TRICMH R egu 05 Read Timer R1 high byte CNTB_R equ 06 Read Timer control register B CNTA R equ 07 Read Timer control register A z Exchange addresses CMP equ 08 Exchange Comparator enable status register with W WKPND equ 09 Exchange MIWU RB Interrupts pending with W S port setup read addresses WKED_R equ SOA Read MIWU RB Interrupt edge setup 1 falling 0 rising WKEN_R equ SOB Read MIWU RB Interrupt edge setup 0 enabled 1 disabled ST_R equ SOC Read Port Schmitt Trigger setup 0 enabled 1 disabled LVL_R equ SOD Read Port Schmitt Trigger setup 0 enabled 1 disabled PLP_R equ SOE Read Port Schmitt Trigger setup 0 enabled 1 disabled DDIR_R equ SOF Read Port Direction A Timer write addresses CLR_TMR equ 10 Resets 16 bit Timer TR2CML W equ 12 Write Timer R2 low byte TR2CMH W equ 13 Write Timer R2 high byte TRICML_W equ 14 Write Timer R1 low byte TR CMH W equ 15 Write Timer R1 high byte CNTB W equ 16 Write Timer control register B CNTA W equ 13 Write Timer control register A Port setup write addresses WKED W equ S1A Write MIWU RB Interrupt edge setup 1 falling 0 rising WKEN_W equ 1B Write MIWU RB Interrupt edge setup 0 enabled 1 disabled ST_W equ 1C Write Port Schmitt Trigger setup 0 enabled 1 disabled VL_W equ 1D Write Port Schmitt Trigger setup 0 enabled 1 disabled PLP_W equ S1E Write Port Schmitt Trigg
36. In the first form the macro requires a specific number of parameters which are given symbolic names Every invocation must match the number of parameters used in the declaration Formal parameter names must follow all the rules for any symbol name In the second form the macro requires a specific number of parameters none of which are named Use zero for the count to declare a macro which must not take any parameters when invoked Every invocation must match the specified number of parameters In the third form the macro allows a variable number of parameters none of which are named Within the macro body 0 will be replaced by the number of parameters actually supplied by the invocation Actually V0 is available in all forms but is not as useful if the number of formal parameters is fixed 4 2 2 ENDM Directive The ENDM directive takes the form ENDM comment It simply marks the end of the macro declaration 4 2 3 EXITM Directive The EXITM directive takes the form EXITM comment If assembled it causes an invocation to stop interpolating lines of the macro body at that point This is sometimes useful when building complex macros For best results use the EXITM directive inside the context of an IF IFDEF or IFNDEF directive 4 2 4 LOCAL Directive The LOCAL directive takes the form LOCAL label lt label gt It declares the labels named after the directive as private symbols Private symbols are available onl
37. In the listing file the line number columns are filled with so that error lines visually stand out from the balance of the listing A complete list of the messages generated by SASM is found in Appendix D SASM Cross Assembler User s Manual Rev 1 3 74 2000 Ubicom Inc All rights reserved www ubicom com Appendix A Summary of SX Instruction Set A 1 Logical Operations AND fr W AND Wir AND W lit NOT fr NOT W OR fr W OR W fr OR W lit XOR fr W XOR Wir XOR W lit ZNNNN N NNNNNN A 2 Arithmetic and Shift Operations ADD fr W ADD Wir CLR fr CLR W CLR IWDT DEC fr DECSZ fr INC fr INCSZ fr NOP RL fr RR fr SUB fr W SWAP fr SASM Cross Assembler User s Manual Rev 1 3 C DC Z C DC Z Z Z TO PD 75 AND W into fr AND fr into W AND literal into W One s complement of fr into fr One s complement of W into W OR W into fr OR fr into W OR literal into W XOR W into fr XOR fr into W XOR literal into W Add W to fr into fr Add fr to W into W Clear fr to 0 Clear W toO Clear WDT and prescaler Decrement fr Decrement fr skip if zero Increment fr Increment fr skip if zero No operation Rotate left fr into fr Rotate right fr into fr Subtract W from fr Swap nibbles in fr into fr 2000 Ubicom Inc All rights reserved Appendix A Summary of SX Instruction Set A 3 Bitwise Operations CLRB CLC CLZ SB SETB SNB fr bit bit fr bit bit A 4 Data Move
38. Input variable s rs232Txlow only high bit used rs232Txhigh rs232Txcount S Output variable s rs232Rxflag rs232Rxbyte z Variable s affected rs232Txdivide rs232Rxdivide rs232Rxcount d Flag s affected rs232Rxflag Variable s affected Txdivide S Program cycles 17 worst case gt Variable Length Yes PRR RRR RAR RAR RAR RAR KKK RK KEK KK RK KEK KERR KR RARA RAR RK KKK KR KK KKK KR KKK KK KKK KKK KER KKK KKK KEKE ER rs232Transmit bank rs232TxBank 2 switch to serial register bank decsz rs232Txdivide 1 only execute the transmit routine jmp rs232TxOut zl mov w FUARTDivide 1 load UART baud rate 50MHz mov rs232Txdivide w zl test rs232Txcount 1 are we sending Snz PS jmp rs232TxOut Pl SC RDA Ge 1 yes ready stop bit Yr rs232Txhigh 71 and shift to next bit r rs232Txlow pl dec rs232Txcount l decrement bit counter snb rs232Txlow 6 1 output next bit clrb rs232TxPin sl sb rs232Txlow 6 s setb rs232TxPin T rs232TxOut RRR RRR KKK KK RK RRR KKK KK KKK KEK KKK KKK KE KKK RK koc HAE kk koc kk kk Kk KKK KK kk ke kk koc ke HAE KA koc ke kk ke ek ke ke e ke ke VP RS232 Receiv Virtual Peripheral Universal Asynchronous Receiver Transmitter UART These routines send and receive RS232 serial data and are currently configured though modifications can be made for the popular No parity checking 8 data bit 1 stop bit N 8 1 data format RECEIVING The rx flag is set high
39. KCKCkCkCkkCk ko kk RK KK ke kk ko KKK KEK KKK KK RK KE KK KR KR KKK kk kk KKK koc kk kk kk ko ke kk ke ek ke ek e e Function sendhex INPUTS w the byte to be output OUTPUTS Outputs the hex byte via RS 232 Output a hex number PRR RRR k kk k RK RRR e e de e KK RK KEK KKK ko ke kk koc kk kk RK koc HAE Ae KKK KK KR KK KKK KR KKK KK k kk koc ke HAE kk kk k k ke kk ek sendhex mov localTempl w swap wreg and w HSOf call hextable call sendbyte mov w localTempl and w HSOf SASM Cross Assembler User s Manual Rev 1 3 32 2000 Ubicom Inc All rights reserved www ubicom com Chapter 2 Program Structure call hextable call sendbyte retp PR RR RRR KKK KK RK RK KK KEK KK KK KEK KK KKK RK KE KKK RK KKK KK kk KK KKK RK KKK KK kk KR KKK HAE ERK KKK KKK ke ke ke e KER Function gethex Inputs None OUTPUTS Received HEX value is in hex register This routine returns with an 8 bit value in the W and in the hex register It accepts a hex number from the terminal screen and returns Remember to write a prompt to the screen before calling get hex PRR RRR RAR RAR KR KEK KKK KK ke kk ke kk koc kk ko ke EK KEK ko koc RK koc KK ke kk KKK KKK KK KKK KR KR KKK ke kk koc ke KKK kk koc ke kk ke ck KEKE ke gethex bank rs232RxBank 2 2 mov w _enterhex call sendstring call getvalidhex mov w rs232byte Send the received good byte call sendbyte swap localTemp2 put the nibble in the upper nibble mov
40. KK KKK kk KR KKK KEK hock KK ke kk koc KK ke HAE kk kk kk KR KKK ERK KKK KEK kk ke kk hock KKK KA KK KKK org bank2 org bank2 PRR RRR KKK KR KR KKK KR KK KKK ke kk KK KK ke kk KEK ko ke RK KR KKK ke kk KKK hock kk KKK ko ke HAE KA koc ke kk kk kk KA KKK KK Bank 3 PRR RRR KKK KER KR KKK KEK hock HAE kk KK KK ke kk ke kk ko ke RK KR KKK ke kk KKK RK EK ko ke kk ke EK kc kk koc ke kk dock ck KEK KK KKK org bank3 org bank3 PRR RRR KKK RAR KR KKK KKK KR KKK KER KK KK KKK KEK KK RK KR KKK KKK KKK RK EK KR KKK KEK KEK KKK KKK KK ke KA KK KKK Bank 4 RRR RRR KKK KER KR KKK ko kk KE KKK KEK KK KK KKK RE KKK RK KR KKK KKK KR KR KEK KR KKK KEK KKK KKK KKK KKK KA KK KKK org bank4_org bank4 PRR RRR RK KKK KR KR RK KK RK KKK RK kk KK KKK RK KEK ko ke RK RK KK ke kk KR KR KEK koc ke kk ke kk kk ke kk koc ke HAE KA KK KKK Bank 5 PRR RRR KKK RAR KR KKK KR KK KKK KR KK KKK KKK RE KKK RK RK KKK kk KK KR KEK KKK KK EK KEK KKK KKK KK KERR KK KKK org bank5_org bank5 PPLE LIER RS BRK AEN RETO dede dee os e JOR ER dede dele IEEE IED A ETE ERE HELENE IT IE NOR ec A IE ede dede dede I Be Bank 6 PRR RRR KKK RAR KR KKK KEK KR KKK KE KK KKK ke kk ke kk ko ke RK KR KKK ke kk KR KR KEK KKK ko ke HAE kk koc ke kk hock HAE KA KK KKK org bank6_org bank6 PRR RRR KKK KER KR KEK KK kk hock kk KR KK KKK KKK KEK KK RK KR KKK KEK KKK RK ERK KKK KEK KKK KKK KKK KK KKK KK KKK Bank 7 PRR RRR KKK RAR KR KKK KR KK KKK KE
41. KKK kk koc kk ko ke RK KR KKK ke kk KK KK KK KK KKK KR KR KKK ke ko ko koc ke kk KERR ke kk ke ck ke ek ke e Virtual Peripheral H Input variable s 7 Output variable s M Variable s affected s Flag s affected PUT YOUR OWN VPs HERE PRR RRR RAR KK kk RK KK KKK RK KKK KEK koc kk koc ke kk KEK ko koc RK hock kk ke kk koc kk KKK KK KKK KR KR KKK KR KK KKK ke kc ko koc ke kk ke ck ke ke e ke jmp isrOut 7 cycles until mainline program resumes execution isrThread2 Serviced at ISR rate 16 jmp isrOut 7 cycles until mainline program resumes execution isrThread3 Serviced at ISR rate 16 jmp isrOut 7 cycles until mainline program resumes execution isrThread4 Serviced at ISR rate 16 jmp isrOut 7 cycles until mainline program resumes execution isrThread5 Serviced at ISR rate 16 2000 Ubicom Inc All rights reserved 29 SASM Cross Assembler User s Manual Rev 1 3 Chapter 2 Program Structure www ubicom com jmp isrOut 7 cycles until mainline program resumes execution H isrThread6 Serviced at ISR rate 16 H jmp isrOut 7 cycles until mainline program resumes execution DH isrThread7 Serviced at ISR rate 16 DH jmp isrOut 7 cycles until mainline program resumes execution H isrThread8 Serviced at ISR rate 16 DH jmp isrOut 7 cycles until mainline program resumes execution DH isrTh
42. LP2 Ext Osc LP2 crystal resonator OSCXTI Ext Osc XTI or external RC OSCXT2 Ext Osc XT2 oscillator OSCHSI Ext Osc HS1 OSCHS2 Ext Osc HS2 OSCHS3 Ext Osc HS3 OSCRC Ext Osc RC OSC4MHZ Int RC Osc 4MHz Specifies internal 4MHz OSCIMHZ Int RC Osc IMHz oscillator speed OSC128KHZ Int RC Osc 128kHz OSC32KHZ Int RC Osc 32kHz SASM Cross Assembler User s Manual Rev 1 3 50 2000 Ubicom Inc All rights reserved www ubicom com Chapter 3 SASM Assembler Directive Table 3 2 FUSE FUSEX Bit Settings for SX18 20 28AC Option Bits Description Function Default IFBD 0 an ext feedback resistor Internal Feedback Disable Enable is required between OSCI internal and OSC2 pins feedback 1 crystal resonator OSC resister can rely on into feedback resistor between OSCI and OSC2 pins BOR42 Brown out reset at 4 2V Specifies brown out reset Disable BOR26 Brown out reset at 2 6V function and threshold brownout BOR22 Brown out reset at 2 2V voltage BOROFF Disable Brown out reset TURBO 0 Turbo mode 1 1 Specifies turbo mode Compatible 1 compatible mode 1 4 mode OPTIONX 0 8 bit option register Specifies Option register and 6 bits and and 8 level stack stack extension 2 level 1 6 bit option register and 2 level stack CARRYX 1 ignore carry flag as ADD and SUB Carry flag input to ADD and SUB instructions use Carry flag as ignored instruction input SYNC 0 Enable synchronous Enab
43. ORORCOKCK CI A PRR RRR RAR RAR KR KKK KR KK KKK KEK KKK KKK KKK KK RK RK KK KEK KK KK KR KK KKK KR KK KKK KKK KK KKK ERK KKK KEK KEKE KEE RESET VECTOR PRR RRR KK KKK KR KR KKK KR KK ke kk ke kk KK KKK kk KEK KK RK koc HAE kk KK KK KR KK KKK KR KK KKK KKK EEK HE KA ER kk ke ck k k ke ke ke SASM Cross Assembler User s Manual Rev 1 3 30 2000 Ubicom Inc All rights reserved www ubicom com Chapter 2 Program Structure PRR RRR KKK KR KR KR KKK KEK ko ke kk KEK KKK kc ke kk KEK KK RK RK KK ke kk KKK KKK KK KKK KR KKK KKK RK KKK KER KKK KKK KEKE ke Reset Entry EE IR RIN EERIE KRIE KERERE R R ILE RIKER ERE ERAS IC NOE IRIS I ERIE RRR ES OR RIOR GR CE org RESETENTRY_ORG resetEntry Program starts here on power up page resetEntry jmp _resetEntry PRR RRR RAR RAR KR KEK KK RRR KKK KEK KKK ko ke kc ko KEK KK RK RK KK KER KKK KKK KK KKK KR KR KKK KR KKK KEK KER KK KK KKK KEKE KEE UART Subroutines A org SUBROUTINES_ORG p RRR RRR KKK KK RK RK KK KKK KK kk KEK KKK KKK KEK KK RK RK KK KER KKK RK RK KKK KKK KKK KK KR KKK KKK ER KK KK KKK KEK KER Function getbyte INPUTS NONE 7 OUTPUTS Received byte in rs232Rxbyte Get byte via serial port and echo it back to the serial port PRR RRR KKK KKK RR KK KR KK KKK ke kk KK KKK kk KEK KK RK koc KK KERR kk kk koc ke KKK kk ko kk ke ck ke ke ke KER getbyte jnb rs232RxFlag S wait till byte is received eLr
44. R KK KK ke HAE kk ko ke RK hock kk KEK KR KR KEK KKK KK HAE kk ke kk dock HAE KA KK KKK org bank7_org bank7 IFDEF SX48 52 PRR RRR KKK Ck ko RK RE KK ke kk hock KK KEK KR KKK KEK RE KKK RK hock KK KKK kk ERK KKK ke HAE kk ko kk ke kk kk kk KK KKK Bank 8 2000 Ubicom Inc All rights reserved 21 SASM Cross Assembler User s Manual Rev 1 3 Chapter 2 Program Structure www ubicom com PRR RRR KKK KER KR KEK KK kk KR KKK KEK KKK KKK KEK KK RK KR KKK ke kk KKK RK EK KKK ko ke EK kc EK KKK KKK KKK KA KKK KK org 80 bank 8 address on SX52 bank8 PIPER e XC NOR EON IE I NIE TE de eol OK NOR RARE de RAEE dede x o LEI HE XC NOR OO AE de IIe TORIO Bank 9 RRR RRR KKK RAR KR KKK KEK KE KKK KR KK KKK KKK kc kk ko ke RK KR KKK KR KKK KR ko kk koc ke kk ke HAE kk koc ke kk k kk kk kk KK KKK org 90 bank 9 address on SX52 bank9 qe des LE ve e Ree XX EO GEA BONS IEE RER A E KAK AEE IO IEE FETE FEET EO GE NOR IE IE IE HAE ON ee RE dee woo Bank A IRL BIR LE BIO EREE RAR Jeu NON quie CO de EUN ege BIR IR sedie dep MTT se OR CIE DE IER Re AIOE TER Ve M AGI ERRE TOR OWN o ae org SAO bank A address on SX52 bankA Bank B E E E e aj KRE k a ee org SBO bank B address on SX52 bankB ITER dede dede Re X EO koi Ee leue de e IEE PRE a v ooi eo dee A eere dee dee Xe OX EO XE NOR EO vole e eol de geo de woe Bank C PRR RRR KKK ERK RK KK KR KK KKK KR KK KKK KKK RE KKK RK KR KKK KKK KR KR KE
45. R KKK KK kk kk ke kk dock ck KEK KK KKK org CO bank C address on SX52 bankC PICT ER VER R KORR CORO SA SON PE TIE NE NOR e EE ai oa IE IETS HE GE RE FEDS TEA e IEE ER E Hc We Bank D QOROR CIC ERRE ER coge ERER FOR E PORTE TE TE CANON ae KERER AOA sese y de dean OR RE MORON GORDO ERER ege BFE ESE OXON Ye CR M ON onde org SDO bank D address on SX52 bankD PRR RRR KK KKK KR KR RAK KKK hock RK KE KK KKK ke kk KEK ko koc RK KR KKK KKK ke kk koc KEK kk ke kk koc kc kc ko ke kk koe ck ke kk koe KKK Bank ORR CHOR Ve RR AA RR LR ERE eol e e e Wo RRR RS de we RRB EA RH RR ERK RRR See oe RRB ye Sole de FORE de OXON EEKE de ti bank E address on SX52 O 5 Q ur ti o bank Di Il ur SASM Cross Assembler User s Manual Rev 1 3 22 2000 Ubicom Inc All rights reserved www ubicom com Chapter 2 Program Structure PRR RRR RAR RAR EEE AK KA KK HAE kk KKK KKK RE KKK RK KR KKK ke kk KKK RK ERK KKK KEK KKK KKK KKK KK KER KK KKK Bank F qp ORE de We Wok ITR TE KG de KORR E Pe EER KARE EL EER EL ERR ER ER de ok ICE RE RICE A EE ERE KEREK EE RIK EEK org SFO bank F address on SX52 bankF ENDIF PRR RRR KKK KK RK RR KK KKK koc ke kk ke kk KK KKK kc kk kk ko koc RK kk KKK koc ke kk KER koc ke koh ke ek ke kk ke e Port Assignment PERRA LEAL EUR RO RIO NORD FRE oe eae KORG doo ole gne eR dole oleae decoro eoe BW A I IE ol dee a oc de e wok gero d BRB E EAER
46. RE Weak Pull up 0 enabled 1 disabled mov lre w ENDIF mode DDIR_W point MODE to write DDIR register mov w RA_DDIR Setup RA Direction register 0 output 1 input mov ra w mov w RB_DDIR Setup RB Direction register 0 output 1 input mov lrb w mov w RC_DDIR Setup RC Direction register 0 output 1 input mov rc w IFDEF SX48_52 mov w RD_DDIR Setup RD Direction register 0 output 1 input mov lrd w mov w RE_DDIR Setup RE Direction register 0 output 1 input mov lre w ENDIF mov w RA_latch Initialize RA data latch mov ra w mov w RB_latch Initialize RB data latch mov rb w mov w RC latch Initialize RC data latch mov rc W IFDEF SX48_52 mov w RD latch initialize RD data latch mov rd w mov w RE_latch Initialize RE data latch mov re w ENDIF PRR RRR RAR RAR kk EK KK RR KK kk KEK ER kk ek ko KEK KK RK koc KK KER KR KR KR KK KKK ke kk kc Kk koc ke kc ko EEK AE kc ko koc ke kk ke ck ke ke ke ee H Clear all Data RAM locations 2000 Ubicom Inc All rights reserved 35 SASM Cross Assembler User s Manual Rev 1 3 Chapter 2 Program Structure www ubicom com PRR RRR k KKK KR KR KEK KK kk KR KKK KEK KKK KK KA KEK kk KKK KR KKK HAE KA KEK KKK EE AA EE IFDI EF SX48 52 zeroRamclr ELSE zeroRamsb ENDIF mov mov ind incsz jmp bank clr clr clr clr clr cir cir cir cir cir cir cir cir cir clr fsr 4 setb clr incs
47. SIS SX20 SX20AC PINS20 SX28 SX28AC PINS28 SX48 SX48AC PINS48 SX52 SX52AC or PINS52 Default IP SX18AC SASM Cross Assembler User s Manual Rev 1 3 12 2000 Ubicom Inc All rights reserved www ubicom com Chapter 1 Overview 1 3 8 Quiet Message Command Q Arguments message number Description Individual warning and comment messages may be disabled quieted with this command line option Use this option multiple times to quiet more than one warning message The message number appears in the warning or comment or can be found in the appendix to this manual This option may be set within the assembly file with the Q option of the LIST directive This may be more convenient when several messages are involved If the message number is negative then those messages are enable if they are presently quiet Note that the W option supersedes the Q option Default No messages are quiet by default 1 3 9 Radix Command R Arguments HEXIBINIDECIOCTIDIBIOIH Description This option selects the default radix used to interpret numeric constants which do not specify a radix Choose one of DEC BIN OCT HEX D B O or H Default IR DEC 1 3 10 Default Tab Width Command T Arguments TABWIDTH Description This option sets the assumed width of a tab character and may be set to any positive integer less than 20 Default VIT S 2000 Ubicom Inc All rights reserved 13 SASM Cross Ass
48. Used to indicate a block of code to be repeated a specified number of times during assembly REPT 3 Add 12 1 ENDR will be expanded to the following sequence during program assembly Add 12 1 Add 12 1 Add 12 1 Within the block the sign may be used to refer to the current iteration 1 n i e equal to the first time through the repeat block equal to 2 the second time through the loop etc For example REPT 3 Add 12 896 ENDR will be expaned tothe following sequence during assembly Add 12 1 Add 12 2 Add 12 3 SASM Cross Assembler User s Manual Rev 1 3 60 2000 Ubicom Inc All rights reserved www ubicom com Chapter 3 SASM Assembler Directive 3 1 18 RESET Set Reset Vector Address Syntax RESET lt expression gt lt comment gt Description Put the instruction opcode JMP lt expression gt at the reset vector memory location The reset vector location depends on the chip s configured memory size and defaults to 7FF Example Define PAGESx in FUSES Reset Vector FUSES PAGES Ox1FF FUSES PAGES2 Ox3FF FUSES PAGE94 Ox7FF FUSES PAGES8 Ox7FF DEVICE PINS18 RESET Start This is equivalent to ORG 1FFh JMP Start NOTE The expression must evaluate to a destination address in Page 0 3 1 19 RES or ZERO Reserve Storage in Memory Syntax lt label gt RES lt expression gt lt comment gt lt label gt ZERO lt expression gt lt comment gt Description The program
49. X Key device SX28L oschs2 turbo stackx optionx ENDIF IFDEF 5X48 52 r SX48 52 BD device directives for SX Key device oschs2 ENDIF freq 50_000_000 ELSE SASM Directives IFDEF 5X18 20 SX18AC or SX20AC device directives for SASM device SX18 oschs2 turbo stackx optionx SASM Cross Assembler User s Manual Rev 1 3 16 2000 Ubicom Inc All rights reserved www ubicom com Chapter 2 Program Structure ENDIF IFDEF SX28AC SX28AC device directives for SASM device SX28 oschs2 turbo stackx optionx ENDIF IFDEF SX48 52 s SX48BD or SX52BD device directives for SASM device SX52 0schs2 ENDIF ENDIF id 1UART VP reset resetEntry Set reset vector RE EEK KEE SEERA AN RIEKA KE KRAKOV ERA EERE RSE EER EERE KEKE RE KERK BRR EIR A RR CR eo Macro s sj Macro bank Sets the bank appropriately for all revisions of SX DH This is required since the bank instruction has only a 3 bit operand it cannot be used to access all 16 banks of the SX48 52 FSR 7 SX48 52bd production release needs to be set appropriately depending on the bank address being accessed This macro fixes this DH So instead of using the bank instruction to switch between banks use bank instead y REBAR EERE EERIE OE REER IR IR REOR ICR BER BSA ER EIR CORN ONE EORR ORCI OE ERB RE OR IK IEE BER BR REA AAN _bank macro 1 noexpand bank 1 IFDEF SX48_52 IF 1 amp 10000000
50. abl RE latch equ 00000000 SX48 52 port E latch init initial value after reset RE DDIR equ SITZ SX48 52 port E DDIR value 0 Output 1 Input RE_S equ 11111111 SX48 52 port E ST value 0 Enable 1 Disabl RE_LVL equ 500000000 SX48 52 port E LVL value 0 CMOS 1 TTL RE PLP equ 500000000 SX48 52 port E PLP value 0 Enable 1 Disabl ENDIF PRR RRR RK KKK KEK RR KK KKK AE HAE KA KK KKK HAE Kk KK RK koc HAE kk koc Kk kc Kk koc KKK KR KR KKK KKK koc ke kk KER koc ke kk ke ck ke ke ek A Pin Definitions RADAR ORO EERE R REAR ERLE ER IEDR EK ERLE RIOS ERE ERS EERE ERI BREE EB IER ER HRSA ERK RIOR ECE rs232RTSpin equ ra 0 UART RTS input rs232CTSpin equ ra l UART CTS output rs232Rxpin equ ra 2 sj UART receive input 2000 Ubicom Inc All rights reserved 23 SASM Cross Assembler User s Manual Rev 1 3 Chapter 2 Program Structure www ubicom com rs232Txpin equ ra 3 UART transmit output PRR RRR KKK KK RK RRR KKK KK KKK KEK KKK ko ke RK kk KKK KR ko koc ke KKK kk ko kk ke ek ke e ee Program constants SON EE CIEN MACS ERE RR BE YE E EREE RE eoi oe eoe AEE EER Ee E ERIRE REEERE RERE K OEKE deae sv oe ee enter egu 13 ASCII value for carriage return linefeed equ 10 ASCII value for a line feed PRR RRR KKK KKK RK KKK ko kc ke kk KEK KKK kc ke EEE kk ko ke RK koc kk KER koc kk KKK KK KKK KR KKK KKK kc ko koc ke KKK kk koc ke kk ke ek ke ke ke ke 7 UART Constants values PRAVE HE KC ERR KE KRE EER e
51. am memory locations 300 3ff as the area INPUTS w the address of a null terminated string in program memory OUTPUTS Outputs the string via RS 232 Send string pointed to by address in W register PRR RRR KKK KK kk KR KKK KR KK KKK KEK KK KK ke kk KEK KK RK koc KKK kk KK KK KR KK KKK KR KR KKK KKK koc ke kk KERR KKK ke ek ke ec ke ke sendstring bank rs232TxBank mov localTempl w Store string address loop mov w STRINGS_ORG gt gt 8 with indirect addressing mov m w mov w localTempl read next string character iread using the mode register test w are we at the last char snz if not 0 skip ahead jmp tout yes leave amp fix page bits call sendbyte not 0 so send character _bank rs232TxBank inc localTempl point to next character jmp loop loop until done out mov w S1F reset the mode register mov m w retp pOCKOKCKCKCkCkCkCkCk koc RK RR KK KR KK KKK KEK KK KKK kk KEK KK kc kk kk ke kk koc KKK KKK KKK RK RK RK KKK kk koc ke kk KER koc ke kk ke ck ke ke ke ke ke Function uppercase INPUTS byt the byte to be converted OUTPUTS byt converted byt Convert byte to uppercase p RRR RRR KKK KK kk RE KK KEK kc ke kk KEK KKK ko ke kk KEK KK RK KKK KKK KK KKK KR KK KKK KEK RK KK KEK KKK KER KKK KKK KEKE KK ke uppercase mov w t a if byte is lowercase then skip ahead mov w rs232byte w sc retp mov w t a A change byte to uppercase sub rs232byte w retp leave and fix page bits pOCKOKC
52. am Structure copypa0 copy PAO P935 copypal copy PAI 5 3 3 0 copypa2 copy PA2 S33 arranges symbols for a copy of the STATUS register at an offset in bank 30 and assigns names to some similar bits in the copy 2 4 2 Well Defined Expressions Some of the directives require well defined expressions These are expressions that can be evaluated on the first pass This means any symbols used in the expression must be defined on an earlier line in the source file For example len equ 4 length of an array org 30 vara ds 1 byte variable varb ds len array of len bytes Each of the expressions above must be well defined during pass 1 The value of len given to the EQU directive must be known so that the symbol can be defined The argument to the ORG directive must be known so that subsequent symbols can be defined The argument to the DS directive must be known so that the actual value of varb and any subsequent symbols will be known O 2000 Ubicom Inc All rights reserved 45 SASM Cross Assembler User s Manual Rev 1 3 Chapter 2 Program Structure www ubicom com SASM Cross Assembler User s Manual Rev 1 3 46 2000 Ubicom Inc All rights reserved www ubicom com Chapter 3 SASM Assembler Directive 3 1 Introduction Directives are assembler commands that appear in the source code but are not translated directly into opcodes They are used to control the program counter allocation and format
53. amp 100 ERROR Must be located in the first half of a page SASM Cross Assembler User s Manual Rev 1 3 18 2000 Ubicom Inc All rights reserved www ubicom com Chapter 2 Program Structure endif endm tableEnd macro 0 Generates an error message if code that MUST be in the first half of a page is moved into the second half if amp 100 ERROR Must be located in the first half of a page endif endm PRR RR RRR KKK koc ko KR RK KKK KK KKK KEK KK KKK RK KEK KK RK koc HAE kk KK KKK KKK KKK KR KK KKK KKK koc ke KKK kk koc ke kk ke ck ke ke ke ke ek 7 Memory Organization gOBORGROR KCRORGRECKOK I e ERE EE ERS ER RIK EERE ER CR DIOS OK REER EEK K ERR ERE BRR EIR HEI ER BAK RBH CE HRB IR Roe PRR RRR KK KKK KEK RE RAR KKK RK KEK KKK KKK KEK KK RK RK KKK ERK KKK KR KK KKK KR KR KKK KKK koc KKK KER KKK KKK ke ke ke ER Data Memory address definitions These definitions ensure the proper address is used for banks 0 7 for 2K SX devices SX18 20 28 and 4K SX devices SX48 52 pOCKOKCKCKCKCkCkkCk koc kk RRR RAR RARA RAR RR kk ke kk kc Kk ko koc RK KR KKK KEK KK KKK KKK KKK KR KR KKK ke kk KKK KER koc ke kk ke ek k ke e ke IFDEF SX48 52 global org 0A bank0 org 00 bankl org 10 bank2_org 20 bank3_org 30 bank4_org 40 bank5_org 50 bank6_org 60 bank7 org 70 ELSE global_org 08 bank0 org 10 bankl_org 30 bank2_org 50 bank3_
54. ample Source subb subb xor xor org addr8 org addr9 org addr12 end fr frbit fr frbit fr lit Ee Er STE S1ff Sfff SASM Cross Assembler User s Manual Rev 1 3 90 www ubicom com 2000 Ubicom Inc All rights reserved www ubicom com Appendix D Error Message The following table shows all error messages emitted by the current version of SASM along with the error numbers for use with the Q command line option and the LIST Q directive Version 1 48 and later will produce this list if both the Q and H switches appear on the command line or if the Q switch appears with an invalid argument In the table the string text represents an arbitrary text string which will depend on the context of the message For instance in message 3 the name of the undefined symbol will appear Err Message 1 Bad instruction statement 2 Redefinition of symbol lt text gt 3 Symbol lt text gt is not defined 4 Symbol is a reserved word 5 Missing operand s 6 Too many operands 7 Missing file register 8 Missing literal 9 Missing Label 10 Missing right parenthesis 11 Missing expression 12 Redefinition of MACRO label lt text gt 13 Bad expression 14 Bad argument lt text gt 15 Bad MACRO expression 16 Macro arguments do not match 17 Unmatched MACRO 18 Bad IF ELSE ENDIF statement 19 Unmatched ELSE 20 Unmatched ENDIF 21 File nesting error too deep 22 If else endif nesting error too deep
55. arguments those names are the formal parameters If it has a single constant expression well defined in pass 1 that is the exact number of arguments required the formal parameters are unnamed If the MACRO directive is not followed by either a constant expression or names of arguments then any number of arguments may be passed and the formal parameters are unnamed If the formal parameters are named then any occurance of a formal parameter name in the macro body will be replaced by the exact text of the actual parameter defined below from the macro invocation Formal parameter names are case sensitive That is a formal parameter named Foo on the MACRO directive will be matched by the string Foo in the body not by foo FOO or any other variations Whether or not the formal parameters are named any occurance of a backslash V followed by a numeric constant in the current radix will be replaced by the exact text of the corresponding actual parameter from the macro invocation The sequence 0 will be replaced by the number of actual parameters available In order for the REPT directive to be useful to scan all arguments of a macro the sequence Vo will be replaced by the exact text of the actual parameter corresponding to the current iteration of the enclosing REPT directive Note that the value after the backslash must be either 0 non zero and positive or the percent character All consecutive digits up to the first non digit
56. b rs232RxFlag reset the receive flag bank rs232RxBank Switch to rs232 bank mov rs232byte rs232Rxbyte Store byte copy using W retp Function sendbyte INPUTS ecd the byte to be sent via RS 232 H OUTPUTS Outputs The byte via RS 232 S Send byte via serial port p RRR RRR KKK KK RK RK KK KEK ko ke kk KEK KKK KKK KK EK KK RK RK KK KER KKK KKK KK KKK KR KR KKK KR KK KKK KER KKK KKK KEKE KK KER sendbyte mov localTemp0 w _bank rs232TxBank wait test rs232Txcount wait for not busy SZ jmp wait H not wW ready bits inverse logic mov rs232Txhigh w store data byte setb rs232Txlow 7 Set up start bit mov w 10 1 start 8 data 1 stop bit mov rs232Txcount w retp leave and fix page bits PRR RRR KKK KK kk RE KR ke kk kc ke kk KEK KKK koc ke kk koc kk ko ke RK hock kk KEK KKK KKK KK KKK KR KR KKK KR KK ke kc kc KER koc ke kk ke ek ke ek ke KE Z Function sendstring 2000 Ubicom Inc All rights reserved 31 SASM Cross Assembler User s Manual Rev 1 3 Chapter 2 Program Structure www ubicom com Care should be taken that the srings are located within progr
57. bicom com SX Cross Assambler 1 3 2 2000 Ubicom Inc All rights reserved www ubicom com Contents Contents Chapter1 Overview 1 1 Introduction 2 55 dus dino ent VR ero Rer de foie d on E al Si cess R ppl aE RES E od eu 9 IE UM Features uice a et a Dr Eae oe Bowe aped 9 1 3 Invoking SASM vista OR MES ee as E DE EM MI a 9 1 3 1 Compiler Mode EN sexu NN A eL ER CREE EM RR Ya 11 1 3 2 Extensions for Various Tool Environments 11 1 3 3 O tput Fotmat E A ee EI Au EE 11 1 3 4 Display Help Message ha KOR et aa eels oec tre ee ee ee 11 1 3 5 Case Independent Symbols 12 1 3 6 Listing Ple 0 12 1 3 7 Target PrOCOBSODP a eie quc Mathe x eR E G ER es 12 1 3 8 Quiet Message es o sa Od ka Ever 13 1 3 9 RAR RS A ee 13 1 3 10 Detault Lab Wadi so Ln Ee EN 13 1 3 11 Enri e e da a E 14 1 3 12 Disable Full Pathnames in MAP File 14 1 4 Source Files id Re SUI ERU DEEP REA AR AA 14 1 5 Output zas excu rd diye ayes SA A EN as 14 Chapter2 Program Structure 2 1 SOULCE Prosta Res Sre T ATR tet posue Bad date qu epu ta esie I 15 2 2 Assembler Source Line Format dreet k Mas ded ended 38 2 2 1 Label 0 ae do md GR DG hehe kode AA asi 38 2 2 Mnemonic a VE E Eu S S EP EE 39 2 23 Operand DEAD ceeds ew ae ely cab ee eevee de an 39 2 2 4 enn 39 2 2 5 COBSDIDUS Ide base LA path LA a A E Let eg 39 2 2 6 Characters or String Constants
58. bugger to accurately single step NOP instructions and it may be impossible for a breakpoint to be set on a NOP instruction 4 5 3 Assertion Checking This macro along with an associated function provides a capability similar to the standard C assert macro That is it tests a condition which must be true and jumps to the assertion failure routine if the condition is false An ASCII text string is constructed from the assertion parameters so that the failure routine could announce or log the failure sensibly assert macro src cond dst local ok msg sndmsg GTR AZ cond src dst ok token pasting jmp sndmsg msg dw UHATZT Stc4 C OOnd d9t 0 sndmsg mov w msg gt gt 8 point m w to msg mov m w for use by iread mov w msg amp S ff E jmp assert_fail print msg and halt ok endm varl 30 var2 31 initialize varl and var2 mov varl 55 mov var2 Saa later verify varl var2 assert varl ne var2 elsewhere define assert fail routine assert fail use the iread instruction to get at the string sleep 2000 Ubicom Inc All rights reserved 69 SASM Cross Assembler User s Manual Rev 1 3 Chapter 4 Macros www ubicom com 4 6 Errors and Macros Errors are an expected part of program implementation Unfortunately when they occur within a macro invocation the specific cause of the error may not be obvious The error message contains the line number within the source file
59. ces using four different formats three Intel hex formats INHX8M INHX16 INHX8S binary format and IEEE695 format Provides MACRO and conditional assembly capabilities e Supports Hex Decimal default and Octal source and listing formats 1 3 Invoking SASM Use an editor of your choice to create an ASM source file Assemble this source file by typing the following at the command prompt of the directory where SASM EXE resides SASM options file asm Enter where file source file name SASM Cross Assembler User s Manual Rev 1 3 9 2000 Ubicom Inc All rights reserved Chapter 1 Overview Tables 1 1 shows the summary of options specified at the command prompt Table 1 1 Options Summary www ubicom com Opt Arguments Description Default IC SXIPARALLAX Compiler Mode PARALLAX E Extensions for NONE various tool environments F INHX8MIINHX8SIINHX16IINHX32IBIN 161 Output Format INHX8M IEEE695 H or Display Help Message A Turn on case sensitivity Symbols Off L NONE PAGE NOPAGE Listing File NOPAGE P SX18ISX18ACIPINS 18ISX20ISX20ACI Processor Type SX18AC PINS20ISX28ISX28ACIPINS28ISX48 SX48ACIPINS48ISX52ISX52ACIPINSS521 Q message number Quiet a warning msg None R HEXIBINIDECIOCTIDIBIOIH Radix DEC T TABWIDTH Tab Width 8 W 01112 Warning Level 1 IZ Disable path NOTES 1 To eliminate comments e g crossing page boundary from the list files
60. character will be used to form the parameter number In all cases parameter substitution will occur at any point in the input where the reference to a formal parameter is discovered Parameter names are recognized when delimited by whitespace the beginning of a line a comment or end of line or one of the macro operators or quote mechanisms described later Note that formal parameter substitution does not occur inside of quoted strings or comments SASM Cross Assembler User s Manual Rev 1 3 66 2000 Ubicom Inc All rights reserved www ubicom com Chapter 4 Macros 4 4 Macro Invocation Once defined a macro is used by invoking it with appropriate actual values to be used in place of the formal parameters When invoked the macro body is interpolated in place of the invocation with each reference to a formal paramter replaced by the actual value of that parameter The invocation has the form lt label gt lt macroname gt lt parameter1 gt lt parameter2 gt comment where the macroname must match the name of a previously defined macro and the number of parameters must agree with that definition If a label is present it is defined as the PC at the point of invocation 4 4 1 Actual Values of Parameters The actual value of a formal parameter is the exact text of the parameter after leading and trailing whitespace characters are removed Parameters are separated by commas The last parameter is terminated by a commen
61. counter will be advanced by the amount of the expression The expression must be well defined during Pass 1 Example RES 10 2000 Ubicom Inc All rights reserved 61 SASM Cross Assembler User s Manual Rev 1 3 Chapter 3 SASM Assembler Directive www ubicom com 3 1 20 SET or Set a Symbol Equal to an Expression Syntax Description Example lt label gt SET expression lt comment gt To assign the value of a well defined expression to a label Unlike the EQU directive SET can be used more than once on the same symbol with the most recent SET statement determining the value of the label To support semi direct addressing mode for SX48 52BD devices and differentiate between global registers and bank 0 registers the bank 0 registers must be defined as the 9 bit values 100 through 10F In effect SASM treats the imaginary BANK 16 as identical to BANK O In addition banks 1 through 15 may also be referred to by addresses 110 through 1FF FIVE SET 5 or FIVE 5 3 1 21 SPAC Insert Lines in Listing File Syntax Description Example lt label gt SPAC lt expression gt lt comment gt Insert the number of blank lines given by the expression into the listing file SPAC 5 3 1 22 TITLE or STITLE Define Program Heading Syntax Description Example lt label gt TITLE lt string gt lt comment gt lt label gt STITLE lt string gt lt comment gt Set up the text to
62. d formal parameters unnamed parameters or no parameters at all A macro is defined with the MACRO EXITM and ENDM directives The MACRO directive names the macro and describes the paramters The ENDM directive marks the end of the definition An EXITM directive may optionally appear in the body to mark a point at which a later interpolation use or insertion of the macro body will be terminated The macro body consists of all lines extending from the MACRO directive to the next ENDM directive Note that macro definitions may not be nested That is it is not possible to write a macro which when invoked defines another macro A macro may be defined which invokes any macro Such nesting is allowed to a depth of ten nested macros A macro may be defined which invokes itself recursively although such a definition would require great care to avoid infinite recursion and is also limitted to a total of ten nested levels 4 2 1 MACRO Directive The MACRO directive takes one of three forms lt label gt MACRO lt formall gt lt formal2 gt comment lt label gt MACRO lt count gt comment lt label gt MACRO comment In all forms the label names the macro Macro names must be unique and follow all the rules for any symbol name In all forms comments may follow the declaration SASM Cross Assembler User s Manual Rev 1 3 64 2000 Ubicom Inc All rights reserved www ubicom com Chapter 4 Macros
63. d in the label field as either the current program address or as the resulting value of an EQU or SET expression These values can then be used symbolically in operand fields All symbols must be defined at some point in the source code by appearing in the label field A symbol may begin with a colon character in which case it is appended to the most recently defined symbol not beginning with a colon to form the name which appears in the symbol table This can be used to define locally scoped labels within a larger region of code 2000 Ubicom Inc All rights reserved 41 SASM Cross Assembler User s Manual Rev 1 3 Chapter 2 Program Structure www ubicom com 2 34 Reserved Symbols The assembler has internally defined the following reserved symbols DS RES DW FREG EQU ORG END SET WATCH ENDM EXITM IF IFDEF BREAK IFNDEF ELSE ENDIF EXPAND CASE NOEXPAND LIST DEVICE D NOCASE RESET SPAC ZERO LOCAL ERROR LPAGE MACRO RADIX TITLE STITLE NCLUDE SUBTITL LIST PROCESSOR W M OR PC RA RB RC RD RE RL RR SB SC SZ ADD AND CLC CLR CLZ DEC INC JMP MOV NOP NOT RET SNB SNC SNZ SUB WDT XOR BANK CALL CLRB DATA MODE PAGE RETI RETP RETW SETB SKIP SWAP TEST DECSZ INCSZ IREAD MOVSZ RETIW SLEEP OPTION 2 4 Expressions Expressions are used in the operand field of the source statement and may contain constants
64. embler User s Manual Rev 1 3 Chapter 1 Overview www ubicom com 1 3 11 Error Level Command W Arguments 01112 Description This option controls the number of comments warnings and error messages which appear Set it to 0 for lots of output 1 for warnings and errors only or 2 for errors only Default NW 1 1 3 12 Disable Full Pathnames in MAP File Command Z Arguments Description By default the fully qualified pathname of each file will be stored in the MAP file This command line option forces only the filename without the path to be stored Default The full path to each file is stored 1 4 SourceFiles The source file is the file to be assembled SASM assumes all source files to have ASM extensions If not the entire filename including extension has to be provided at the command line 1 5 Output Files SASM Assembler outputs different files with the following extensions HEX Intel 8 bit merged Hex file Default file format OBJ Binary object file if F BIN is used HXH HXL Address Data pairs for high order and low order 8 bits only when INHXSS format is selected as output LST Program listing file SYM Symbol file used for defining watch variables and setting break point at label address Used for symbolic or source level debugging MAP Map file used for source level debugging ERR Error message file SXE IEEE695 output file format if F IEEE695 option is used SASM Cross Assembler U
65. enerate a binary file several formats of hex files or an IEEE 695 format object file This option chooses the output format It may take any of the values BIN16 INHX16 INHX8M INHXSS INHX32 or IEEE695 Default TF INHX8M 1 3 4 Display Help Message Command H or Arguments Description Display the help screen and exit Default 2000 Ubicom Inc All rights reserved 11 SASM Cross Assembler User s Manual Rev 1 3 Chapter 1 Overview www ubicom com 1 3 5 Case Independent Symbols Command I Arguments Turn on case sensitivity Description This option is on by default and there is no documented option to turn it off Default On 1 3 6 Listing File Command L Arguments Use L NONE to disable the listing Description This option takes a keyword indicating whether a listing file is desired and whether it has page headers and form feeds Use L PAGE to produce a listing with page headers and form feeds By default there are 55 total lines per page which can be modified with the LIST directive Use L NOPAGE to produce a listing a listing with no page headers or form feeds Default IL NOPAGE 1 3 7 Target Processor Command P Arguments SX18ISX18ACIPINS18ISX20ISX20ACIPINS20ISX28IS X28 ACIPINS28IS X 481 SXAS8ACIPINSASISX52IS X52ACIPINS52I Description This option selects the default target processor which may be over ridded by the DEVICE directive Choose one of SX18 SX18AC PIN
66. er setup 0 enabled 1 disabled DDIR_W equ S1F Write Port Direction ELSE PRR RRR KK KKK KR KR RK KK kk KK RK KEK KKK KK KK KEK KK RK RK KK KER KKK KKK KK KKK KR KKK KK KR KKK KK KER KK KK KKK KEK EEE SX18AC 20AC 28AC Mode addresses On SX18 20 28 all registers addressed via mode are write only with the exception of CMP and WKPND which do an exchange with W gp EROR GERCROROE e e V Re e RRR AER BAR EEEE Roe Joe AR dee OR BARS BR BRE LER BR ol de ROG SOROR RO ROR de Ye BRL ole dece ee 7 Exchange addresses CMP equ 08 Exchange Comparator enable status register with W WKPND equ 09 Exchange MIWU RB Interrupts pending with W 2000 Ubicom Inc All rights reserved 25 SASM Cross Assembler User s Manual Rev 1 3 Chapter 2 Program Structure www ubicom com Port setup read addresses WKED W equ 0A Write MIWU RB Interrupt edge setup 1 falling 0 rising WKEN_W equ SOB Write MIWU RB Interrupt edge setup 0 enabled 1 disabled ST_W equ SOC Write Port Schmitt Trigger setup 0 enabled 1 disabled VL W equ SOD Write Port Schmitt Trigger setup 0 enabled 1 disabled PLP_W equ SOE Write Port Schmitt Trigger setup 0 enabled 1 disabled DDIR_W equ SOF Write Port Direction ENDIF PRR RRR KR KK RK RE KK KR KK KKK KEK KKK RRR AE ERK KR KR KKK KR KKK KK KR KK KKK KR KKK KK KEK koc ke kc kc KER koc ke kk ke ck ke ke ke ke ke 2 Program
67. erprets as a fixed numeric value SASM supports radix form character hexadecimal decimal octal and binary SASM uses decimal as the default radix which helps determine what value will be assigned to constants in the object file when they are not explicitly specified by a base descriptor 2 2 6 Characters or String Constants String constants always begin with a single or double quote and end with a matching single or double quote SASM converts the characters between the quotes to ASCII values For example MOV W A RETW A 2 2 7 Numeric Constants A numeric constant in SASM consists of an arbitrary number of alphanumeric characters The actual value of the constant depends on the radix you select to interpret it Radices available in SASM are 2000 Ubicom Inc All rights reserved 39 SASM Cross Assembler User s Manual Rev 1 3 Chapter 2 Program Structure www ubicom com binary octal decimal and hexadecimal as shown below If no radix is given SASM uses the default radix as specified by the R command line option or decimal if no R option is present Hexadecimal numbers must always start with a decimal digit 0 9 if the trailing H notation is used If necessary put a leading 0 at the left of the number to distinguish it between hexadecimal numbers that start with a letter A F The hexadecimal digits A through F can be either upper case or lower case Constants can be optionally preceded by a plus or minus sig
68. f Parameters oves s Dey eS ee VERA EN de 67 4 4 2 Token Pasune Le Lise de s by a EA e RC by ak ee Musee 67 4 4 3 QUOLDE ge cindex hwo eed NA i is s ee eee 67 Example T seso ld ee O pe a Petia AD e 68 4 5 1 Rename an Instructora aa EUR IER E EA RU 68 4 5 2 Mix a Parameter with an Opcode 68 4 5 3 Assertion Checking gu A daw PASTA Boo eA Gam ORSAY has 69 Brrorsdnd Macros vue ROTOR ARE AES SS ESS PARSE ES eC 70 SASM Cross Assembler User s Manual Rev 1 3 4 2000 Ubicom Inc All rights reserved www ubicom com Contents Chapter5 Assembler Output Files 5 1 Introduction Ss ea Tar ee R a rov els Sb Au Ae coe Re er edes de eo oe 71 5 2 Object File HEX OE OBI oras esu Ese eh a n 71 53 Listing Pile eS win sek x RR UR E ceo ule UL C RA C MOD E AT 71 244 Cross Reterence DISUBE ia on hbo ae dew kA 73 5 5 Symbol Pile S YM 4 passu X SER Ga ORE AQ PARERE RENE TA v das 73 5 0 Map Els MAP V est purir ireen ed Ad REST 74 5 7 Btror Pe ERR EE 74 07 EMOR Messages aid oid Oy dicus mE Eee Uu Da on mt RE 74 Appendix A Assembler Output Files AU Eogical Operations s an nba iue repe RE Rate BY PE aae Dani ue e 75 AJ Arithmetic and Shift Operations i vec educ ed NA VS Ue es RAYS 75 AS Bitwise Operations 22 22 eiua xil ELI GR eb eae a eee ed 76 AA Data Movement Op rations 3 sepe RR REIR sen A VE 76 A 5 Control Transfer Operations ot 76 A 6 System Control Operations 52e pus See eke Se
69. g 1010 FUSE 1011 FUSEX 1012 Reserved unused by SASM 1013 DEVICE type code 1014 High 16 bits of frequency 1015 Low 16 bits of frequency 1016 Reserved unused by SASM 1017 12 bit BREAK address where locations 1014 through 1017 are included by SASM versions 1 47 and later In all object file formats for the SX processors the 12 bit instruction words are represented by 16 bit words in the file where the high 4 bits are set to zero This arrangement is convenient where most tool chains are used to dealing with files containing 8 bit bytes In the case of the extra information at 1010 and above the extra four bits available in the file are used to advantage Unused program words are initialized to the value SOfff SASM Cross Assembler User s Manual Rev 1 3 79 2000 Ubicom Inc All rights reserved Appendix B Object File Format www ubicom com B 1 3 ID String and FUSE Words The ID string is stored one nibble at a time in the low nibbles of addresses 0x 1000 to 0x100f The string is packed high nibble first For example 1234ABCD is stored as follows 1010 FF3 FF1 FF3 FF2 1014 FF3 FF3 FF3 FF4 1018 FF4 FFl FF4 FF2 101C FF4 FF3 FF4 FF4 The FUSE and FUSEX words are stored as computed from the DEVICE directive at 1010 and 1011 respectively B 1 4 Device Type Code The device type code at 1013 encodes the specific SX family chip and silicon revision described by the DEVICE directive Its high byte
70. g all the text they contain as a single actual parameter to the macro The actual parameter consists of the text enclosed by the braces which are discarded Note that 1f the invocation line is part of the body of a macro definition any formal parameters in that text will be substituted before the text is used as an actual parameter O 2000 Ubicom Inc All rights reserved 67 SASM Cross Assembler User s Manual Rev 1 3 Chapter 4 Macros www ubicom com Parameter substitution will occur at any point where the reference to a formal parameter can be identified except within string constants The notation token will treat the actual value of the formal parameter named by token as if it were a quoted string This may be useful to use a parameter both as part of a string and as part of an operand to an instruction This is implemented by quoting the actual value with ASCII unit separator characters 1f unless it is already so quoted In versions 1 48 and later the notation is available to evaluate an arbitrary well defined expression and use its value as the text of a single actual parameter The value is converted to text in the current default radix 4 5 Example Macros 4 5 1 Rename an Instruction This macro demonstrates how to rename an instruction with a new operand order and support all its variant forms As a simple example the MOV instruction is renamed PUT with reversed operands lit equ 42 Ex equ SLf put mac
71. he assembler will generate a warning if the target address is not in the same page as set by the most recent PAGE instruction To avoid PAGE mismatches automatically a label may often be used in conjuction with an symbol which will cause the required PAGE instruction to be inserted For example SASM Cross Assembler User s Manual Rev 1 3 38 2000 Ubicom Inc All rights reserved www ubicom com Chapter 2 Program Structure call label is assembled identically to page label call label The same capability is available for any instruction which takes an 8 bit or 9 bit target address 2 2 2 Mnemonic The mnemonic field begins after the first white space in the source line and is terminated by the next white space The field may contain an instruction mnemonic assembler directive or macro 2 2 3 Operand The operand field begins immediately after the first white space following the mnemonic field and ends at the next white space The field may contain one or more constants or expressions separated by commas 2 2 4 Comment The comment field begins immediately after the first white space following the operand field or the mnemonic field for those mnemonics that do not require any operands This is an optional field containing printable characters Anything to the right of a semicolon is treated as a comment and will be ignored by the assembler 2 2 5 Constants Constants are strings or numbers that SASM int
72. i tee ER eere PED INE 77 Act Multi Byte Instructions 4 iD iii e o ux ieee eae eg 77 Appendix B Object File Format BI General Information About All Formats 79 B 1 1 File register Address Map 224a zara bie ave pr eas bond ane dee 79 B 1 2 Program Memory Map es ets 79 B 1 3 ID String and FUSE Words 80 B 1 4 Device Type Code nui doda Kaye gala Sey dE eae PUMA RU sa 80 B 1 5 Prequeney and Break a EL e dd o o 80 B 1 6 Sample Program is i TO E EE e S UR Oi d 8l Bi Inte HEX Fil POFIBAL dere di ERREUR eR SK LE TP rS 82 B 2 1 INHX8M Merged 8 bit Intel Hex File Format 82 B 2 2 INHX 16 16 bit Intel Hex File Format 83 B 2 3 INHXSS Split 8 bit Intel Hex File Format 83 Pa Binary Pile Format event hr aee tae ee iere ede xem ee 84 Bl IBBBESODS Pile Format Anie eea Eua At alu hoe taie Le M LAT e 84 B 4 1 Target Devices sie rak nada ei ends datant a 84 B 4 2 D DOS rfc tetera a aa ale doe Maw avg aie Syd ace aa Aloe or wax an 84 B 4 3 SX Program Address Spaces 85 B44 Assembly Time Environment 85 B 4 5 Eine Numbers ZN peice ass es eB elas N ee BE ee a das 85 Appendix C SX52INST SRC Sample Source Appendix D Error Message 2000 Ubicom Inc All rights reserved 5 SASM Cross Assembler User s Manual Rev 1 3 www ubicom com Conten
73. ich SASM itself was invoked and the success failure of the assembly B 4 5 Line Numbers SASM will include records in the line number table in the IEEE 695 file for each source line including macro expansions which generates any words in the code segment Line number records will correctly reflect the actual source file line number and code offset 2000 Ubicom Inc All rights reserved 85 SASM Cross Assembler User s Manual Rev 1 3 Appendix B Object File Format www ubicom com SASM Cross Assembler User s Manual Rev 1 3 86 2000 Ubicom Inc All rights reserved www ubicom com Appendix C SX52INST SRC Sample Source s PRBOO05 SX52INST SRC Demonstrate every mnemonic of the 5X52 lit equ 42 fr equ 1f frott equ Sle 7 fr2 equ 1d imm4 equ Sf device sx52 org 0 H SX52 Data Sheet 16 0 Instruction Set Summary Table Logical Operations and fr w and w r and w lit not fr Qr fr w or w fr or w lit xor fr w xor w r xor w lit Arithmetic and Shift Operations add fr w add w r GLE fr clr w clr wdt dec fr decsz fr inc fr incsz fr rl fr rr fr sub fr w swap gie SASM Cross Assembler User s Manual Rev 1 3 87 2000 Ubicom Inc All rights reserved Appendix C SX52INST SRC Sample Source www ubicom com Bitwise Operations clrb frbit sb frbit setb frbit snb frbit Data Movement Instructions mov fr
74. in symbols which represent addresses of things symbol values in the IEEE 695 files are suitably truncated In particular the 32 bit integer value is truncated to 12 bits If present the bit number field is placed in bits 12 13 and 14 Bit 15 is set to zero so that the resulting 16 bit values are guaranteed to be positive The following bitmap shows the layout of a SASM symbol value as found in the 16 bit entry in the IEEE 695 file debug section 15 14 13 12 1I 0 0 bit value B 4 3 SX Program Address Spaces All locations described in section B 1 1 are included in the program space in the IEEE 695 file Regardless of the complexity of the program locations 0000 through 1017 are written to the SXE file Unused program locations are initialized to the value Offf B 4 4 Assembly Time Environment SASM puts records in the IEEE 695 file documenting some trivia about the runtime environment at the moment SASM is invoked The detailed content of some of these fields will change from run to run making it difficult to compare the resulting SXE files even when no source changes have been made In addition some of these fields will differ in the 16 bit DOS executable build of SASM as compared to the Win32 build Note that SASM has not been built for DOS since version 1 45 5 The variable environment information includes a time stamp documenting when the assembler was run a copy of the command line including the name by wh
75. k ke ke ke ke ke e mainLoop loop mov call call cjne mov call jmp w _hitSpace Send prompt sendstring getbyte rs232Rxbyte loop st hits w hello When sendstring loop space bar hit to terminal at UART rate keep looping until user the space bar send out string PRR RRR RRA KR KKK KEK KK RK KEK KK KKK RK KEK KK RK RK KKK kk KK KK KR KK KKK KR KR KKK KKK KK KKK ERK KKK KEK KEKE ER END End of program code PRR RRR KR KKK KR KR KEK KK kk kc KK KEK koc kk ke kk KEK KK RK KKK KKK KK KKK KR KK KKK KR KKK KKK kk KK KK KEK koc ke kk ke ck ecce ke ke 2000 Ubicom Inc All rights reserved 37 SASM Cross Assembler User s Manual Rev 1 3 Chapter 2 Program Structure www ubicom com 2 2 Assembler Source Line Format The general format for a program source line is as followed lt Lable1 gt lt Mnemonic gt lt Operand gt lt Comment gt 2 2 1 Label The optional label field if present begins at column one of the source line and is terminated by the first white space a space tab or end of line character A label may be the only field in a statement Labels are generally used as a symbolic reference to program memory locations in the source code A label consists of 1 to 32 characters It must begin with a letter and underscore _ or colon and may contain any combination of letters digits and underscores A user defined label may not be a reserved wo
76. l gt INCLUDE lt filename gt lt comment gt To read in the specified file as source code A path name can be provided if the file resides in another directory INCLUDE SXREG INC 3 1 13 LIST Control the list file format Syntax Description lt label gt LIST P lt processor gt lt label gt LIST R lt radix gt lt label gt LIST F lt format gt lt label gt LIST L lt list gt lt label gt LIST X lt on off gt lt label gt LIST C lt cols gt lt label gt LIST N lt lines gt lt label gt LIST Q lt msgnum gt lt label gt LIST W lt 01112 gt The LIST directive sets certain command line options within the source file and allows additional control of the list file format The first four options mirror the command line options P R F and L respectively Use any of SX18 SX18AC SX20 SX20AC SX28 SX28AC SX48 SX48BD SX52 SX52BD or OLDREV for processor Use any of BIN B OCT O DEC D HEX or H for radix Use any of NONE PAGE or NOPAGE for list LIST X ON is a synonym for EXPAND and LIST X OFF is a synonym for NOEXPAND LIST C lt cols gt and LIST N lt lines gt sets the number of columns and lines on a listing page respectively LIST Q lt msgnum gt operates like the Q command line option to quiet individual warning or comment messages by number Use a positive number to quiet the specific message or a negative number to
77. l rights reserved
78. le or disable isochro Disabled inputs nous input mode for turbo 1 Disable synchronous mode operation inputs WATCHDOG 0 Disable watchdog timer Enable or Disable Disabled 1 Enable watchdog timer Watchdog Timer PROTECT 0 Code protect enabled Specified code protection Disabled 1 Code protect disabled 2000 Ubicom Inc All rights reserved 51 SASM Cross Assembler User s Manual Rev 1 3 Chapter 3 SASM Assembler Directive Table 3 3 FUSE FUSEX Bit Settings for SX48 52BD www ubicom com Option Bits Descriptions Function Default PINS 18 SX18AC SX18AC Specifies device PINS18 PINS20 SX20AC SX20AC type PINS28 SX28AC SX28AC PINS48 SX48BD SX48BD PINS52 SX52BD SX52BD OSCLPI Ext Osc LPI Specifies external OSCRC OSCLP2 Ext Osc LP2 crystal resonator OSCXTI Ext Osc XTI Or external RC OSCXT2 Ext Osc XT2 circuit OSCHSI Ext Osc HS1 OSCHS2 Ext Osc HS2 OSCHS3 Ext Osc HS3 OSCRC Ext OSC RC OSC4MHZ Int Osc 4MHz Specifies internal 4MHz OSCIMHZ Int Osc IMHz oscillator divider OSCI28KHZ Int Osc 128kHz OSC32KHZ Int Osc 32kHz BOR42 Brown out reset at 4 2V Specifies brown Disable BOR26 Brown out reset at 2 6V out reset brownout BOR22 Brown out reset at 2 2V BOROFF Disable Brown out reset CARRYX 1 ignore carry flag as input to ADD and SUB Carry flag ADD and SUB instruction instructions use ignored Carry flag as input SYNC 0 Enable synchronous inp
79. lit SKIP if fr fr2 SKIP if fr lit SKIP if fr fr2 Decrement fr JUMP if not zero SASM Cross Assembler User s Manual Rev 1 3 Appendix A Summary of SX Instruction Set www ubicom com SASM Cross Assembler User s Manual Rev 1 3 78 2000 Ubicom Inc All rights reserved www ubicom com Appendix B Object File Format B 1 General Information About All Formats B 1 1 File Register Address Map For the SX28AC data addresses are the 8 bit values given in the datasheet where bits 5 6 and 7 identify the bank and the 16 global registers are multiply mapped to the first 16 locations of every bank For the SX52BD SASM uses a 9 bit address which better describes the 256 banked registers and the 16 global locations In this mapping addresses 000 to 00f are the global registers and 010 to 10f are the banked registers bank 1 thru 15 and then bank 0 In addition SASM allows the user to use addresses from 110 to 1ff as a second mapping of the first 15 banks B 1 2 Program Memory Map The memory map in 1 45 5 uses some program memory addresses beyond the actual program memory to store other out of band information such as the ID string and the FUSE and FUSEX words It would be simple to use additional locations for the frequency and breakpoint address The program memory map implemented in the HEX and SXE output files is the following 0000 0fff4K Words Program FLASH 1000 100f 16 nibbles 8 bytes ID strin
80. mbler Output Files Although not included in the example above the listing may also include page headers controlled by the L command line option If present the page headers may contain optional title and sub title text set by the TITLE and SUBTITL directives The title line appears if set on every page of the listing The sub title line appears if set on every page as well but may be changed on subsequent pages by including additional SUBTITL directives 5 4 Cross Reference Listing A cross reference table is generated at the end of the listing file This table contains a list of every symbol used in the source file along with its symbol type value and the listing line number For example Symbol Type Value Line blink ADDR 00000015 0012 blinker DATA 00000002 0004 rb RESV 00000006 0013 start ADDR 00000010 0007 start loop ADDR 00000013 0009 Where DATA A user defined symbol that represents a data variable defined by EQU directive ADDR A user defined symbol that represents a code address or program counter location RESV A predefined symbol used internally by SASM 5 5 Symbol File SYM The symbol file is identical to the cross reference portion of the listing file It lists all symbols found in the source file provides information on their type value and the specific line numbers where they are found The symbol is required to define watch variables and to specify breakpoint at address label for some debug tools 20
81. memory ORG defines PERDIKE R DREE ee KR OR de ode de eoe de EERE RS RC e ERROR UAR EROR Ger SR Eo IR EERE ISO E Re KEREK dee RR aee ORC RR e QEON He HRK RS INTERRUPT ORG equ 0 Interrupt must always start at location zero RESETENTRY ORG equ 1FB The program will jump here on reset SUBROUTINES_ORG equ 200 The subroutines are in this location STRINGS ORG equ 300 The strings are in the location 300 PAGE3 ORG equ 400 Page 3 is empty MAINPROGRAM ORG equ 600 The main program is in the last page of program memory PR RR RRR RAR KK RK RR KK KR KK KKK KER KK KKK RK KKK KK RK koc HAE kk koc RK KKK KK KKK KR KR KKK ke kk koc ke kc koc KER KR ke kk ke ck ke ek ke ek org INTERRUPT_ORG First location in program memory ERE EERE E QOROR ere Ue EER ARE EL EER ON US CON RSS oh OCCUR RARA RR EERE EES RARE ER AR RS ERICK RSH ER RN pK RRR KH KK RK RE KK KR KK KKK KEK KK KKK KKK ERK KR KR KKK KER KR KKK KKK KKK KR KR KKK KEK KKK KER KK KK KKK KEKE ER Interrupt Service Routin Note 1 The interrupt code must always originate at address 0 H Interrupt Frequency Cycle Frequency retiw value For example With a retiw value of 217 and an oscillator frequency P of 50MHz this code runs every 4 32us Note 2 Mode Register M is not saved in SX 28 but saved in SX 52 when an Interrupt H occurs If the code is to run on a SX 28 and M register is used in the ISR S then the M register has to
82. ment Operations MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOV MOVSZ MOVSZ SC TEST fr W Wir W fr W W lit W fr W fr W fr W lt lt tfr W gt gt fr W lt gt fr W M M W M lit Irx W IOPTION W W fr W fr fr A 5 Control Transfer Operations CALL JMP JMP JMP RET RETP RETI RETIW RETW SKIP addr8 addr9 W PC W lit SASM Cross Assembler User s Manual Rev 1 3 NO ON U A N QONNN 76 www ubicom com Clear bit to 0 Clear carry Clear zero Skip if bit 1 Set bit to 1 Skip if bit 0 Move W into fr Move fr into W Move fr W into W Move literal into W Move 1 s complement of fr to W Move fr 1 into W Move fr 1 into W Move left rotated fr into W Move right rotated fr into W Move nibble swapped fr into W Move MODE into W Move W into MODE Move literal into MODE Move W into Port Rx control register Move W into OPTION Move fr 1 into W skip if zero Move fr 1 into W skip if zero Skip if carry bit is set Test if fr equal to 0 Call to address Jump to address Move W into PC L Add W into PC L Return from call without affecting W Return from call write to PA2 PAO Return from interrupt Return from interrupt subtract W from RTCC Return from call move literal in W Skip the following instruction 2000 Ubicom Inc All rights reserved www ubicom com A 6 System Control Operations BANK IREAD MODE M PAGE SLEEP
83. n Any numeric constant may contain embedded underscore characters which are silently discarded during the conversion of the constant Such underscores are useful to group digits of a long constant for easier reading This feature improves both readability of large numeric constants and compatibility with Parallax SXKey which also supports this notation For example the number ten million may be represented by 10_000_000 which is easier to read at a glance than 10000000 Note that a leading underscore will cause the constant to be treated as a symbol which is probably not what was intended Also mixing an underscore into a leading or trailing radix specification character will probably cause unexpected behavior The formats for declaring a constant are shown in Tables 2 1 The Radix descriptor is case insensitive Also either single quote and double quote characters may be used where single quotes are shown in Table 2 1 Table 2 1 Constants Declaration TYPE SYNTAX EXAMPLE Binary lt binary digits gt B 01000001B B lt binary digits gt B 01000001 B lt binary digits gt B 01000001 lt binary digits 2611111011 Octal octal digits gt O 1010 O octal digits O 101 Q octal digits Q 101 Decimal digits D 65D D lt digits gt D 65 D lt digits gt D 65 Hexadecimal lt digit gt lt hex digits gt H 41H lt digit gt lt hex digits gt X 41X H lt hex digits gt H 41 X hex digits X 41 Ox lt hex digits gt 0x
84. n 3 A 7 Multi Byte Instructions Appendix A Summary of SX Instruction Set Transfer n to FSR7 FSR5 Read instruction at MODE W into MODE W Transfer n into MODE Transfer n into MODE Transfer n to PA2 PAO TO PD Clear WDT and enter sleep mode fr frbit fr frbit fr lit fr fr2 fr lit addr9 fr fr2 addr9 fr lit addr9 fr fr2 addr9 fr lit addr9 fr fr2 addr9 fr lit addr9 fr fr2 addr9 fr lit addr9 fr fr2 addr9 fr lit addr9 fr fr2 addr9 fr lit fr fr2 fr lit fr fr2 fr lit fr fr2 fr lit fr fr2 fr lit fr fr2 fr lit fr fr2 fr addr9 2000 Ubicom Inc All rights reserved fr W C DC Z fr W C DC Z fr Z frZ Dr WA Dr WA W C DC Z W C DC Z W C DC Z W C DC Z W C DC Z W C DC Z W C DC Z W C DC Z W C DC Z W C DC Z W C DC Z W C DC Z W C DC Z W C DC Z W C DC Z W C DC Z W C DC Z W C DC Z W C DC Z W C DC Z W C DC Z W C DC Z W C DC Z W C DC Z fr 77 ADD lit into fr ADD fr2 into fr ADD frbit into fr ADD frbit into fr AND lit into fr AND fr2 into fr JUMP if fr gt lit JUMP if fr gt fr2 JUMP if fr gt lit JUMP if fr gt fr2 JUMP if fr lt lit JUMP if fr lt fr2 JUMP if fr lt lit JUMP if fr lt fr2 JUMP if fr lit JUMP if fr fr2 JUMP if fr lit JUMP if fr fr2 SKIP if fr gt lit SKIP if fr gt fr2 SKIP if fr gt lit SKIP if fr gt fr2 SKIP if fr lt lit SKIP if fr fr2 SKIP if fr lt lit SKIP if fr lt fr2 SKIP if fr
85. nterrupt RTE IE lo enabled by default RTCC INC EXT 500100000 Sets RTCC increment on RTCC pin transition RTS hi SASM Cross Assembler User s Manual Rev 1 3 36 2000 Ubicom Inc All rights reserved www ubicom com Chapter 2 Program Structure P RTCC increment on internal instruction RTS lo is default RTCC_FE 500010000 Sets RTCC to increment on falling edge RTE ES hi RTCC to increment on rising edge RTE ES lo is default RTCC PS ON 00000000 Assigns prescaler to RTCC PSA lo RTCC PS OFF 00001000 Assigns prescaler to WDT PSA hi PS 000 00000000 PRICC 1 25 WEE 2 1 1 PS 001 00000001 RTCC 1 4 WDT 1 2 PS 010 00000010 RTCC 1 8 WDT 1 4 PS 011 00000011 RTCC 1 16 WDT 1 8 PS 100 00000100 RTCC 1 32 WDT 1 16 PS 101 00000101 RTCC 1 64 WDT 1 32 PS 110 00000110 RTCC 1 128 WDT 1 64 PS 111 00000111 RICC 1 256 WDT 1 128 OPTIONSETUPequRTCC PS OFF the default option setup for this program mov w OPTIONSETUP setup option register for RICC interrupts enabled mov loption w and no prescaler jmp mainLoop PRR RRR KKK KK kk RR KK KR KK KKK KEK KKK KK kk KEK KK RK RK KK KER KKK KK RK KKK KK KKK KKK KR KKK KERR ERK KKK KKK KEK KER MAIN PROGRAM CODE RRR RRR KKK KK RK RR KK KR KK KKK KEK KKK koe HAE kk ko koc kk hock HAE kk KK KK KR KK KKK KR KR KKK ke kk koc KKK KER koc kk ke e
86. oads the M register correctly for the SX18AC SX20AC and SX28AC noexpand ENDIF endm PRR RRR RAR KK RK RRR KK kk KK KKK EK KK KK KEK KEK KK RK KKK KKK KK RK RK EK KKK KK HAE EK KKK KKK KKK KA KK KKK INCP DECP macros for incrementing decrementing pointers to RAM used to compensate for incompatibilities between SX28AC and SX52BD D ARENA RE PE KRKE E RENT REA KH REAR KEKE EREE KERE SAR ERK ERE ER EER ER K ERI RK EIR KO BR Wee dee INCP macro 1 Increments a pointer to RAM inc 1 IFNDEF SX48_52 setb 1 4 If SX18 or SX28AC keep bit 4 of the pointer 1 ENDIF to jump from 1f to 30 etc endm DECP macro 1 Decrements a pointer to RAM IFDEF 5X48 52 dec NI ELSE clrb 1 4 If SX18 or SX28AC forces rollover to next bank dec U if it rolls over skips banks with bit 4 0 setb 1 4 Eg 30 gt 20 gt 1f gt 1f ENDIF AND 31 gt 21 gt 20 gt 30 endm PRR RRR KKK KK RK KEK KK RK KKK KEK KK KK KKK KEK KK RK KKK KKK KKK KR KR KK KKK KEK KEK KKK KKK KKK KA KK KKK Error generating macros Used to generate an error message if the label is intentionally moved into the Second page Use for lookup tables PR RR RRR KKK KK RK RRR KK RK KK KERR kk koc KKK KEK KEK KK kk Rock kc KEK KR KR KEK KKK KK EK KKK ko ke kk koc ke HAE kk KK KKK tableStart macro 0 Generates an error message if code that MUST be in the first half of a page is moved into the second half if
87. ocation in code or data address space This is followed by the opcode generated for that location If an instruction or directive generates multiple opcode words the rest are displayed up to four words per line on additional listing lines which are not numbered The balance of the line contains a copy of the source text as assembled If this line is part of a macro invokation this text will include the substituted actual parameters No substitution occurs within comments Some directives display the value assigned rather than a PC address and opcode In this case those two columns are replaced by the 32 bit plus bit position if non zero expression value shown in hexadecimal Error messages include the listing line number at which the error occurred as well as the message number The form is filename src 10 Line 123 Error 55 Pass 2 ERROR user message where 10 is the line number within the file filename src 123 is the listing line number Error is the severity 55 is the message number for use with the LIST Q directive or Q command line option and 2 is the pass number Everything after the colon is the text of the specific error message In the listing file the line number columns are filled with so that error lines visually stand out from the balance of the listing SASM Cross Assembler User s Manual Rev 1 3 72 2000 Ubicom Inc All rights reserved www ubicom com Chapter 5 Asse
88. org 70 bank4_org 90 bank5_org SBO bank6_org SDO bank7_org SFO ENDIF PRR RR RRR KKK KR KR KEK KKK KK KKK KEK KK KKK EK KEK KK RK RK KK ke kk KK KK KR KK KKK KR KR KKK KKK KKK KK ERK KKK KEK KEK EE Global Register definitions NOTE Global data memory starts at SOA on SX48 52 and 08 on SX18 20 28 PRR RRR RK HK KK RK RR KK KER KK RK KEK KK KKK RK RE KK KR KR KKK KER KK KKK RK KKK KK RK RK KKK kc ko KK KKK ERK KKK KKK ke ke ke ke KER org global_org 2000 Ubicom Inc All rights reserved 19 SASM Cross Assembler User s Manual Rev 1 3 Chapter 2 Program Structure www ubicom com flags0 equ global_org 0 Stores bit wise operators like flags and function enabling bits semaphores VP RS232 Receiv rs232RxFlag equ flags0 0 indicates the reception of a bit from the UART isrTemp0 equ global_org 1 Interrupt Service Routine s temp register Don t use this register in the mainline localTempO equ global org 2 temporary storage register Used by first level of nesting i ever guaranteed to maintain data localTempl equ global_org 3 temporary storage register Used by second level of nesting or when a routine needs more than one temporary global register localTemp2 equ global org 4 temporary storage register Used by third level of nesting or by main loop routines that need a loop counter etc PRR RRR KK KKK KEK RE KK KEK koc KK KEK KK kk
89. other formats BIN16 INHX16 INHX8S and IEEE695 are provided to support other programmers See Appendix B for more information on the individual object file formats 5 3 Listing File LST The listing file contains the source code along with some useful information about the output addresses and corresponding object code Each line from the source code will be reproduced in the listing file and accompanied by the listing file line number program counter and the object code OPCODE SASM Cross Assembler User s Manual Rev 1 3 71 2000 Ubicom Inc All rights reserved Chapter 5 Assembler Output Files www ubicom com Example Line PC Opcode Source il OF FB OFFF device sx28 2 O7FF 0A10 reset start 3 4 00000002 blinker equ 0000_0010b 5 6 200000010 org 10 7 0010 005F start mode f 8 0011 DCOU mov rb 0 0012 0006 9 0013 0915 loop call blink 10 0014 0A00 jmp lop listing src 10 Line 10 Error 3 Pass 2 Symbol lt start lop gt is not defined 11 12 0015 0C02 blink mov W blinker 13 0016 01A6 xor rb W toggle rb 1 14 0017 000C ret 15 END The body of the listing file consists of several fields The first is a line number The listing line number counts all lines presented to the assembler This includes the contents of included files macro bodies and rept blocks Each line is counted even if excluded from the list file by the NOEXPAND directive The next field is the l
90. rd A label may define a symbolic name for a program address a data address a macro or an arbitrary 32 bit value If used as a program address a label may be either global or local A global label must be unique in the entire program A local label is written with an initial colon character and must be unique over the set of lines extending from the immediately preceding global label to the next global label Local labels will appear in the symbol table concatenated to the name of the immediately preceding global label For example count equ 30 org 100 reset main main mov count 10 Loop call blink djnz count loop sleep blink define a blink function here ret This routine defines labels count main main loop and blink The label count refers to a data address The global label main refers to the program address 100 and is also the reset vector The global label blink is a function which blinks a light whose implementation is left as an exercise for the reader The local label loop may be used again in other sections of the code allowing for convenient nicknames for loops and other locations private to the implementation of a function Labels for program locations refer to the entire 12 bit address of the labeled instruction Since the CALL and JMP instructions can only use 8 and 9 bits of the address the assembler will silently truncate the target address to fit in the instruction If possible t
91. read9 Serviced at ISR rate 16 DH jmp isrOut 7 cycles until mainline program resumes execution DH isrThread10 Serviced at ISR rate 16 H jmp isrOut 7 cycles until mainline program resumes execution i isrThreadll Serviced at ISR rate 16 DH jmp isrOut 7 cycles until mainline program resumes execution DH isrThread12 Serviced at ISR rate 16 jmp isrOut 7 cycles until mainline program resumes execution DH isrThread13 Serviced at ISR rate 16 This thread must reload the isrMultiplex register _bank Multiplexbank mov isrMultiplex 255 reload isrMultiplex so isrThreadl will be run on the next interrupt jmp isrOut 7 cycles until mainline program resumes execution This thread must reload the isrMultiplex register Since it is the last one to run in a rotation isrOut PRR RRR KHER KK RK RR KK KR RK KKK ke kk KKK RRR KK ERK KR KR KKK KEK KK KKK KKK KKK KR KKK KK ke kk koc kk kc ke ko ko koc ke kk ke ck ke ke ke ke ke ke Set Interrupt Rate PER DITA eee e ES EER ES dee ok eoe RS IRE HRS RIE e dede ede RS ERAS dede de RIOR RS ERE RIE E BR IR RS ee e ok HOR IR e ol dein isrend mov w intperiod refresh RTCC on return RTCC 217 no of instructions executed in the ISR retiw return from the interrupt PRR RRR RK KKK KR KR RK KKK KK KKK ke kk KKK ko ke HAE KA ko ke RK koc kk ke kk koc KKK KR KK KKK KR KKK KKK kk koc KKK KEK koc kc kk ke ek ke koe ke ke End of the Interrupt Service Routine gOBORGROKOKCK
92. ro src dst mov dst src note reversed operand order endm put w fr mov fr w put fr w mov w fr put fr w w mov w fr w put lit w mov w lit 4 5 2 Mix a Parameter with an Opcode This macro implements a condition around an instruction marked with the BREAK directive Invoke it once in a program to test and break on a condition at runtime assuming your debugger environment supports the BREAK directive The first parameter should be one of a ae b be e or ne which form part of a compare and skip instruction The last two parameters are the operands of that instruction brkifnot MACRO 3 choice of a ae b be e ne cs VI N27 N83 BREAK jmp 1 ENDM SASM Cross Assembler User s Manual Rev 1 3 68 2000 Ubicom Inc All rights reserved www ubicom com Chapter 4 Macros testreg 32 otherreg 33 BREAK if testreg brkifnot ne testreg 5 BREAK if testreg gt otherreg brkifnot be testreg otherreg Note that since text substitution is used for the operand value it is possible to pass either a literal value or a FR address and the appropriate instruction form will be generated to match Note also that this macro applies the breakpoint to a JMP 1 instruction rather than a NOP instruction One might assume that the latter would be preferred since both occupy a single word in the program and the NOP executes in a single cycle rather than three cycles for the JMP Unfortunately it is difficult for the de
93. s hmi hmi hmi write ST register hmit Trigg Trigg Trigg Trigg nab nab nab r 0 r 0 r 0 r 0 nab disabl disabl disabl disabl led led led led SASM Cross Assembler User s Manual Rev 1 3 34 2000 Ubicom Inc All rights reserved www ubicom com Chapter 2 Program Structure ENDIF mode LVL_W point MODE to write LVL register mov w RA_LVL Setup RA CMOS or TTL levels 1 TTL O0 CMOS mov ra w mov w RB_LVL Setup RB CMOS or TTL levels 1 TTL 0 CMOS 0 1 TTL 2 7 CMOS mov rb w mov w RC_LVL Setup RC CMOS or L levels 1 L 0 CMOS mov rc w IFDEF SX48 52 mov w RD_LVL Setup RD CMOS or L levels 1 L 0 CMOS mov rd w mov w RE_LVL Setup RE CMOS or L levels 1 L 0 CMOS mov lre w ENDIF mode PLP_W point MODE to write PLP register mov w RA_PLP Setup RA Weak Pull up 0 enabled 1 disabled mov lra w mov w RB_PLP Setup RB Weak Pull up 0 enabled 1 disabled mov lrb w mov w RC_PLP Setup RC Weak Pull up 0 enabled 1 disabled mov lrc w IFDEF SX48 52 mov w RD_PLP Setup RD Weak Pull up 0 enabled 1 disabled mov rd w mov w RE_PLP Setup
94. ser s Manual Rev 1 3 14 2000 Ubicom Inc All rights reserved www ubicom com Chapter 2 Program Structure 2 1 Source Program The structure of a source program consists of one or more statements and comments Each statement can be a combination of mnemonics directives macros symbols expressions and or constants Example of an assembly program Copyright 11 21 1999 Ubicom Inc All rights reserved Scenix Inc assumes no responsibility or liability for the use of this product application software any of these products Ubicom conveys no license implicitly or otherwise under any intellectual property rights Information contained in this publication regarding e g application implementation and the like is intended through suggestion only and may be superseded by updates Ubicom makes no representation or warranties with respect to the accuracy or use of these information or infringement of patents arising from such use or otherwise PRR RRR RAR RAR KR KKK KEK KK kk KEK KKK KKK KK EK KK KKK KKK KER KKK KKK KK KKK KR KR KKK KR KK KKK KER KKK KKK KEKE KER
95. symbols or any combination of constants and symbols separated by operators Expressions are calculated with 32 bit arithmetic To handle references to single bits within a file register expressions may include a bit number ranging from 0 to 7 The DOT operator allows a bit number to be added to an expression or extracted from an expression The bit number zero is indistinguishable from an expression without a bit number The DOT operator may be used as a unary operator to extract a bit number and the operator may be used as a prefix to discard a non zero bit position silently 2 4 1 Arithmetic Operators The arithmetic operators available in expressions are listed in the following table Operators are grouped by precedence with earlier groups in the table at a higher precedence than later Within each group precedence is strictly left to right Parenthesis may be used to modify the precedence arbitrarily and may be nested to any required depth SASM Cross Assembler User s Manual Rev 1 3 42 2000 Ubicom Inc All rights reserved www ubicom com Chapter 2 Program Structure Note that some operators are not useful without parenthesis due to their actual precedence For example the bit position operator is at a relatively high precedence which allows expressions such as 3 2 5 to evaluate to 8 2 which makes sense If the intended result is 3 7 then the expression should be written as 3 2 5 All arithmetic is performed in 32 bi
96. t or the end of the line If a comma or whitespace must be passed as part of an actual parameter then the parameter value may be enclosed in curly braces which will be removed before the value is substituted Grouping with curly braces does not prevent any formal parameter of an enclosing macro inside the text from being recognized and substituted Note that ordinary quotes in an actual parameter are preserved and also prevent formal parameter substitution See Section 4 4 3 on Quoting below 4 4 2 Token Pasting The token pasting operator may be used to concatenate a formal parameter to other text to form a larger token The token pasting operator effectively works as a zero width space character which provides an opportunity for the formal parameter reference to be seen and disappears from the source text for all further proccessing The notation C lt token token gt will paste the two tokens together into a single token Either token may be the name of a formal parameter or an index of a parameter in the C lt 1 gt notation which will be substituted by its actual value or any other text which will be preserved The resulting text is taken as a single token and must be legal at the point where it appears or a suitable error will occur Token pasting is useful for including an actual parameter value as part of an instruction mnemonic or symbol name 4 4 3 Quoting On a macro invocation line curly braces have the effect of collectin
97. t two s complement integers and intermediate results may be saved in the symbol table with 32 significant bits along with a 3 bit bit position For consistency with the processor datasheet an unspecified bit position is equivalent to bit zero Of course operand values are truncated as appropriate to fit the instructions with which they are used OPERATOR DESCRIPTION EXAMPLE VALUE Magic Values Current Program Counter Current repetition counter Parenthesis Grouping 10 5 5 3 Unary Unary Plus 14 14 Unary Minus 14 14 Unary One s Complement 1 Oxfffffffe Bit Position Z 2 Logical Not 1 3 5 TRUE Il Absolute Value 1142 42 Bit Number FR BIT 52 Multiplication and Division Multiplication 3 4 12 Division 3 4 0 Modulus 10 8 2 amp Bitwise And 10 amp 3 2 A Bitwise Exclusive Or 1013 9 lt lt Left Shift 10 lt lt 3 80 gt gt Right Shift 10 gt gt 3 1 2000 Ubicom Inc All rights reserved 43 SASM Cross Assembler User s Manual Rev 1 3 Chapter 2 Program Structure www ubicom com gt lt Bit Reversal 2001 gt lt 12 3000 Addition and Subtraction Addition 6 8 14 Subtraction 6 8 2 Bitwise Inclusive Or 1013 11 Logical Relations Logical Equal 3 FALSE Iz Logical Not Equal 3 5 TRUE lt Less than 3 lt 5 TRUE gt Greater than 3 gt 5 FALSE lt Less than or equal 3 lt 5 TRUE gt Greater than or equal 3 gt 5 FALSE
98. ts 2000 Ubicom Inc All rights reserved 6 SASM Cross Assembler User s Manual Rev 1 3 www ubicom com Contents List of Tables Table 1 1 Options DIEN os MT abeng o osse To cs A 10 Table 2 1 Constants Declaration uste nA 40 Table 3 1 Assembler Directives nee ee e eres eege eee Ee e ee eU Er eed te eal 47 Table 3 2 FUSE FUSEX Bit Settings for SX18 20 28AC VU 50 Table 3 3 FUSE FUSEX Bit Settings for SX48 52BD sese 32 2000 Ubicom Inc All rights reserved 7 SX User s Manual Rev 3 1 Contents www ubicom com SX User s Manual Rev 3 1 8 2000 Ubicom Inc All rights reserved www ubicom com Chapter 1 Overview 1 1 Introduction This User s Manual describes the SASM Cross Assembler for the SX communications controllers from Scenix The manual explains how to invoke and use SASM Topics include program structure directives macros and file outputs A summary on the SX basic instruction set is also given SASM Cross Assembler is a software development tool that accepts the SX symbolic assembly language as input and translates it into object codes under the MS DOS operating system on the IBM PC or compatible systems 1 2 Main Features e Translates programs source code written in SX Assembly language to machine executable code object code on IBM PC or compatibles running MS DOS version 3 0 or higher e Generates object code for SX communications controllers including the SX18 20 28AC and SX48 52BD devi
99. uts Enable or Disable Disabled 1 Disable synchronous inputs synchronous input mode for turbo mode operation WATCHDOG 0 Disable watchdog timer Enable or Disable Disabled 1 Enable watchdog timer Watchdog Timer PROTECT 0 Code protect enabled Specified code Disabled 1 Code protect disabled protection SASM Cross Assembler User s Manual Rev 1 3 52 2000 Ubicom Inc All rights reserved www ubicom com Chapter 3 SASM Assembler Directive Table 3 3 FUSE FUSEX Bit Settings for SX48 52BD Option Bits Descriptions Function Default SLEEPCLK 0 Enable clock operation during Sleep Clock Dis Disable sleep sleep mode able clock 1 Disable clock operation during sleep mode WDRT60 60 msec Delay Reset Timer 18 0 msec WDRT960 sec time out period WDRT006 0 25 msec WDRT184 18 0 msec default 2000 Ubicom Inc All rights reserved 53 SASM Cross Assembler User s Manual Rev 1 3 Chapter 3 SASM Assembler Directive www ubicom com 3 1 3 DS Define Memory Space Syntax lt label gt DS lt expression gt Description Define memory space by incrementing the data memory address during assembly The expression must be well defined during Pass 1 Example ORG 10 Timers timers_low ds 1 10 timers_high ds 1 11 timers_accl ds 1 12 timers_array ds 3 13 14 15 3 1 4 DW Define Data in Memory Syntax lt label gt DW lt operand gt Description Initialize one or more words of
100. w localTemp2 mov hex w of hex register call getvalidhex mov w rs232byte Send the second received byt call sendbyte mov w localTemp2 and w HSOf GE w hex mov hex w retp getvalidhex gh1 car localTemp2 jnb rs232Rxflag S get a byte from the terminal clrb rs232Rxflag mov rs232byte rs232Rxbyte call uppercase uppercase it loop mov w localTemp2 get the value at temp index call hextable xor w rs232byte snz compare it to the received byt ret inc localTemp2 if they are equal we have the jb localTemp2 4 ghl upper nibble Continue if not jmp loop ret hextable add pc w retw L I retw EL retw 24 retw uoi retw a 2000 Ubicom Inc All rights reserved 33 SASM Cross Assembler User s Manual Rev 1 3 Chapter 2 Program Structure www ubicom com retw retw retw retw retw retw retw retw retw retw retw 151 6 I rg tg p RRR RRR KKK KK RK RE KK KR KK KKK KEK KKK KK EK RE KK KR KR KKK KER KR KKK KKK KKK KR KR KKK KEK KK RRR ERK KKK KKK KEKE KER org STRINGS_ORG This label defines wher strings are kept in program space all the following strings must be within the same half page of the program memory for send string to work preceded by this label J RRR RRR KKK KK kk RK KK KR KK KKK KEK KK kk ke RK KEK KK RK KR KKK KKK KKK KKK KK KKK KR KKK KK KKK koc ke KK KER koc ke KKK ck ke ke ke ke e and they must be PRR RRR KK KKK KR KR KKK KR KK KKK KEK KKK KKK KK EK
101. where the macro containing the offending line was invoked Most development environments make it easy to open the souce file positioned to the named line This is however probably not the best place to begin since it is not the line which actually caused the error The error message also contains the listing line number at which the error occurred If the offending line is found in the LST file the listing will show the line in context along with the error message and any formal parameters replaced by their actual values SASM Cross Assembler User s Manual Rev 1 3 70 2000 Ubicom Inc All rights reserved www ubicom com Chapter 5 Assembler Output Files 5 1 Introduction When SASM is activated you will see the following SASM Cross Assembler for Scenix SX based Microcontrollors Version Xxx Copyright c Advanced Transdata Corporation 1999 xxx lines compiled in xxx seconds Xxx symbols lt error status gt For each source file submitted the SASM will produce the following files HEX object file LST listing file unless the L switch is given to suppress its output SYM symbol file MAP map file ERR error message file 5 2 Object File HEX or OBJ The object file can be in different formats and contains data that can be loaded and executed SASM outputs INHX8M Intel 8 bit Hex file format as the default This file will be used by the device programmer and the debug tool for programming debugging purposes The
102. www ubicom com Ubicom SX Cross Assembler User s Manual Lit No UMO2 04 SASM Cross Assembler User s Manual Rev 1 3 2000 Ubicom Inc All rights reserved Revision History www ubicom com Revision History REVISION RELEASE DATE SUMMARY OF CHANGES 1 0 July 14 1999 Initial Release 1 1 May 15 2000 Updated to reflect latest SX devices 1 2 August 30 2000 Updated to support SASM vl 45 5 and higher revisions 1 3 December 2000 Updated to describe the improved macro lan guage provided by SASM v1 46 including minor revisions 1 47 and 1 48 2000 Ubicom Inc All rights reserved No warranty is provided and no liability is assumed by Ubicom with respect to the accuracy of this documentation or the merchantability or fitness of the product for a particular application No license of any kind is conveyed by Ubicom with respect to its intellectual property or that of others All information in this document is subject to change without notice Ubicom products are not authorized for use in life support systems or under conditions where failure of the product would endanger the life or safety of the user except when prior written approval is obtained from Ubicom Ubicom and the Ubicom logo are trademarks of Ubicom Inc All other trademarks mentioned in this document are property of their respective companies Ubicom Inc 1330 Charleston Road Mountain View CA 94043 USA Telephone 1 650 210 1500 Web site hhtp www u
103. y The IF statement requires a matching ENDIF statement The expression must be well defined during Pass 1 count equ 12h IF count gt 10h INC 4 ELSE DEC 4 ENDIF SASM Cross Assembler User s Manual Rev 1 3 56 2000 Ubicom Inc All rights reserved www ubicom com Chapter 3 SASM Assembler Directive 3 1 10 IFDEF ELSE ENDIF Conditional Assembly Syntax IFDEF lt symbol gt lt source lines gt ELSE lt source lines gt ENDIF Description ELSE is used in conjunction with IFDEF directive to provide an alternative path If symbol is not defined the alternative path noted by the ELSE directive is taken providing conditional assembly The IFDEF statement requires a matching ENDIF statement Example varl equ 10h IFDEF varl INC 4 ELSE DEC 4 ENDIF 3 1 11 IFNDEF ELSE ENDIF Conditional Assembly Syntax IFNDEF symbol source lines ELSE source lines ENDIF Description ELSE is used in conjunction with IFNDEF directive to provide an alternative path If symbol is defined the alternative path noted by the ELSE directive is taken providing conditional assembly The IFNDEF statement requires a matching ENDIF statement Example IFNDEF varl INC 4 ELSE DEC 4 ENDIF 2000 Ubicom Inc All rights reserved 57 SASM Cross Assembler User s Manual Rev 1 3 Chapter 3 SASM Assembler Directive www ubicom com 3 1 12 INCLUDE Insert External Source File Syntax Description Example lt labe
104. y inside a macro body These symbols are private to each invocation of the particular macro and cannot be referenced outside of the macro body The private symbol is used within a macro body just like any other label Each time the macro is invoked SASM will assign each private symbol a unique name of the form 0001 0002 0003 and so forth The unique name will appear in the listing file in place of all uses of the text of the private symbol 2000 Ubicom Inc All rights reserved 65 SASM Cross Assembler User s Manual Rev 1 3 Chapter 4 Macros www ubicom com All LOCAL directives must appear immediately after the MACRO directive and before the first actual line of the macro body 4 2 5 Local Labels and Macros A local label is any label which begins with a colon character Outside of a macro body such a label is appended to the text of the last global label to form a name which must be unique in the program Each macro invocation provides a similar context for local labels inside the macro body This implies that code inside a macro body may not refer to a local label declared outside of the macro As macro invocations nest the effective name of the local label lengthens There is an upper bound of about 130 characters for the name of a symbol which is sufficient for the maximum allowed macro nesting 4 3 Formal Parameters Formal parameters may be declared by count or by name If the MACRO directive has one or more names as
105. z jmp SX48 52 RAM clear routine w 0a reset all ram starting at SOA fsr w clear using indirect addressing fsr repeat until done zeroRam banko clear bank 0 registers Ur VY X rod rod Ur d Ur do Ur Ur Ur dod H 0 oo GW 090 BGU BUNHO SX18 20 28 RAM clear routine fsr reset all ram banks are we on low half of bank If so don t touch regs 0 7 f5r 3 To clear from 08 Global Registers ind clear using indirect addressing fsr repeat until done zeroRam pOCKOCKCKCKCkCk kk KR KR KEK KK kk ko KKK KEK koc kc kk ke kk koc kk ko koc RK RK kk ke kk KK KKK KKK KKK KR KKK KK KR ko koc KKK KER koe kk ke ek KEKE ke Initialize program VP registers LORE EE RES EL RR RES RKB e deo ese eoe de eoe IER LE RR TELE OON LEER de ecol sese doe dede se ee bank mov mov rs232TxBank Select rs232 bank w FUARTDivide load Txdivide with UART baud rate rs232TXdivide w p RRR RRR KH KK RK KKK RAR RAR RAR RAR RAR KK KKK KR KR KKK KER KKK KKK KK KKK KR KKK RAR RARE RARA kk ke ck ke ek ke ke ke Setup and enable RTCC interrupt WREG register RTCC WDT prescaler LR ERE ERE ERIE cede Sek ON de Sek Ko Ree RR de ec esce do Roe Sec aede xo Re Ree dese esie de BRI IEEE FRILL RR REE LL eoe see ce de dese ee RTCC ON 10000000 sEnables RTCC at address 01 RTW hi WREG at address 01 RTW lo by default RTCC ID 301000000 Disables RTCC edge interrupt RTE IE hi RTCC edge i

Download Pdf Manuals

image

Related Search

Related Contents

LEFTY SUPERMAX 2.0 - Eighty-Aid  SAFETY - Caterpillar  Grundig MW 82-50/ 8 User's Manual    Descargar ficha de catálogo  Installation Manual - gis  6.3, 6.4, 6.5, 6.6, 6.7, 6.8  GT800 Guida per l`utente (it) - Zebra Technologies Corporation  JVC AV-32DF74 32" TV  CANopen - DTM (Device Type Manager) di  

Copyright © All rights reserved.
Failed to retrieve file