Program

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Program

491 Views
making
Contributor I

I am having problems wtih this program and am stuck does anyone have suggestions

 

; algorithm for equation of form: z = (2w+3)/4

 XDEF Entry, main
     XREF __SEG_END_SSTACK   

RAM_Data: SECTION

       ORG $1100
w  dc.b  #100
 
       ORG $1110
; output value
z    ds.w  1

Code:     SECTION
main:
Entry:   

ldaa w  

ldab #2
mul           ; d = a x b 

addd #3   

ldx #4    
idiv          ; x = d/x,   d=rem

xgdx      ; get quotient in d so it can be...
std z         ; ... stored to memory

L1: bra L1  ; program ends in a loop

***** end of file *****

Labels (1)
0 Kudos
1 Reply

400 Views
astro_goto
Contributor III

Only thing wrong with your program is the # sign in front of the value 100.

0 Kudos