In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Heineken wrote: hello, sorry for the mistakes the code had, thats the correct code [code] device SX28L, OSCHS,TURBO reset start_point freq 4000000 ;4Mhz resonator org 8 addend ds 1 adder ds 1 Sum ds 1 Subtrahend ds 1 subtractor ds 1 difference ds 1 X ds 1 org 0 ; begin code on page 0 start_point mov !ra,#$f ; all of port A lines are input mov !rb,#$ff ; all of port B lines are output ; main program starts here arithloop mov Addend,#137 ; Addend value mov X,Addend call output ; display Addend mov Adder,#27 ; Adder Value mov X,Adder call output ; display Adder mov Sum,Addend ; first value in Sum add Sum,Adder ; perform addition mov X,Sum call output ; display Sum mov Subtrahend, #137 ; Subtrahend value mov X,Subtrahend call output ; display Subtrahend mov Subtractor,#27; Subtracter Value mov X, Subtractor call output ; display Subtracter mov Difference,Subtrahend ; first value in Difference sub Difference,Subtractor ; perform subtraction mov X,Difference ; display Difference call output jmp arithloop ; start again ; The subroutine defined below displays the value contained in X at LEDs attached to all ; lines of Port B output mov W,X not W ; invert the bits, l's complement mov rb,W ra0ontest jb ra.0,ra0ontest ra0offtest jnb ra.0,ra0offtest ra1ontest jb ra.1,ra1ontest ra1offtest jnb ra.1,ra1offtest ret [/code] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=121474#m122100 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2006 (http://www.dotNetBB.com)