Assembler: please kick me in the right direction


Results 1 to 27 of 27

Threaded View

  1. #17
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,154


    Did you find this post helpful? Yes | No

    Default

    Ok, I've researched each instruction and these 5 have no direct translations:

    PUSH, push direct byte onto stack
    POP, pop direct byte from stack
    MUL, multiply
    ADDC, add into accumulator
    MOVC, move code byte to accumulator

    I wouldn't be surprised if the equivalent PIC Macro instructions are staring me in the face, but I don't want to start guessing. Here is some code to show the context the commands are used in:

    ; write an ASCII character to the display
    ; The font file starts at ascii 32 (blank). The default font is 8x8 pixels
    ; INPUTS - character in register A
    write_char:
    push dph
    push dpl
    clr c
    subb a,#32 ;ascii font with blank
    mov b,#8 ;multiply by 8 (8 bytes/char)
    mul ab
    add a,#low(font) ;add to font table address
    mov dpl,a
    mov a,b
    addc a,#high(font)
    mov dph,a
    mov r0,#8 ;8 bytes/char
    wbyte: clr a
    movc a,@a+dptr
    acall write_data
    inc dptr
    djnz r0,wbyte
    pop dpl
    pop dph
    ret

    8051 assembler reference here:
    http://www.ece.umr.edu/computing/uni...e/tasking/asm/

    PIC Macro assembler reference:

    Robert
    Attached Files Attached Files
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

Similar Threads

  1. decoding quadrature encoders
    By ice in forum mel PIC BASIC Pro
    Replies: 93
    Last Post: - 28th February 2017, 09:02
  2. PIC assembler forum?
    By Lajko in forum Off Topic
    Replies: 1
    Last Post: - 29th September 2008, 05:34
  3. Assembler problem
    By om3bc in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 25th March 2008, 19:12
  4. Am I reading this assembler correctly?
    By crhomberg in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 13th November 2007, 12:20
  5. Which assembler are you using?
    By picnaut in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 1st November 2005, 20:34

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts