Shop OBEX P1 Docs P2 Docs Learn Events
Starting Out With SX Assembler — Parallax Forums

Starting Out With SX Assembler

microcontrollerusermicrocontrolleruser Posts: 1,194
edited 2018-08-01 05:40 in General Discussion
Here's the code.Will put questions in next post.
;
;DETAILS:
;  This code demonstrates configuring the I/O pin direction (input/output).
;=======================================================================


;-------------------------- DEVICE DIRECTIVES --------------------------

		DEVICE		SX28,OSC4MHZ,TURBO

IFDEF	__SASM  ;SASM Directives
		DEVICE		STACKX,OPTIONX
		IRC_CAL		IRC_SLOW
		
ELSE		;Parallax Assember Directives
		DEVICE		STACKX_OPTIONX
ENDIF

		RESET		Initialize

;---------------------------- DEBUG SETTINGS ---------------------------

		FREQ	4_000_000
	
;------------------------ INITIALIZATION ROUTINE -----------------------

Initialize
		;Port Direction Configuration
		mov	ra,#%0000		;Set port A low
		mov	rb,#%11111111		;Set port B high
		mov	rc,#%11110000		;Set port C bits 4-7 high, 0-3 low

		mov	W,#$1F			;Allow Direction configuration
		mov	M,W
		mov	!ra,#%0000		;Set port A bits 0-3 to output
		mov	!rb,#%11111111		;Set port B bits 0-7 to input
		mov	!rc,#%00000000		;Set port C bits 0-7 output

;---------------------------- MAIN PROGRAM -----------------------------

Main		
		jmp	Main

Comments


  • How do you know if you are in SASM or PASM?

    I would like to clean this up and just have one set of directives in there.

  • Figured it out;Sort of.We are in SASM according to Configure.

    Okay.Anybody know what SASM is? Scenix assembler compiler?

    SX%20Editor%20Configure%20Pop%20Up.png
    1366 x 768 - 161K

  • Found out what SASM is.From SX Blitz guide.
    7 The SASM Assembler
    This part of the manual describes the SASM assembler (integrated in the SX-Key Version 2.0 software)
    which is an enhanced version of Ubicom’s SASM.
    The SX-Key software 2.0 and above supports both assemblers, the Ubicom SASM which is described in
    this chapter, and the Parallax Assembler which is described briefly in the next chapter.
    Although you may select between both assemblers using the Configure dialog, it is highly suggested
    that you design all new code for SASM, and use the Parallax Assembler for “old” source code only,
    written under previous versions of the SX-Key software. You should even consider changing such code
    so that is assembles under SASM, or both because there are only a few minor modifications necessary
    for that purpose (see Chapter 9 – Upgrading Existing Code for SASM).
    The main task of the assembler is to translate the contents of program source code files into code that
Sign In or Register to comment.