Assembly code equivelant to Javas System.out.print()

Discussion in 'Homework Help' started by Sebbe, Dec 20, 2015.

  1. Sebbe

    Thread Starter New Member

    Dec 20, 2015
    8
    0
    Hi, one thing that I find makes Assembly harder to learn than Java is that it is much harder to troubleshoot.
    For example in Java I can write a few System.out.println-lines to keep me informed about the current status/value of a variable.

    Is there something equivelant or similar for Assembly?
    For example to get the value of R22 printed in the console during execution of code.

    test:
    LDI R22, 0xFF
    INC R22
    CPI R22,10
    BRNE test
    RET
     
  2. WBahn

    Moderator

    Mar 31, 2012
    17,768
    4,802
    Assembly is harder in most respects precisely because it is a very, very low level language that gives you as much control of the machine as you can hope to have. The price to pay for that is that it is harder to use.

    As for something equivalent in Assembly, don't count on it. The Java println() method, as well as comparable I/O procedures in other languages, are extremely complex functions that are able to handle data in many different formats -- that's a lot of code.

    But there is no way that anyone here can even make suggestions because you give no hint as to which Assembly language you are using, what processor, what assembler, nothing.
     
  3. Sebbe

    Thread Starter New Member

    Dec 20, 2015
    8
    0
    I see. Thanks for the answer. I am using a ATmega32u4 CPU and Atmel studio.
     
  4. WBahn

    Moderator

    Mar 31, 2012
    17,768
    4,802
    So look through the documentation for Atmel studio and see what higher-level macros are available to you.

    A lot of it will depend on what BIOS/monitor system calls you have available.

    There's also nothing that prevents you from writing your own comparable subroutines.
     
  5. sirch2

    Well-Known Member

    Jan 21, 2013
    1,008
    351
    Sounds like you need an in circuit debugger, something like the JTAG-ICE
     
  6. Sebbe

    Thread Starter New Member

    Dec 20, 2015
    8
    0
    Thanks, I will look into it.
     
Loading...