1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SDK6800 Assembly Program Help

Discussion in 'Assembly Language Programming (ALP) Forum' started by ashley125, May 28, 2008.

  1. ashley125

    ashley125 New Member

    Joined:
    May 28, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Hi,

    I've got a question about using the 6800 emulator to create a program that multiplies 2 arbitary 8 bit numbers to generate an 8 bit number. now, i've attempted it, this is what i've done in the quote below.

    Okay, the teacher went through it in class, and he showed how it was shifting each step, eg:

    C P A
    0 0000 1011
    N=1 0 1110 1011 (LSB = 1, so P+B=P)
    0111 0101 (Shift Bits Right)
    N=2 1 0101 0101 (LSB = 1, so P+B=P)
    0 1010 1010 (Shift Bits Right)

    So at first i couldn't do it, but i attempted it and i did that in the quote up the top. I don't think it's correct though cause when i look at it, it just doesn't look right. I was wondering if anyone could give me some pointers on what im doing wrong so I at least know how to fix it.

    Thanks,

    Ashley
     
  2. ashley125

    ashley125 New Member

    Joined:
    May 28, 2008
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    right it didn't list the codes very well, i'll list them again:

    Code:
    eleven 	.equ 	11
    fourteen 	.equ 	14
    P 	.equ 	0
    
    	ldab 	#4
    
    loop 	cba
    	ldaa	 #eleven
    	tst	 0,x
    	jmp 	PnB
    PnB 	ldaa 	#fourteen
    	adda 	#P
    	jmp 	plus
    plus 	asla
    	staa 	P
    	jmp 	shiftP
    shiftP 	ldaa 	#P
    	asla
    	decb
    	tstb
    	bne loop
    	.org $0120 
    
    	.end
    
    and the other code

    Code:
    	C 	P 	A
    	0 	0000 	1011
    N=1	0 	1110 	1011	(LSB = 1, so P+B=P)
    		0111 	0101 	(Shift Bits Right)
    N=2 	1 	0101 	0101 	(LSB = 1, so P+B=P)
    	0 	1010 	1010 	(Shift Bits Right)
    
     
  3. Kapadia1001

    Kapadia1001 New Member

    Joined:
    May 5, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi,

    I've got a question about using the 6800 emulator to create a program which counts the number of factors of an input variable. The input is stored at the end of the program in the variable n. The output should be stored in a variable called numFactors. Now, i've attempted it, this is what i've done in the quote below.

    ldaa n
    ldab x
    startloop suba numFactors
    tsta
    dec x
    bmi stop
    bra startloop
    n .byte 15
    x .byte 1
    numFactors .byte 1
    stop .end
     

Share This Page