Program

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Program

955 次查看
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 *****

标签 (1)
0 项奖励
回复
1 回复

864 次查看
astro_goto
Contributor III

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

0 项奖励
回复